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: Sun, 28 Feb 2016 09:08:46 +1030 Message-ID: <871t7xhj7t.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> <86si0euizj.fsf@realize.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456612827 28291 80.91.229.3 (27 Feb 2016 22:40:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Feb 2016 22:40:27 +0000 (UTC) Cc: "=?UTF-8?Q?Jos=C3=A9?= L. =?UTF-8?Q?Dom=C3=A9nech?=" , 22789@debbugs.gnu.org To: Alain Schneble Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 27 23:40:16 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 1aZnX5-0001gm-KY for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Feb 2016 23:40:15 +0100 Original-Received: from localhost ([::1]:56601 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZnX1-0005Ek-Oo for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Feb 2016 17:40:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZnWx-0005DE-5n for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 17:40:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZnWs-00040G-2k for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 17:40:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZnWs-00040A-0G for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 17:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aZnWr-0002Gl-P3 for bug-gnu-emacs@gnu.org; Sat, 27 Feb 2016 17:40: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: Sat, 27 Feb 2016 22:40: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.14566127608659 (code B ref 22789); Sat, 27 Feb 2016 22:40:01 +0000 Original-Received: (at 22789) by debbugs.gnu.org; 27 Feb 2016 22:39:20 +0000 Original-Received: from localhost ([127.0.0.1]:49161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZnWC-0002Fb-Ik for submit@debbugs.gnu.org; Sat, 27 Feb 2016 17:39:20 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:55999) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZnW9-0002FR-LT for 22789@debbugs.gnu.org; Sat, 27 Feb 2016 17:39:19 -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 1aZnVk-0006Ya-Cx; Sat, 27 Feb 2016 23:38:53 +0100 In-Reply-To: <86si0euizj.fsf@realize.ch> (Alain Schneble's message of "Sat, 27 Feb 2016 19:05:20 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aZnVk-0006Ya-Cx MailScanner-NULL-Check: 1457217534.37466@idfmGDBjpjcMOLQEOdFReA 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:113985 Archived-At: Alain Schneble writes: > What I found out is that it runs into the following branch in > wait_reading_process_output: > > ... > else > { > /* Preserve status of processes already terminated. */ > XPROCESS (proc)->tick = ++process_tick; > deactivate_process (proc); > if (XPROCESS (proc)->raw_status_new) > update_status (XPROCESS (proc)); > if (EQ (XPROCESS (proc)->status, Qrun)) > pset_status (XPROCESS (proc), > list2 (Qexit, make_number (256))); > } > > Here it deactivates the process, but as its status is "connect", it > won't change it. That's the reason why it remains in "connect" state. > > I guess that it enters this path because the socket is not ready yet. > But why? I will try to figure it out later... I think you're on to something! The thing starts with nread = read_process_output (proc, channel); and for un-setup TLS sockets, it'll now get back -1, and it should ideally end up in the else if (nread == -1 && errno == EAGAIN) ; thing, so that it tries again later. But errno is not EAGAIN here (usually)... Does the following patch make things work on Windows? diff --git a/src/gnutls.c b/src/gnutls.c index d1b34c5..a6b1294 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -403,6 +403,9 @@ gnutls_try_handshake (struct Lisp_Process *proc) gnutls_session_t state = proc->gnutls_state; int ret; + if (proc->is_non_blocking_client) + proc->gnutls_p = true; + do { ret = gnutls_handshake (state); @@ -410,13 +413,13 @@ gnutls_try_handshake (struct Lisp_Process *proc) QUIT; } while (ret < 0 && gnutls_error_is_fatal (ret) == 0 - && ! proc->is_non_blocking_client); +#if 0 + && ! proc->is_non_blocking_client +#endif + ); proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED; - if (proc->is_non_blocking_client) - proc->gnutls_p = true; - if (ret == GNUTLS_E_SUCCESS) { /* Here we're finally done. */ @@ -541,7 +544,10 @@ emacs_gnutls_read (struct Lisp_Process *proc, char *buf, ptrdiff_t nbyte) gnutls_session_t state = proc->gnutls_state; if (proc->gnutls_initstage != GNUTLS_STAGE_READY) - return -1; + { + errno = EAGAIN; + return -1; + } rtnval = gnutls_record_recv (state, buf, nbyte); if (rtnval >= 0) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no