diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-05-07 13:33:21 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-05-07 13:33:21 +0100 |
commit | fbcb96e5541229ba0bf4d0b0359c3200f0f452ab (patch) | |
tree | 29ae4e61930dfc1f1d11914aa549f1a767a4b43e /src/rspamd_proxy.c | |
parent | eb5d274ab5466012ec3cb019e08d3436c66211d5 (diff) | |
download | rspamd-fbcb96e5541229ba0bf4d0b0359c3200f0f452ab.tar.gz rspamd-fbcb96e5541229ba0bf4d0b0359c3200f0f452ab.zip |
[Feature] Propagate HTTP result string when using proxy
Diffstat (limited to 'src/rspamd_proxy.c')
-rw-r--r-- | src/rspamd_proxy.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c index 0ddcf1014..157fab4a6 100644 --- a/src/rspamd_proxy.c +++ b/src/rspamd_proxy.c @@ -926,12 +926,14 @@ proxy_open_mirror_connections (struct rspamd_proxy_session *session) } static void -proxy_client_write_error (struct rspamd_proxy_session *session, gint code) +proxy_client_write_error (struct rspamd_proxy_session *session, gint code, + const gchar *status) { struct rspamd_http_message *reply; reply = rspamd_http_new_message (HTTP_RESPONSE); reply->code = code; + reply->status = rspamd_fstring_new_init (status, strlen (status)); rspamd_http_connection_write_message (session->client_conn, reply, NULL, NULL, session, session->client_sock, &session->ctx->io_tv, session->ctx->ev_base); @@ -948,7 +950,8 @@ proxy_backend_master_error_handler (struct rspamd_http_connection *conn, GError rspamd_inet_address_to_string (rspamd_upstream_addr (session->master_conn->up)), err->message); /* Terminate session immediately */ - proxy_client_write_error (session, err->code); + proxy_client_write_error (session, err->code, err->message); + proxy_backend_close_connection (session->master_conn); } static gint |