Skip to content

Commit

Permalink
Update ListenHTTP.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdebreceni committed Nov 20, 2024
1 parent 309e52f commit 2667658
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/civetweb/processors/ListenHTTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ class MgConnectionInputStream : public io::InputStream {
const auto read_size_limit = netstream_size_limit_.value_or(std::numeric_limits<size_t>::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<size_t>(mg_read_return);
return gsl::narrow<size_t>(mg_read_return);
Expand Down

0 comments on commit 2667658

Please sign in to comment.