summaryrefslogtreecommitdiffstats
path: root/apps/http-proxy
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-02-13 21:34:20 +0100
committerMauro Sardara <msardara@cisco.com>2020-02-13 21:34:20 +0100
commitdf6894e4bed12525bd555d7e540bcfcf7e311b5e (patch)
treecc3a5b258319d15cd96228d6c86ce3f83ccb1b92 /apps/http-proxy
parentf9243a2bf823086404be1c41c7bcc1b27cfab7de (diff)
[HICN-520] Read correct number of bytes during HTTP response reception performed by the http-proxy.
Change-Id: I06879276c76aacf55715e34590afe0babc89a132 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'apps/http-proxy')
-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);