diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-09-18 15:53:20 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-09-18 15:53:20 +0100 |
commit | cd50e7bd57981b7b7a01eec88ae06968c625b2a7 (patch) | |
tree | 9e4a01bea6d6223f58a4980940403dd2fbcb8b9c /src/rspamd_proxy.c | |
parent | 907cc2eb616124abe41e7c1b525139a54f3cea8f (diff) | |
download | rspamd-cd50e7bd57981b7b7a01eec88ae06968c625b2a7.tar.gz rspamd-cd50e7bd57981b7b7a01eec88ae06968c625b2a7.zip |
[Minor] Fix some more issues
Found by: coverity scan
Diffstat (limited to 'src/rspamd_proxy.c')
-rw-r--r-- | src/rspamd_proxy.c | 14 |
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" |