From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#22789: 25.1.50; In last master build https connections stop working Date: Fri, 26 Feb 2016 12:59:39 +1030 Message-ID: <87k2lsnqzw.fsf@gnus.org> References: <864mcyo14y.fsf@Lenovo-PC.i-did-not-set--mail-host-address--so-tickle-me> <87d1rmxl65.fsf@gnus.org> <86povm6qeu.wl-j_l_domenech@yahoo.com> <83k2lugeym.fsf@gnu.org> <871t81wtyt.fsf@gnus.org> <87r3g1veqc.fsf@gnus.org> <83k2lsg2sx.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456453884 19087 80.91.229.3 (26 Feb 2016 02:31:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Feb 2016 02:31:24 +0000 (UTC) Cc: j_l_domenech@yahoo.com, 22789@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 26 03:31:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aZ8BT-00069I-Oc for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Feb 2016 03:31:11 +0100 Original-Received: from localhost ([::1]:46911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ8BS-0001pu-GQ for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Feb 2016 21:31:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ8BP-0001pp-5k for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 21:31:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZ8BK-0005ay-5v for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 21:31:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49397) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ8BK-0005ak-2J for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 21:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aZ8BJ-0006Fc-TY for bug-gnu-emacs@gnu.org; Thu, 25 Feb 2016 21:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Feb 2016 02:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22789 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22789-submit@debbugs.gnu.org id=B22789.145645381823976 (code B ref 22789); Fri, 26 Feb 2016 02:31:01 +0000 Original-Received: (at 22789) by debbugs.gnu.org; 26 Feb 2016 02:30:18 +0000 Original-Received: from localhost ([127.0.0.1]:46524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZ8Ac-0006Ee-Er for submit@debbugs.gnu.org; Thu, 25 Feb 2016 21:30:18 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:54569) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZ8AZ-0006ET-Vs for 22789@debbugs.gnu.org; Thu, 25 Feb 2016 21:30:16 -0500 Original-Received: from [175.103.25.178] (helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aZ8A6-0000jz-1t; Fri, 26 Feb 2016 03:29:46 +0100 In-Reply-To: <83k2lsg2sx.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 25 Feb 2016 18:41:50 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aZ8A6-0000jz-1t MailScanner-NULL-Check: 1457058587.49518@KTpPSm49rW5eX4teqew2og 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113827 Archived-At: Eli Zaretskii writes: > It stays "connect" forever. But "netstat" doesn't show any > connections to that server, AFAICT. I think the connection simply > doesn't begin. Hm... when you mentioned that the Windows GnuTLS functions used our own functions for the actual pull/push, I thought that perhaps the problem was there (and was about to suggest the patch below), but this must mean that the socket isn't even created. `make-network-socket' ends with #ifdef HAVE_GETADDRINFO_A /* If we're doing async address resolution, the list of addresses here will be nil, so we postpone connecting to the server. */ if (!p->is_server && NILP (ip_addresses)) { p->dns_request = dns_request; p->status = Qconnect; } else { connect_network_socket (proc, ip_addresses); } #else /* HAVE_GETADDRINFO_A */ connect_network_socket (proc, ip_addresses); #endif so that should happen unconditionally on Windows. Let's see... Oh! This code in connect_network_socket looks suspect, perhaps. If it fails, then the socket will never actually be created... hm... but it may be caught later... and it doesn't explain why non-blocking non-TLS sockets still work... so it can't be that... #ifdef NON_BLOCKING_CONNECT if (p->is_non_blocking_client) { ret = fcntl (s, F_SETFL, O_NONBLOCK); if (ret < 0) { xerrno = errno; emacs_close (s); s = -1; continue; } } #endif So perhaps it's in the TLS code anyway. Could you try the following code? It'll make TLS negotiation blocking on WINDOWSNT again. > Btw, one other difference of the Windows build, this time wrt GnuTLS, > is that on Windows we instruct GnuTLS to use our own pull and push > functions, see gnutls.c around line 450. The functions themselves are > defined in w32.c, at the end. diff --git a/src/gnutls.c b/src/gnutls.c index d1b34c5..00d0e56 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -410,12 +410,17 @@ gnutls_try_handshake (struct Lisp_Process *proc) QUIT; } while (ret < 0 && gnutls_error_is_fatal (ret) == 0 - && ! proc->is_non_blocking_client); +#ifndef WINDOWSNT + && ! proc->is_non_blocking_client +#endif + ); proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED; +#ifndef WINDOWSNT if (proc->is_non_blocking_client) proc->gnutls_p = true; +#endif if (ret == GNUTLS_E_SUCCESS) { -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no