emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] feature/async-dns 42ef301 2/3: Always boot TLS if given pa


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] feature/async-dns 42ef301 2/3: Always boot TLS if given parameters
Date: Mon, 01 Feb 2016 02:37:38 +0000

branch: feature/async-dns
commit 42ef3013781146c62ece536c10c50bb5a5dc1f78
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Always boot TLS if given parameters
    
    * src/process.c (connect_network_socket): If we have the TLS
    parameters, then boot the socket.
---
 src/gnutls.c  |    2 +-
 src/process.c |   23 ++++++++++++-----------
 src/process.h |    2 +-
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/gnutls.c b/src/gnutls.c
index a0b6e0d..fb3c3c2 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -695,7 +695,7 @@ to finish setting up the connection. */)
 {
   CHECK_PROCESS (proc);
 
-  XPROCESS (proc)->gnutls_async_parameters = params;
+  XPROCESS (proc)->gnutls_boot_parameters = params;
   return Qnil;
 }
 
diff --git a/src/process.c b/src/process.c
index 13f4b6a..8849b20 100644
--- a/src/process.c
+++ b/src/process.c
@@ -710,7 +710,7 @@ make_process (Lisp_Object name)
 
 #ifdef HAVE_GNUTLS
   p->gnutls_initstage = GNUTLS_STAGE_EMPTY;
-  p->gnutls_async_parameters = Qnil;
+  p->gnutls_boot_parameters = Qnil;
 #endif
 
   /* If name is already in use, modify it until it is unused.  */
@@ -3304,16 +3304,17 @@ void connect_network_socket (Lisp_Object proc, 
Lisp_Object ip_addresses)
 
 #ifdef HAVE_GNUTLS
   /* Continue the asynchronous connection. */
-  if (!NILP (p->gnutls_async_parameters) && p->is_non_blocking_client) {
-    Lisp_Object boot, params = p->gnutls_async_parameters;
+  if (!NILP (p->gnutls_boot_parameters))
+    {
+      Lisp_Object boot, params = p->gnutls_boot_parameters;
 
-   p->gnutls_async_parameters = Qnil;
-    boot = Fgnutls_boot (proc, XCAR (params), XCDR (params));
-    if (NILP (boot) || STRINGP (boot)) {
-      pset_status (p, Qfailed);
-      deactivate_process (proc);
+      p->gnutls_boot_parameters = Qnil;
+      boot = Fgnutls_boot (proc, XCAR (params), XCDR (params));
+      if (NILP (boot) || STRINGP (boot)) {
+       pset_status (p, Qfailed);
+       deactivate_process (proc);
+      }
     }
-  }
 #endif
 
 }
@@ -3831,7 +3832,7 @@ usage: (make-network-process &rest ARGS)  */)
 #ifdef HAVE_GNUTLS
   tem = Fplist_get (contact, QCtls_parameters);
   CHECK_LIST (tem);
-  p->gnutls_async_parameters = tem;
+  p->gnutls_boot_parameters = tem;
 #endif
 
   unbind_to (count, Qnil);
@@ -5891,7 +5892,7 @@ send_process (Lisp_Object proc, const char *buf, 
ptrdiff_t len,
 #ifdef HAVE_GNUTLS
   /* The TLS connection hasn't been set up yet, so we can't write
      anything on the socket. */
-  if (p->gnutls_async_parameters)
+  if (p->gnutls_boot_parameters)
     return;
 #endif
 
diff --git a/src/process.h b/src/process.h
index 828330b..c753157 100644
--- a/src/process.h
+++ b/src/process.h
@@ -106,7 +106,7 @@ struct Lisp_Process
 
 #ifdef HAVE_GNUTLS
     Lisp_Object gnutls_cred_type;
-    Lisp_Object gnutls_async_parameters;
+    Lisp_Object gnutls_boot_parameters;
 #endif
 
     /* Pipe process attached to the standard error of this process.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]