diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-02-26 12:14:09 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-02-26 13:32:26 +0000 |
commit | e932a896eb4a9e81103ab5632910d83b6286b343 (patch) | |
tree | 025f0bd35879285d73ab61c5b1adc660d658788e /src/controller.c | |
parent | ba7f6982b0b582b56e48da778784315b5d63d2be (diff) | |
download | rspamd-e932a896eb4a9e81103ab5632910d83b6286b343.tar.gz rspamd-e932a896eb4a9e81103ab5632910d83b6286b343.zip |
[Minor] Align rspamd_stat structure
Diffstat (limited to 'src/controller.c')
-rw-r--r-- | src/controller.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/controller.c b/src/controller.c index 3b524c590..ca9558046 100644 --- a/src/controller.c +++ b/src/controller.c @@ -720,7 +720,7 @@ rspamd_controller_handle_auth (struct rspamd_http_connection_entry *conn_ent, struct rspamd_http_message *msg) { struct rspamd_controller_session *session = conn_ent->ud; - struct rspamd_stat *st; + struct rspamd_stat st; int64_t uptime; gulong data[5]; ucl_object_t *obj; @@ -730,13 +730,13 @@ rspamd_controller_handle_auth (struct rspamd_http_connection_entry *conn_ent, } obj = ucl_object_typed_new (UCL_OBJECT); - st = session->ctx->srv->stat; - data[0] = st->actions_stat[METRIC_ACTION_NOACTION]; - data[1] = st->actions_stat[METRIC_ACTION_ADD_HEADER] + - st->actions_stat[METRIC_ACTION_REWRITE_SUBJECT]; - data[2] = st->actions_stat[METRIC_ACTION_GREYLIST]; - data[3] = st->actions_stat[METRIC_ACTION_REJECT]; - data[4] = st->actions_stat[METRIC_ACTION_SOFT_REJECT]; + memcpy (&st, session->ctx->srv->stat, sizeof (st)); + data[0] = st.actions_stat[METRIC_ACTION_NOACTION]; + data[1] = st.actions_stat[METRIC_ACTION_ADD_HEADER] + + st.actions_stat[METRIC_ACTION_REWRITE_SUBJECT]; + data[2] = st.actions_stat[METRIC_ACTION_GREYLIST]; + data[3] = st.actions_stat[METRIC_ACTION_REJECT]; + data[4] = st.actions_stat[METRIC_ACTION_SOFT_REJECT]; /* Get uptime */ uptime = ev_time () - session->ctx->start_time; @@ -758,9 +758,9 @@ rspamd_controller_handle_auth (struct rspamd_http_connection_entry *conn_ent, ucl_object_insert_key (obj, ucl_object_fromint ( data[4]), "soft_reject", 0, false); ucl_object_insert_key (obj, ucl_object_fromint ( - st->messages_scanned), "scanned", 0, false); + st.messages_scanned), "scanned", 0, false); ucl_object_insert_key (obj, ucl_object_fromint ( - st->messages_learned), "learned", 0, false); + st.messages_learned), "learned", 0, false); ucl_object_insert_key (obj, ucl_object_frombool (!session->is_enable), "read_only", 0, false); ucl_object_insert_key (obj, ucl_object_fromstring (session->ctx->cfg->checksum), |