diff options
author | Michele Papalini <micpapal@cisco.com> | 2020-02-14 08:20:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2020-02-14 08:20:42 +0000 |
commit | 591ad7f2ebcee826b7146a17cb319f4441445e5c (patch) | |
tree | 6c9098079885e92ed5bb89324e365f2a0ce74ae2 /apps/http-proxy | |
parent | 2835305d247f23695bddf1a9068ee6f2f33bed70 (diff) | |
parent | df6894e4bed12525bd555d7e540bcfcf7e311b5e (diff) |
Merge "[HICN-520] Read correct number of bytes during HTTP response reception performed by the http-proxy."
Diffstat (limited to 'apps/http-proxy')
-rw-r--r-- | apps/http-proxy/src/ATSConnector.cc | 3 |
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); |