From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: thomas@m3y3r.de Newsgroups: gmane.emacs.bugs Subject: bug#32658: gnutls + non-blocking url-retrieve Date: Wed, 03 Oct 2018 16:15:31 +0200 Message-ID: <86d0srp14s.fsf@DESKTOP-DQBDJ0U.i-did-not-set--mail-host-address--so-tickle-me> References: <861sa5zmpt.fsf@DESKTOP-DQBDJ0U.i-did-not-set--mail-host-address--so-tickle-me> <86tvm6smax.fsf@DESKTOP-DQBDJ0U.i-did-not-set--mail-host-address--so-tickle-me> <83efda431j.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1538576096 28480 195.159.176.226 (3 Oct 2018 14:14:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 3 Oct 2018 14:14:56 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (windows-nt) Cc: thomas@m3y3r.de, 32658@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 03 16:14:52 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g7hvP-0007I2-GD for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Oct 2018 16:14:51 +0200 Original-Received: from localhost ([::1]:48984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7hxW-0003wt-4k for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Oct 2018 10:17:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7hwh-0003Zu-M8 for bug-gnu-emacs@gnu.org; Wed, 03 Oct 2018 10:16:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7hwa-0006RJ-6q for bug-gnu-emacs@gnu.org; Wed, 03 Oct 2018 10:16:11 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g7hwY-0006PX-Sl for bug-gnu-emacs@gnu.org; Wed, 03 Oct 2018 10:16:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g7hwY-0001AE-Eq for bug-gnu-emacs@gnu.org; Wed, 03 Oct 2018 10:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: thomas@m3y3r.de Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Oct 2018 14:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32658-submit@debbugs.gnu.org id=B32658.15385761414442 (code B ref 32658); Wed, 03 Oct 2018 14:16:02 +0000 Original-Received: (at 32658) by debbugs.gnu.org; 3 Oct 2018 14:15:41 +0000 Original-Received: from localhost ([127.0.0.1]:35734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g7hwC-00019Z-Oy for submit@debbugs.gnu.org; Wed, 03 Oct 2018 10:15:40 -0400 Original-Received: from www17.your-server.de ([213.133.104.17]:45662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g7hwB-00019K-2J for 32658@debbugs.gnu.org; Wed, 03 Oct 2018 10:15:39 -0400 Original-Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www17.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1g7hw4-0007Wg-Gu; Wed, 03 Oct 2018 16:15:32 +0200 Original-Received: from [2a02:908:4c22:d900:308d:b0fc:a80d:59a9] (helo=DESKTOP-DQBDJ0U) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1g7hw4-000Eag-BU; Wed, 03 Oct 2018 16:15:32 +0200 In-Reply-To: <83efda431j.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Oct 2018 09:03:04 +0300") X-Authenticated-Sender: thomas@m3y3r.de X-Virus-Scanned: Clear (ClamAV 0.100.1/25003/Wed Oct 3 14:47:04 2018) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150911 Archived-At: Eli Zaretskii writes: >> From: thomas@m3y3r.de >> Date: Sun, 30 Sep 2018 23:33:10 +0200 >> >> 1.) I needed to revert to gnutls 3.5.19, the mingw64 build from the >> gitlab ci build seems to have a working gnutls-cli tools on windows 10. >> the gitlab builds for 3.6.3 and 3.6.4 seems to have another bug >> (error code -53) in the gnutls-cli command. >> >> so only gnutls 3.5.19 have a working gnutls-cli. i installed this version in emacs 26.1 >> >> 2.) testing gnutls stream >> using open-gnutls-stream directly gives me a correct tls connection but >> eww still fails to load the site. >> >> when I change url-open-stream in url/url-gw.el to: >> (open-network-stream >> name buffer host service >> :type gw-method >> ;; Use non-blocking socket if we can. >> :nowait nil)) >> >> I finally can open lwn.net in eww. >> >> so something seems to be wrong possible with blocking/non-blocking >> network access. >> >> any ideas? > > Thanks for the info. so what happens in process.c:3669 in function connect_network_socket when gnutls_boot returns with GNUTLS_STAGE_HANDSHAKE_TRIED and boot(error code) will error GNUTLS_E_AGAIN (and not even considered, as far as I understand the code). I think this is what happens in may case. gnutls_boot calls gnutls_try_handshake (gnutls.c:595) and the do/while loops returns after 3 times (what I don't understand is: why is this happening, can maybe_quit() somewho break the loop?) do { ret = gnutls_handshake (state); emacs_gnutls_handle_error (state, ret); maybe_quit (); } while (ret < 0 && gnutls_error_is_fatal (ret) == 0 && ! non_blocking); //HINT: maybe save emacs_gnutls_handle_error return value and check this instead of calling gnutls_error_is_fatal again? proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED; if (ret == GNUTLS_E_SUCCESS) { /* Here we're finally done. */ proc->gnutls_initstage = GNUTLS_STAGE_READY; } else { /* check_memory_full (gnutls_alert_send_appropriate (state, ret)); */ } return ret; so what do you think?