From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] download: Do not wrap TLS port on GnuTLS >= 3.7.7. Date: Tue, 02 Aug 2022 09:59:22 +0200 Message-ID: <87pmhjuld1.fsf@gnu.org> References: <20220801090749.11655-1-ludo@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39417"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) Cc: 56867@debbugs.gnu.org, guile-devel@gnu.org To: Maxime Devos Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Aug 02 10:42:20 2022 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oInTn-000A2P-JS for guile-devel@m.gmane-mx.org; Tue, 02 Aug 2022 10:42:19 +0200 Original-Received: from localhost ([::1]:50866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oInTl-0004ZE-DK for guile-devel@m.gmane-mx.org; Tue, 02 Aug 2022 04:42:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oImoI-0006Qi-JW for guile-devel@gnu.org; Tue, 02 Aug 2022 03:59:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oImoH-00056E-6g; Tue, 02 Aug 2022 03:59:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=M/MRahan9GOHyklSBrHe0sq+kRwM7gSgmVZUpWZ1Gy4=; b=QhxJPeIfbaNT2CMI+VXx x4g3qTSzBmyOhjkkVbNPAy52wYmb0DxMWAleDqdDv51TICE/YtMGdS55flREfpN2xOgJgB2PUcvKd SlbkHUrvAlzVvuq9cpdITC6VdISHHTj2hWeoxJy+M4g4HjkrEkqyXrzSF+BJIq+GVfI900420rz4N OerxT0bkSER9K4zyxTwceAP2pwpB0kAY33DDpxHwXWhAZ8WRkKAckZtsGzVjDcxNNT8eh9N+C75Ln 4KIBs9+qWdcJuo67o2MriKVpwFQBgUEDBpE1wPGGTkyBGtg7k3XMpNacuMEVEWOxgElktt6AaAK6d iOhMqsDj0H+JcQ==; Original-Received: from [193.50.110.235] (port=37018 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oImoG-0007dE-Qh; Tue, 02 Aug 2022 03:59:25 -0400 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 15 Thermidor an 230 de la =?utf-8?Q?R=C3=A9?= =?utf-8?Q?volution=2C?= jour de la Brebis X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu In-Reply-To: (Maxime Devos's message of "Mon, 1 Aug 2022 11:56:00 +0200") X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21275 Archived-At: Hi, Maxime Devos skribis: > On 01-08-2022 11:07, Ludovic Court=C3=A8s wrote: [...] >> + (define (read! bv start count) >> + (define read >> + (catch 'gnutls-error >> + (lambda () >> + (get-bytevector-n! record bv start count)) >> + (lambda (key err proc . rest) >> + ;; When responding to "Connection: close" requests, some serv= ers >> + ;; close the connection abruptly after sending the response b= ody, >> + ;; without doing a proper TLS connection termination. Treat = it as >> + ;; EOF. This is fixed in GnuTLS 3.7.7. >> + (if (eq? err error/premature-termination) >> + the-eof-object >> + (apply throw key err proc rest))))) > > Objection: 'catch' makes the backtrace part happening inside the > 'get-bytevector-n!' disappear, because it is unwinding, as has been > noted a few times (in different contexts) by Attila Lendvai and me.=C2=A0 > Maybe use 'guard' with an appropriate condition instead? This code was already there and has just been moved around. (It=E2=80=99s = also code that will no longer be used going forward.) >> + (if (module-defined? (resolve-interface '(gnutls)) >> + 'set-session-record-port-close!) ;GnuTLS >= =3D 3.7.7 > > resolve-module (and presumably also sets #:ensure #t by default, which > sometimes causes 'module not found' messages to be replaced by > 'unbound variable', which I don't think is useful behaviour, can > #:ensure be set to #false? This is unnecessary: see the =E2=80=98load-gnutls=E2=80=99 mechanism there.= The idiom above is already used in a couple of places. Thanks for your feedback! Ludo=E2=80=99.