emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 42e2367: Tweak TLS error messaging on closed connec


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 42e2367: Tweak TLS error messaging on closed connections
Date: Tue, 24 Jan 2017 23:23:42 +0000 (UTC)

branch: master
commit 42e23674133e881092c05814c6e11224e642f5f8
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Tweak TLS error messaging on closed connections
    
    * src/gnutls.c (emacs_gnutls_handle_error): Demote the normal
    peer-closed-connection "The TLS connection was non-properly
    terminated" message to a lower level so that it isn't shown to
    the user by default.
---
 src/gnutls.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/gnutls.c b/src/gnutls.c
index 735d2e3..6fa0e10 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -582,8 +582,15 @@ emacs_gnutls_handle_error (gnutls_session_t session, int 
err)
 
   if (gnutls_error_is_fatal (err))
     {
+      int level = 1;
+      /* Mostly ignore "The TLS connection was non-properly
+        terminated" message which just means that the peer closed the
+        connection.  */
+      if (err == GNUTLS_E_PREMATURE_TERMINATION)
+       level = 3;
+
+      GNUTLS_LOG2 (level, max_log_level, "fatal error:", str);
       ret = 0;
-      GNUTLS_LOG2 (1, max_log_level, "fatal error:", str);
     }
   else
     {



reply via email to

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