diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-25 14:49:19 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-25 14:49:19 +0000 |
commit | 5a2f44f27d4f9abe6d0abe79f2f7e6e6bc0e23b1 (patch) | |
tree | 51d35b7620cd4ad76e5d52a849730c951eaf9412 /src | |
parent | f7466e9e3871de4a71c217a38b208ff364349045 (diff) | |
download | rspamd-5a2f44f27d4f9abe6d0abe79f2f7e6e6bc0e23b1.tar.gz rspamd-5a2f44f27d4f9abe6d0abe79f2f7e6e6bc0e23b1.zip |
[Minor] Fix removing of HTTP event
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/http.c | 6 | ||||
-rw-r--r-- | src/libutil/map.c | 2 |
2 files changed, 6 insertions, 2 deletions
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, |