Allow reading http2 bodies
This allows http2 connections to now host authenticated endpoints.
Note, this work exposed that the http2 path was not calling
preparePayload() and responses were therefore missing the
Content-Length header. preparePayload is now called, and Content-Length
is added to the unit tests.
This commit also allows a full Redfish Service Validator test to pass
entirely using HTTP2.
Tested: Unit tests pass.
Curl /redfish/v1/Managers/bmc/LogServices/Journal/Entries
(which returns a payload larger than 16kB) succeeds and returns the
data.
Manually logging in with both basic and session authentication succeeds
over http2.
A modified Redfish-Service-Validator, changed to use httpx as its
backend, (thus using http2) succeeds.
Change-Id: I956f3ff8f442e9826312c6147d7599ab136a8e7c
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/http/nghttp2_adapters.hpp b/http/nghttp2_adapters.hpp
index aeb18d6..3235372 100644
--- a/http/nghttp2_adapters.hpp
+++ b/http/nghttp2_adapters.hpp
@@ -84,6 +84,13 @@
ptr, afterSendFrame);
}
+ void setOnDataChunkRecvCallback(
+ nghttp2_on_data_chunk_recv_callback afterDataChunkRecv)
+ {
+ nghttp2_session_callbacks_set_on_data_chunk_recv_callback(
+ ptr, afterDataChunkRecv);
+ }
+
private:
nghttp2_session_callbacks* get()
{