From 744dcf22fac6cf12a9112df106b61864982afef9 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 30 Mar 2023 12:13:49 +0200 Subject: http2: flow control and buffer improvements - use bufq for send/receive of network data - usd bufq for send/receive of stream data - use HTTP/2 flow control with no-auto updates to control the amount of data we are buffering for a stream HTTP/2 stream window set to 128K after local tests, defined code constant for now - elminiating PAUSEing nghttp2 processing when receiving data since a stream can now take in all DATA nghttp2 forwards Improved scorecard and adjuste http2 stream window sizes - scorecard improved output formatting and options default - scorecard now also benchmarks small requests / second Closes #10771 --- lib/http.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lib/http.h') diff --git a/lib/http.h b/lib/http.h index 5f4fcb904..b9a2e6149 100644 --- a/lib/http.h +++ b/lib/http.h @@ -29,6 +29,7 @@ #include #endif +#include "bufq.h" #include "dynhds.h" #include "ws.h" @@ -227,14 +228,12 @@ struct HTTP { #ifdef USE_NGHTTP2 /*********** for HTTP/2 we store stream-local data here *************/ int32_t stream_id; /* stream we are interested in */ - - /* We store non-final and final response headers here, per-stream */ - struct dynbuf header_recvbuf; - size_t nread_header_recvbuf; /* number of bytes in header_recvbuf fed into - upper layer */ - struct dynbuf trailer_recvbuf; - const uint8_t *pausedata; /* pointer to data received in on_data_chunk */ - size_t pauselen; /* the number of bytes left in data */ + struct bufq h2_sendbuf; /* request body data buffere for sending */ + size_t h2_send_hds_len; /* amount of bytes in first cf_send() that + are header bytes. Or 0 if not known. */ + struct bufq h2_recvbuf; + size_t h2_recv_hds_len; /* how many bytes in recvbuf are headers */ + struct dynhds resp_trailers; bool close_handled; /* TRUE if stream closure is handled by libcurl */ char **push_headers; /* allocated array */ @@ -346,6 +345,7 @@ struct http_req { char *authority; char *path; struct dynhds headers; + struct dynhds trailers; }; /** @@ -366,6 +366,7 @@ struct http_resp { int status; char *description; struct dynhds headers; + struct dynhds trailers; struct http_resp *prev; }; -- cgit v1.2.1