diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-04 18:21:33 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-04 18:21:33 +0100 |
commit | dea4e8ebc80fac3ea5b546387adae2fa7a5af6c4 (patch) | |
tree | cf0607e349355df65bfaed1ce3c96c9024ac4236 | |
parent | 369a6c48b62ecfbfcd670498e23ec2500cba3bbb (diff) | |
download | rspamd-dea4e8ebc80fac3ea5b546387adae2fa7a5af6c4.tar.gz rspamd-dea4e8ebc80fac3ea5b546387adae2fa7a5af6c4.zip |
[Fix] Some fixes for log pipe handling
-rw-r--r-- | src/libserver/rspamd_control.c | 2 | ||||
-rw-r--r-- | src/log_helper.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/libserver/rspamd_control.c b/src/libserver/rspamd_control.c index 7c5f365dd..8c0a150e2 100644 --- a/src/libserver/rspamd_control.c +++ b/src/libserver/rspamd_control.c @@ -549,6 +549,7 @@ rspamd_control_default_cmd_handler (gint fd, case RSPAMD_CONTROL_HYPERSCAN_LOADED: case RSPAMD_CONTROL_FUZZY_STAT: case RSPAMD_CONTROL_FUZZY_SYNC: + case RSPAMD_CONTROL_LOG_PIPE: break; case RSPAMD_CONTROL_RERESOLVE: if (cd->worker->srv->cfg) { @@ -806,6 +807,7 @@ rspamd_srv_handler (gint fd, short what, gpointer ud) break; case RSPAMD_SRV_LOG_PIPE: memset (&wcmd, 0, sizeof (wcmd)); + wcmd.type = RSPAMD_CONTROL_LOG_PIPE; wcmd.cmd.log_pipe.type = cmd.cmd.log_pipe.type; rspamd_control_broadcast_cmd (srv, &wcmd, rfd, rspamd_control_log_pipe_io_handler, NULL); diff --git a/src/log_helper.c b/src/log_helper.c index b1a241288..7283c5d14 100644 --- a/src/log_helper.c +++ b/src/log_helper.c @@ -93,11 +93,13 @@ rspamd_log_helper_read (gint fd, short what, gpointer ud) out = g_string_sized_new (31); for (i = 0; i < n; i ++) { - rspamd_printf_gstring (out, "%s%d", i == 0 ? "" : ", ", - sm->results[i]); + + rspamd_printf_gstring (out, "%s%s", i == 0 ? "" : ", ", + rspamd_symbols_cache_symbol_by_id (ctx->cfg->cache, + sm->results[i])); } - msg_info ("got log line: %V", out); + msg_info ("got log line: %v", out); g_string_free (out, TRUE); g_free (sm); } @@ -115,6 +117,7 @@ rspamd_log_helper_reply_handler (struct rspamd_worker *worker, struct log_helper_ctx *ctx = ud; close (ctx->pair[1]); + msg_info ("start waiting for log events"); event_set (&ctx->log_ev, ctx->pair[0], EV_READ | EV_PERSIST, rspamd_log_helper_read, ctx); event_base_set (ctx->ev_base, &ctx->log_ev); |