]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Deal with EOF properly
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 17 Feb 2017 16:47:58 +0000 (16:47 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 17 Feb 2017 16:47:58 +0000 (16:47 +0000)
src/libutil/http.c

index df710ac42f2907a5634b2fc49695803922efe22a..b46009794cf43c8616b2854a25b198d631fe671c 100644 (file)
@@ -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) {