emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r101901: Fix gnutls write-before-nego


From: Lars Magne Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101901: Fix gnutls write-before-negotiation case.
Date: Sun, 10 Oct 2010 20:47:45 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101901
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Sun 2010-10-10 20:47:45 +0200
message:
  Fix gnutls write-before-negotiation case.
  
  * gnutls.c (emacs_gnutls_write): If we're trying to write before
  gnutls is ready, return EAGAIN as the errno.
modified:
  src/ChangeLog
  src/gnutls.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-10-10 15:49:31 +0000
+++ b/src/ChangeLog     2010-10-10 18:47:45 +0000
@@ -1,3 +1,8 @@
+2010-10-10  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * gnutls.c (emacs_gnutls_write): If we're trying to write before
+       gnutls is ready, return EAGAIN as the errno.
+
 2010-10-10  Dan Nicolaescu  <address@hidden>
 
        * vm-limit.c:

=== modified file 'src/gnutls.c'
--- a/src/gnutls.c      2010-10-09 13:54:57 +0000
+++ b/src/gnutls.c      2010-10-10 18:47:45 +0000
@@ -77,8 +77,15 @@
   register int rtnval, bytes_written;
   gnutls_session_t state = proc->gnutls_state;
 
-  if (proc->gnutls_initstage != GNUTLS_STAGE_READY)
+  if (proc->gnutls_initstage != GNUTLS_STAGE_READY) {
+#ifdef EWOULDBLOCK
+    errno = EWOULDBLOCK;
+#endif
+#ifdef EAGAIN
+    errno = EAGAIN;
+#endif
     return -1;
+  }
 
   bytes_written = 0;
 


reply via email to

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