diff options
Diffstat (limited to 'zenhttp')
| -rw-r--r-- | zenhttp/httpasio.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/zenhttp/httpasio.cpp b/zenhttp/httpasio.cpp index 55ce867a4..318f47eff 100644 --- a/zenhttp/httpasio.cpp +++ b/zenhttp/httpasio.cpp @@ -634,12 +634,11 @@ HttpRequest::ConsumeData(const char* InputData, size_t DataSize) { const size_t ConsumedBytes = http_parser_execute(&m_Parser, &s_ParserSettings, InputData, DataSize); - if (m_Parser.http_errno) + if (m_Parser.http_errno && m_Parser.http_errno != HPE_INVALID_EOF_STATE) { - ZEN_WARN("HTTP parser error {}", (uint32_t)m_Parser.http_errno); - - // TODO: we need to kill the connection since we're most likely - // out of sync and can't make progress + ZEN_WARN("HTTP parser error {}. Closing connection", (uint32_t)m_Parser.http_errno); + TerminateConnection(); + return DataSize; } return ConsumedBytes; |