summaryrefslogtreecommitdiffstats
path: root/src/rspamd_proxy.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-19 12:31:19 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-19 12:31:19 +0100
commit412a5e6969f9d059c26d65bf85b6b08dbce0b482 (patch)
tree6a5e88c5ae032311fcddda9bc11361bf94cb5d6a /src/rspamd_proxy.c
parentf4ae060036e4fab0ff58daba588d76800ccb4435 (diff)
downloadrspamd-412a5e6969f9d059c26d65bf85b6b08dbce0b482.tar.gz
rspamd-412a5e6969f9d059c26d65bf85b6b08dbce0b482.zip
[Fix] Fix upstreams interaction for rspamd proxy
Diffstat (limited to 'src/rspamd_proxy.c')
-rw-r--r--src/rspamd_proxy.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index 6ee34c918..4e28e2076 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -973,6 +973,8 @@ proxy_backend_mirror_error_handler (struct rspamd_http_connection *conn, GError
bk_conn->err = rspamd_mempool_strdup (session->pool, err->message);
}
+ rspamd_upstream_fail (bk_conn->up);
+
proxy_backend_close_connection (bk_conn);
REF_RELEASE (bk_conn->s);
}
@@ -995,6 +997,7 @@ proxy_backend_mirror_finish_handler (struct rspamd_http_connection *conn,
}
msg_info_session ("finished mirror connection to %s", bk_conn->name);
+ rspamd_upstream_ok (bk_conn->up);
proxy_backend_close_connection (bk_conn);
REF_RELEASE (bk_conn->s);
@@ -1125,6 +1128,7 @@ proxy_backend_master_error_handler (struct rspamd_http_connection *conn, GError
err->message,
session->ctx->max_retries - session->retries);
session->retries ++;
+ rspamd_upstream_fail (bk_conn->up);
proxy_backend_close_connection (session->master_conn);
if (session->ctx->max_retries &&
@@ -1182,6 +1186,8 @@ proxy_backend_master_finish_handler (struct rspamd_http_connection *conn,
}
}
+ rspamd_upstream_ok (bk_conn->up);
+
rspamd_http_connection_write_message (session->client_conn,
msg, NULL, NULL, session, session->client_sock,
bk_conn->io_tv, session->ctx->ev_base);