diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-07 14:45:15 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-07 14:45:15 +0000 |
commit | b802ca308b5f87cd3aa5a4bb3bde7b46e2d162d0 (patch) | |
tree | f23de8c881bc58f7ef919de9ad5fc85bfdda37e0 /src/libutil/upstream.c | |
parent | eba3948ce08b642945ca02942d9c391a5a13d8f4 (diff) | |
download | rspamd-b802ca308b5f87cd3aa5a4bb3bde7b46e2d162d0.tar.gz rspamd-b802ca308b5f87cd3aa5a4bb3bde7b46e2d162d0.zip |
[Minor] Improve logging
Submitted by: @citrin
Diffstat (limited to 'src/libutil/upstream.c')
-rw-r--r-- | src/libutil/upstream.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index 227ea4442..3589c4baf 100644 --- a/src/libutil/upstream.c +++ b/src/libutil/upstream.c @@ -829,29 +829,30 @@ rspamd_upstream_fail (struct upstream *upstream, gboolean addr_failure) } void -rspamd_upstream_ok (struct upstream *up) +rspamd_upstream_ok (struct upstream *upstream) { struct upstream_addr_elt *addr_elt; struct upstream_list_watcher *w; - RSPAMD_UPSTREAM_LOCK (up); - if (up->errors > 0 && up->active_idx != -1) { + RSPAMD_UPSTREAM_LOCK (upstream); + if (upstream->errors > 0 && upstream->active_idx != -1) { /* We touch upstream if and only if it is active */ - up->errors = 0; + msg_debug_upstream ("reset errors on upstream %s (was %ud)", upstream->name, upstream->errors); + upstream->errors = 0; - if (up->addrs.addr) { - addr_elt = g_ptr_array_index (up->addrs.addr, up->addrs.cur); + if (upstream->addrs.addr) { + addr_elt = g_ptr_array_index (upstream->addrs.addr, upstream->addrs.cur); addr_elt->errors = 0; } - DL_FOREACH (up->ls->watchers, w) { + DL_FOREACH (upstream->ls->watchers, w) { if (w->events_mask & RSPAMD_UPSTREAM_WATCH_SUCCESS) { - w->func (up, RSPAMD_UPSTREAM_WATCH_SUCCESS, 0, w->ud); + w->func (upstream, RSPAMD_UPSTREAM_WATCH_SUCCESS, 0, w->ud); } } } - RSPAMD_UPSTREAM_UNLOCK (up); + RSPAMD_UPSTREAM_UNLOCK (upstream); } void |