unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: 36660@debbugs.gnu.org
Subject: bug#36660: 27.0.50; :nowait fails when failing over when using TLS
Date: Mon, 15 Jul 2019 13:10:01 +0200	[thread overview]
Message-ID: <m2blxvsgdy.fsf@gmail.com> (raw)
In-Reply-To: <m2ftn7sgyu.fsf@gmail.com> (Robert Pluim's message of "Mon, 15 Jul 2019 12:57:29 +0200")

[-- Attachment #1: Type: text/plain, Size: 40 bytes --]


O frabjous day! What a bug number :-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Don-t-delete-GnuTLS-boot-parameters-too-early.patch --]
[-- Type: text/x-patch, Size: 1386 bytes --]

From cfd2d8cbadc3c2b744e40c47cdce4344da1eef77 Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
Date: Mon, 15 Jul 2019 13:04:59 +0200
Subject: [PATCH] Don't delete GnuTLS boot parameters too early
To: emacs-devel@gnu.org

When falling back from one IP address to another for the same host, we
need to keep the TLS boot parameters around until we've actually
managed to connect, otherwise the fallback connection(s) will use TCP
rather than TLS.  (Bug#36660)

* src/process.c (connect_network_socket): Don't delete the GnuTLS
boot parameters until after we've managed to connect at the IP
level.
---
 src/process.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/process.c b/src/process.c
index cab390c10c..23c9be2b7b 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3682,11 +3682,14 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
       Lisp_Object boot, params = p->gnutls_boot_parameters;
 
       boot = Fgnutls_boot (proc, XCAR (params), XCDR (params));
-      p->gnutls_boot_parameters = Qnil;
 
       if (p->gnutls_initstage == GNUTLS_STAGE_READY)
+        {
 	/* Run sentinels, etc. */
+          p->gnutls_boot_parameters = Qnil;
+
 	finish_after_tls_connection (proc);
+        }
       else if (p->gnutls_initstage != GNUTLS_STAGE_HANDSHAKE_TRIED)
 	{
 	  deactivate_process (proc);
-- 
2.21.0.419.gffac537e6c


  reply	other threads:[~2019-07-15 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 10:57 bug#36660: 27.0.50; :nowait fails when failing over when using TLS Robert Pluim
2019-07-15 11:10 ` Robert Pluim [this message]
2019-07-15 11:31   ` Lars Ingebrigtsen
2019-07-15 14:39     ` Robert Pluim
2019-07-15 14:46       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2blxvsgdy.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=36660@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).