From df6894e4bed12525bd555d7e540bcfcf7e311b5e Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 13 Feb 2020 21:34:20 +0100 Subject: [HICN-520] Read correct number of bytes during HTTP response reception performed by the http-proxy. Change-Id: I06879276c76aacf55715e34590afe0babc89a132 Signed-off-by: Mauro Sardara --- apps/http-proxy/src/ATSConnector.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps') 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); -- cgit 1.2.3-korg