aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/http-proxy/src/ATSConnector.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/http-proxy/src/ATSConnector.cc b/apps/http-proxy/src/ATSConnector.cc
index a1c8c9708..600f1060f 100644
--- a/apps/http-proxy/src/ATSConnector.cc
+++ b/apps/http-proxy/src/ATSConnector.cc
@@ -139,7 +139,8 @@ void ATSConnector::doReadHeader() {
std::size_t size = HTTPMessageFastParser::hasBody(buffer, length);
auto additional_bytes = input_buffer_.size() - length;
- auto bytes_to_read = size - additional_bytes;
+ auto bytes_to_read =
+ size >= additional_bytes ? (size - additional_bytes) : size;
receive_callback_(buffer, length, !size, true);
input_buffer_.consume(length);