From: Lars Magne Ingebrigtsen Date: Wed, 27 Jul 2011 20:45:56 +0000 (+0200) Subject: Silence error message we get in gnutls when the peer hangs up X-Git-Tag: emacs-pretest-24.0.90~104^2~159^2~10 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dbf38e02c9ade4979418f24a99962cfef170b957;p=emacs.git Silence error message we get in gnutls when the peer hangs up * gnutls.c (emacs_gnutls_read): Don't message anything if the peer closes the connection while we're reading. Fixes: debbugs:9182 --- diff --git a/src/ChangeLog b/src/ChangeLog index dd25d155c66..e204ff2040b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-07-27 Lars Magne Ingebrigtsen + + * 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 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons diff --git a/src/gnutls.c b/src/gnutls.c index 3175f55041d..fc651d2c7e4 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -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;