aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-30 12:43:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-30 12:43:22 +0100
commit4f38c0991c8aab1b4b0f272d9c697a8753cb0ada (patch)
treee13e3c2559784a3bdacdc2348e90f4b3f98274be
parent107f230637fbfe74fabc68a874b216944599de6c (diff)
downloadrspamd-4f38c0991c8aab1b4b0f272d9c697a8753cb0ada.tar.gz
rspamd-4f38c0991c8aab1b4b0f272d9c697a8753cb0ada.zip
Restore logic to deal with shutdown.
-rw-r--r--src/libutil/http.c21
1 files changed, 13 insertions, 8 deletions
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 {