summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichele Papalini <micpapal@cisco.com>2020-02-14 08:20:42 +0000
committerGerrit Code Review <gerrit@fd.io>2020-02-14 08:20:42 +0000
commit591ad7f2ebcee826b7146a17cb319f4441445e5c (patch)
tree6c9098079885e92ed5bb89324e365f2a0ce74ae2 /apps
parent2835305d247f23695bddf1a9068ee6f2f33bed70 (diff)
parentdf6894e4bed12525bd555d7e540bcfcf7e311b5e (diff)
Merge "[HICN-520] Read correct number of bytes during HTTP response reception performed by the http-proxy."
Diffstat (limited to 'apps')
-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);