From 4b92cb19c48639d65f68f0292dd342bb1a38e62d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 9 Sep 2019 11:28:45 +0100 Subject: [PATCH] [Minor] Ignore trailing garbage --- src/libutil/http_connection.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libutil/http_connection.c b/src/libutil/http_connection.c index 31e8a3c1e..475a09c41 100644 --- a/src/libutil/http_connection.c +++ b/src/libutil/http_connection.c @@ -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", -- 2.39.5