summaryrefslogtreecommitdiffstats
path: root/src/libserver/http/http_context.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-30 12:18:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-30 12:18:58 +0100
commitbae50b5b9c55336f4ca8620d5ef72745ec0d593f (patch)
tree0298f46e22343ec108eaf9212ae287a373e54e15 /src/libserver/http/http_context.c
parent4aad801ba8793825330b2112ec87a56f7675ef6e (diff)
downloadrspamd-bae50b5b9c55336f4ca8620d5ef72745ec0d593f.tar.gz
rspamd-bae50b5b9c55336f4ca8620d5ef72745ec0d593f.zip
[Minor] Fix another close/ev_modify race
Diffstat (limited to 'src/libserver/http/http_context.c')
-rw-r--r--src/libserver/http/http_context.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libserver/http/http_context.c b/src/libserver/http/http_context.c
index 519e4fb04..2863c0fbc 100644
--- a/src/libserver/http/http_context.c
+++ b/src/libserver/http/http_context.c
@@ -492,8 +492,9 @@ rspamd_http_keepalive_handler (gint fd, short what, gpointer ud)
rspamd_inet_address_to_string_pretty (cbdata->conn->keepalive_hash_key->addr),
cbdata->conn->keepalive_hash_key->host,
cbdata->queue->length);
- rspamd_http_connection_unref (cbdata->conn);
+ /* unref call closes fd, so we need to remove ev watcher first! */
rspamd_ev_watcher_stop (cbdata->ctx->event_loop, &cbdata->ev);
+ rspamd_http_connection_unref (cbdata->conn);
g_free (cbdata);
}