diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-10-15 14:35:20 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-10-15 14:35:20 +0100 |
commit | 9959f9031e305e117c6b89671ac86c4e84135340 (patch) | |
tree | 3336deb7751c7c134703552e1e61e40b87e81b91 /src | |
parent | 405109fafa0624c6f34b4faffa4c0d4d116dfded (diff) | |
download | rspamd-9959f9031e305e117c6b89671ac86c4e84135340.tar.gz rspamd-9959f9031e305e117c6b89671ac86c4e84135340.zip |
Fix HTTP connection termination.
If a remote side terminates a connection, then notify and destroy
client as well.
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/http.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c index e78a79890..db48bd6de 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -650,8 +650,8 @@ rspamd_http_write_helper (struct rspamd_http_connection *conn) call_finish_handler: if ((conn->opts & RSPAMD_HTTP_CLIENT_SIMPLE) == 0) { rspamd_http_connection_ref (conn); - conn->finish_handler (conn, priv->msg); conn->finished = TRUE; + conn->finish_handler (conn, priv->msg); rspamd_http_connection_unref (conn); } else { @@ -695,6 +695,8 @@ rspamd_http_event_handler (int fd, short what, gpointer ud) if (conn->finished) { REF_RELEASE (pbuf); rspamd_http_connection_unref (conn); + /* Double unref to avoid dangling connections */ + rspamd_http_connection_unref (conn); return; } else { |