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
This commit is contained in:
Stefan Eissing 2023-03-30 12:13:49 +02:00 committed by Daniel Stenberg
parent 4ced75b7ce
commit 744dcf22fa
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
10 changed files with 716 additions and 746 deletions

View file

@ -29,6 +29,7 @@
#include <pthread.h>
#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;
};