changeset 19880:c37bf0f5ea22

lib-ssl-iostream: If verbose=TRUE, internally log all errors.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 28 Feb 2016 19:55:53 +0200
parents ea145b3d31bf
children f6f26683890a
files src/lib-ssl-iostream/iostream-openssl.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-ssl-iostream/iostream-openssl.c	Sun Feb 28 19:51:54 2016 +0200
+++ b/src/lib-ssl-iostream/iostream-openssl.c	Sun Feb 28 19:55:53 2016 +0200
@@ -12,6 +12,12 @@
 static void
 openssl_iostream_set_error(struct ssl_iostream *ssl_io, const char *str)
 {
+	if (ssl_io->verbose) {
+		/* This error should normally be logged by lib-ssl-iostream's
+		   caller. But if verbose=TRUE, log it here as well to make
+		   sure that the error is always logged. */
+		i_debug("%sSSL error: %s", ssl_io->log_prefix, str);
+	}
 	i_free(ssl_io->last_error);
 	ssl_io->last_error = i_strdup(str);
 }