From: Vsevolod Stakhov Date: Thu, 30 Apr 2015 11:43:22 +0000 (+0100) Subject: Restore logic to deal with shutdown. X-Git-Tag: 0.9.0~121 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4f38c0991c8aab1b4b0f272d9c697a8753cb0ada;p=rspamd.git Restore logic to deal with shutdown. --- diff --git a/src/libutil/http.c b/src/libutil/http.c index d7181c674..4547aa5f8 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -656,6 +656,10 @@ rspamd_http_on_message_complete (http_parser * parser) } if (ret == 0) { + if (event_pending (&priv->ev, EV_READ, NULL)) { + event_del (&priv->ev); + } + rspamd_http_connection_ref (conn); ret = conn->finish_handler (conn, priv->msg); conn->finished = TRUE; @@ -794,15 +798,16 @@ rspamd_http_event_handler (int fd, short what, gpointer ud) return; } else if (r == 0) { - err = g_error_new (HTTP_ERROR, - errno, - "IO read error: unexpected EOF"); - conn->error_handler (conn, err); - g_error_free (err); - - REF_RELEASE (pbuf); - rspamd_http_connection_unref (conn); + if (!conn->finished) { + err = g_error_new (HTTP_ERROR, + errno, + "IO read error: unexpected EOF"); + conn->error_handler (conn, err); + g_error_free (err); + REF_RELEASE (pbuf); + rspamd_http_connection_unref (conn); + } return; } else {