HttpClient: Increase httpReadBodyLimit
Testing of https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53310 revealed
that recvMessage() was failing because the body limit was being
exceeded. httpReadBodyLimit was being used to set both the body limit
as well as the buffer size. Add a different variable to set the buffer
size so that the body limit can be doubled to 16K while the fixed
buffer can be set as a smaller size of 4K.
Tested:
Queries using the mentioned patch stopped failing after applying this
change.
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: I33b62dfc12ff078fba9fb92b2f95a05f41acce3d
diff --git a/http/http_client.hpp b/http/http_client.hpp
index a28c1c4..571b5a9 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -37,7 +37,8 @@
// It is assumed that the BMC should be able to handle 4 parallel connections
constexpr uint8_t maxPoolSize = 4;
constexpr uint8_t maxRequestQueueSize = 50;
-constexpr unsigned int httpReadBodyLimit = 8192;
+constexpr unsigned int httpReadBodyLimit = 16384;
+constexpr unsigned int httpReadBufferSize = 4096;
enum class ConnState
{
@@ -120,7 +121,7 @@
std::optional<
boost::beast::http::response_parser<boost::beast::http::string_body>>
parser;
- boost::beast::flat_static_buffer<httpReadBodyLimit> buffer;
+ boost::beast::flat_static_buffer<httpReadBufferSize> buffer;
Response res;
// Ascync callables