aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Ingebrigtsen2017-01-25 00:23:28 +0100
committerLars Ingebrigtsen2017-01-25 00:23:28 +0100
commit42e23674133e881092c05814c6e11224e642f5f8 (patch)
tree48890829b8871132f0c1b5c9edc69e66d1d876d5 /src
parent456696a838dfef73364ca025a210d2198fd8390d (diff)
downloademacs-42e23674133e881092c05814c6e11224e642f5f8.tar.gz
emacs-42e23674133e881092c05814c6e11224e642f5f8.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/gnutls.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gnutls.c b/src/gnutls.c
index 735d2e35810..6fa0e109728 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -582,8 +582,15 @@ emacs_gnutls_handle_error (gnutls_session_t session, int err)
582 582
583 if (gnutls_error_is_fatal (err)) 583 if (gnutls_error_is_fatal (err))
584 { 584 {
585 int level = 1;
586 /* Mostly ignore "The TLS connection was non-properly
587 terminated" message which just means that the peer closed the
588 connection. */
589 if (err == GNUTLS_E_PREMATURE_TERMINATION)
590 level = 3;
591
592 GNUTLS_LOG2 (level, max_log_level, "fatal error:", str);
585 ret = 0; 593 ret = 0;
586 GNUTLS_LOG2 (1, max_log_level, "fatal error:", str);
587 } 594 }
588 else 595 else
589 { 596 {