changeset 110878:39b6f8749957

(emacs_gnutls_write): Check for GNUTLS_E_AGAIN and not EINTR. According to the documentation, this is correct, and it seems to make things work.
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Sat, 09 Oct 2010 15:54:57 +0200
parents f60f4abe5849
children f4089d3a565a
files src/ChangeLog src/gnutls.c
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Oct 09 15:27:24 2010 +0200
+++ b/src/ChangeLog	Sat Oct 09 15:54:57 2010 +0200
@@ -5,6 +5,9 @@
 	(emacs_gnutls_read): Return -1 if we got an error from
 	gnutls_read().  This allows us to actually read lots of data from
 	the GnuTLS stream.
+	(emacs_gnutls_write): Check for GNUTLS_E_AGAIN and not EINTR.
+	According to the documentation, this is correct, and it seems to
+	make things work.
 
 2010-10-09  Chong Yidong  <cyd@stupidchicken.com>
 
--- a/src/gnutls.c	Sat Oct 09 15:27:24 2010 +0200
+++ b/src/gnutls.c	Sat Oct 09 15:54:57 2010 +0200
@@ -86,9 +86,9 @@
     {
       rtnval = gnutls_write (state, buf, nbyte);
 
-      if (rtnval == -1)
+      if (rtnval < 0)
         {
-          if (errno == EINTR)
+          if (rtnval == GNUTLS_E_AGAIN || rtnval == GNUTLS_E_INTERRUPTED)
             continue;
           else
             return (bytes_written ? bytes_written : -1);