]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Ignore trailing garbage
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 9 Sep 2019 10:28:45 +0000 (11:28 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 9 Sep 2019 10:28:45 +0000 (11:28 +0100)
src/libutil/http_connection.c

index 31e8a3c1e29029f72aafa27114a285452b11f47f..475a09c41579c34f2ec44648e82f95d1b00cfc45 100644 (file)
@@ -954,6 +954,14 @@ rspamd_http_event_handler (int fd, short what, gpointer ud)
                                        err = g_error_new (HTTP_ERROR, 400,
                                                        "Encryption required");
                                }
+                               else if (priv->parser.http_errno == HPE_CLOSED_CONNECTION) {
+                                       msg_err ("got garbage after end of the message, ignore it");
+
+                                       REF_RELEASE (pbuf);
+                                       rspamd_http_connection_unref (conn);
+
+                                       return;
+                               }
                                else {
                                        err = g_error_new (HTTP_ERROR, 500 + priv->parser.http_errno,
                                                        "HTTP parser error: %s",