]> git.eshelyaron.com Git - emacs.git/commitdiff
Port to systems lacking GNUTLS_NONBLOCK
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 3 Aug 2016 11:45:47 +0000 (07:45 -0400)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 3 Aug 2016 11:46:30 +0000 (07:46 -0400)
Problem reported by Colin Baxter in:
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00096.html
* src/gnutls.c (Fgnutls_boot): Don’t assume GNUTLS_NONBLOCK is defined.

src/gnutls.c

index e3e9311c48d2e6c3ccc83718ede5011b55e15700..bc35dfb411625e3ad1ddff5cdd39fb20841cdeea 100644 (file)
@@ -1602,8 +1602,12 @@ one trustfile (usually a CA bundle).  */)
   /* Call gnutls_init here: */
 
   GNUTLS_LOG (1, max_log_level, "gnutls_init");
-  int nonblock = XPROCESS (proc)->is_non_blocking_client ? GNUTLS_NONBLOCK : 0;
-  ret = gnutls_init (&state, GNUTLS_CLIENT | nonblock);
+  int gnutls_flags = GNUTLS_CLIENT;
+#ifdef GNUTLS_NONBLOCK
+  if (XPROCESS (proc)->is_non_blocking_client)
+    gnutls_flags |= GNUTLS_NONBLOCK;
+#endif
+  ret = gnutls_init (&state, gnutls_flags);
   XPROCESS (proc)->gnutls_state = state;
   if (ret < GNUTLS_E_SUCCESS)
     return gnutls_make_error (ret);