From 85adf355aeb69e456d976afccf2321987fbd8d37 Mon Sep 17 00:00:00 2001 From: Adam Debreceni <64783590+adamdebreceni@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:27:31 +0100 Subject: [PATCH] Update ListenHTTP.cpp --- extensions/civetweb/processors/ListenHTTP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/civetweb/processors/ListenHTTP.cpp b/extensions/civetweb/processors/ListenHTTP.cpp index 6bcf0a4395..53785ddba3 100644 --- a/extensions/civetweb/processors/ListenHTTP.cpp +++ b/extensions/civetweb/processors/ListenHTTP.cpp @@ -262,8 +262,8 @@ class MgConnectionInputStream : public io::InputStream { const auto read_size_limit = netstream_size_limit_.value_or(std::numeric_limits::max()) - netstream_offset_; const auto limited_out_buf = out_buffer.subspan(0, std::min(out_buffer.size(), read_size_limit)); const auto mg_read_return = mg_read(conn_, limited_out_buf.data(), limited_out_buf.size()); - if (mg_read_return < 0) { - return io::STREAM_ERROR; + if (mg_read_return <= 0) { + return 0; } netstream_offset_ += gsl::narrow(mg_read_return); return gsl::narrow(mg_read_return);