From: Vsevolod Stakhov Date: Thu, 26 May 2016 18:30:30 +0000 (+0100) Subject: [Fix] Try to fix proxying of stupid spamc protocol to HTTP mirrors X-Git-Tag: 1.3.0~430 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7b250d705b4c39294f46a1ca96afc997a901ce57;p=rspamd.git [Fix] Try to fix proxying of stupid spamc protocol to HTTP mirrors --- diff --git a/src/libutil/http.c b/src/libutil/http.c index 0e0f30eaf..fc8263ddd 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -1204,8 +1204,14 @@ rspamd_http_connection_copy_msg (struct rspamd_http_connection *conn) } if (msg->url) { - new_msg->url = rspamd_fstring_new_init (msg->url->str, - msg->url->len); + if (new_msg->url) { + new_msg->url = rspamd_fstring_append (new_msg->url, msg->url->str, + msg->url->len); + } + else { + new_msg->url = rspamd_fstring_new_init (msg->url->str, + msg->url->len); + } } if (msg->host) { diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c index 4d6ae4b6d..2fb8d0b50 100644 --- a/src/rspamd_proxy.c +++ b/src/rspamd_proxy.c @@ -907,6 +907,11 @@ proxy_open_mirror_connections (struct rspamd_proxy_session *session) msg = rspamd_http_connection_copy_msg (session->client_conn); rspamd_http_message_remove_header (msg, "Content-Length"); rspamd_http_message_remove_header (msg, "Key"); + msg->method = HTTP_GET; + + if (msg->url->len == 0) { + msg->url = rspamd_fstring_append (msg->url, "/check", strlen ("/check")); + } if (m->settings_id != NULL) { rspamd_http_message_remove_header (msg, "Settings-ID");