aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-05 16:54:32 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-05 16:54:32 +0000
commit598b67ccc50489063327146d204cc1ca90136d04 (patch)
tree1f31d3a3a8b15bae9252a250c0e9e7914a7c5f3a
parentdbcb9552ae53d6d7f7150a3a229ae90382ea2246 (diff)
downloadrspamd-598b67ccc50489063327146d204cc1ca90136d04.tar.gz
rspamd-598b67ccc50489063327146d204cc1ca90136d04.zip
[Minor] Fix log tag in ssl connections
-rw-r--r--src/libutil/ssl_util.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libutil/ssl_util.c b/src/libutil/ssl_util.c
index d145e4f5b..f2898d592 100644
--- a/src/libutil/ssl_util.c
+++ b/src/libutil/ssl_util.c
@@ -47,13 +47,13 @@ struct rspamd_ssl_connection {
gboolean verify_peer;
SSL *ssl;
gchar *hostname;
- const gchar *log_tag;
struct rspamd_io_ev *ev;
struct rspamd_io_ev *shut_ev;
struct ev_loop *event_loop;
rspamd_ssl_handler_t handler;
rspamd_ssl_error_handler_t err_handler;
gpointer handler_data;
+ gchar log_tag[8];
};
#define msg_debug_ssl(...) rspamd_conditional_debug_fast (NULL, NULL, \
@@ -621,7 +621,14 @@ rspamd_ssl_connection_new (gpointer ssl_ctx, struct ev_loop *ev_base,
c->ssl = SSL_new (ssl_ctx);
c->event_loop = ev_base;
c->verify_peer = verify_peer;
- c->log_tag = log_tag;
+
+ if (log_tag) {
+ rspamd_strlcpy (c->log_tag, log_tag, sizeof (log_tag));
+ }
+ else {
+ rspamd_random_hex (c->log_tag, sizeof (log_tag) - 1);
+ c->log_tag[sizeof (log_tag) - 1] = '\0';
+ }
return c;
}