From: Vsevolod Stakhov Date: Fri, 25 Nov 2016 14:49:19 +0000 (+0000) Subject: [Minor] Fix removing of HTTP event X-Git-Tag: 1.4.1~64 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5a2f44f27d4f9abe6d0abe79f2f7e6e6bc0e23b1;p=rspamd.git [Minor] Fix removing of HTTP event --- diff --git a/src/libutil/http.c b/src/libutil/http.c index 7f749b869..8796963f1 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -1355,7 +1355,11 @@ rspamd_http_connection_reset (struct rspamd_http_connection *conn) /* Clear priv */ if (!(priv->flags & RSPAMD_HTTP_CONN_FLAG_RESETED)) { - event_del (&priv->ev); + + if (event_get_base (&priv->ev)) { + event_del (&priv->ev); + } + rspamd_http_parser_reset (conn); } diff --git a/src/libutil/map.c b/src/libutil/map.c index 07ce616c2..0ea3ce067 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -118,9 +118,9 @@ write_http_request (struct http_callback_data *cbd) g_assert_not_reached (); } + MAP_RETAIN (cbd, "http_callback_data"); rspamd_http_connection_write_message (cbd->conn, msg, cbd->data->host, NULL, cbd, cbd->fd, &cbd->tv, cbd->ev_base); - MAP_RETAIN (cbd, "http_callback_data"); } else { msg_err_map ("cannot connect to %s: %s", cbd->data->host,