aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-17 16:47:58 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-17 16:47:58 +0000
commitaaf5dfba5517cdae8d86b1f8b42b2c10bcab21d3 (patch)
tree8c11f770ee9be945214e3079257d6b897db6897c /src/libutil
parentd3d4bc54c72827bd26b76738b3bfd6d5398d6286 (diff)
downloadrspamd-aaf5dfba5517cdae8d86b1f8b42b2c10bcab21d3.tar.gz
rspamd-aaf5dfba5517cdae8d86b1f8b42b2c10bcab21d3.zip
[Fix] Deal with EOF properly
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/http.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c
index df710ac42..b46009794 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -1198,20 +1198,19 @@ rspamd_http_event_handler (int fd, short what, gpointer ud)
}
else if (r == 0) {
/* We can still call http parser */
- if (http_parser_execute (&priv->parser, &priv->parser_cb, d, r)
- != (size_t)r) {
- 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);
+ http_parser_execute (&priv->parser, &priv->parser_cb, d, r);
- return;
+ 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 {
if (!priv->ssl) {