]> code.delx.au - gnu-emacs/commitdiff
Always boot TLS if given parameters
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 1 Feb 2016 02:26:09 +0000 (03:26 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 1 Feb 2016 02:26:09 +0000 (03:26 +0100)
* src/process.c (connect_network_socket): If we have the TLS
parameters, then boot the socket.

src/gnutls.c
src/process.c
src/process.h

index a0b6e0df68be6c7f62995e4a2eb0275ae8358551..fb3c3c22777e74feac34c95511cd40a2a1669b8b 100644 (file)
@@ -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;
 }
 
index 13f4b6aa85e37d455da678f9bbb0d3015b21ae78..8849b20172fa9cb5463b97fcf3934c4a9eaf34e4 100644 (file)
@@ -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
 
index 828330ba9df6575b86c29f00e4e4f1d537f70dd2..c7531576915107ec866d57094451f8256714d259 100644 (file)
@@ -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.  */