aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamd_proxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rspamd_proxy.c')
-rw-r--r--src/rspamd_proxy.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index a7944eecf..13393660e 100644
--- a/src/rspamd_proxy.c
+++ b/src/rspamd_proxy.c
@@ -1544,11 +1544,21 @@ proxy_backend_master_error_handler (struct rspamd_http_connection *conn, GError
msg_err_session ("cannot connect to upstream, maximum retries "
"has been reached: %d", session->retries);
/* Terminate session immediately */
- proxy_client_write_error (session, err->code, err->message);
+ if (err) {
+ proxy_client_write_error(session, err->code, err->message);
+ }
+ else {
+ proxy_client_write_error(session, 503, "Unknown error after no retries left");
+ }
}
else {
if (!proxy_send_master_message (session)) {
- proxy_client_write_error (session, err->code, err->message);
+ if (err) {
+ proxy_client_write_error(session, err->code, err->message);
+ }
+ else {
+ proxy_client_write_error(session, 503, "Unknown error on write");
+ }
}
else {
msg_info_session ("retry connection to: %s"