]> git.eshelyaron.com Git - emacs.git/commitdiff
Silence error message we get in gnutls when the peer hangs up
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 27 Jul 2011 20:45:56 +0000 (22:45 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 27 Jul 2011 20:45:56 +0000 (22:45 +0200)
* gnutls.c (emacs_gnutls_read): Don't message anything if the peer
closes the connection while we're reading.

Fixes: debbugs:9182
src/ChangeLog
src/gnutls.c

index dd25d155c66937f4b22834037da3843a761ef1b4..e204ff2040b0029b5c0d70a9a819c960e9e0079c 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
+       closes the connection while we're reading (bug#9182).
+
 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
index 3175f55041d35efa2db37369b3aee59429d9e716..fc651d2c7e49b6587c7771494991da3dcfedee2c 100644 (file)
@@ -382,6 +382,9 @@ emacs_gnutls_read (struct Lisp_Process *proc, char *buf, EMACS_INT nbyte)
   rtnval = fn_gnutls_record_recv (state, buf, nbyte);
   if (rtnval >= 0)
     return rtnval;
+  else if (rtnval == GNUTLS_E_UNEXPECTED_PACKET_LENGTH)
+    /* The peer closed the connection. */
+    return 0;
   else if (emacs_gnutls_handle_error (state, rtnval) == 0)
     /* non-fatal error */
     return -1;