diff options
-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, |