cfilters: send flush

Since data can be held in connection filter buffers when sending gives
EAGAIN, add methods to query this and perform flushing of those buffers.

The transfer loop will continue sending until all upload data is
processed and the connection is flushed.

- add `CF_QUERY_SEND_PENDING` to query filters
- add `CF_CTRL_DATA_SEND_FLUSH` to flush filters
- change `Curl_req_want_send()` to query the connection
  if it needs flushing
- use `Curl_req_want_send()` to determine the POLLOUT
  in the PERFORMING multi state
- implement flush handling in the HTTP/2 connection filter

Closes #14271
This commit is contained in:
Stefan Eissing 2024-07-25 13:10:01 +02:00 committed by Daniel Stenberg
parent 911c3166b6
commit 709a6a3965
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
10 changed files with 278 additions and 100 deletions

View file

@ -4431,8 +4431,16 @@ static CURLcode cr_exp100_read(struct Curl_easy *data,
switch(ctx->state) {
case EXP100_SENDING_REQUEST:
if(!Curl_req_sendbuf_empty(data)) {
/* The initial request data has not been fully sent yet. Do
* not start the timer yet. */
DEBUGF(infof(data, "cr_exp100_read, request not full sent yet"));
*nread = 0;
*eos = FALSE;
return CURLE_OK;
}
/* We are now waiting for a reply from the server or
* a timeout on our side */
* a timeout on our side IFF the request has been fully sent. */
DEBUGF(infof(data, "cr_exp100_read, start AWAITING_CONTINUE"));
ctx->state = EXP100_AWAITING_CONTINUE;
ctx->start = Curl_now();