From dbf38e02c9ade4979418f24a99962cfef170b957 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Wed, 27 Jul 2011 22:45:56 +0200 Subject: [PATCH] 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 --- src/ChangeLog | 5 +++++ src/gnutls.c | 3 +++ 2 files changed, 8 insertions(+) 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; -- 2.39.2