quic: remove data_idle handling

The transfer loop used to check the socket and if no poll events
were seen, triggered a "DATA_IDLE" event into the filters to let
them schedule times/do things anyway.

Since we no longer check the socket, the filters have been called
already and the DATA_IDLE event is unnecessary work. Remove it.

Closes #19060
This commit is contained in:
Stefan Eissing 2025-10-14 15:53:37 +02:00 committed by Daniel Stenberg
parent be852e39b2
commit 182a5a9aae
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 6 additions and 58 deletions

View file

@ -966,13 +966,6 @@ CURLcode Curl_conn_ev_data_setup(struct Curl_easy *data)
CF_CTRL_DATA_SETUP, 0, NULL);
}
CURLcode Curl_conn_ev_data_idle(struct Curl_easy *data)
{
return cf_cntrl_all(data->conn, data, FALSE,
CF_CTRL_DATA_IDLE, 0, NULL);
}
CURLcode Curl_conn_flush(struct Curl_easy *data, int sockindex)
{
if(!CONN_SOCK_IDX_VALID(sockindex))

View file

@ -118,7 +118,7 @@ typedef CURLcode Curl_cft_conn_keep_alive(struct Curl_cfilter *cf,
*/
/* data event arg1 arg2 return */
#define CF_CTRL_DATA_SETUP 4 /* 0 NULL first fail */
#define CF_CTRL_DATA_IDLE 5 /* 0 NULL first fail */
/* unused now 5 */
#define CF_CTRL_DATA_PAUSE 6 /* on/off NULL first fail */
#define CF_CTRL_DATA_DONE 7 /* premature NULL ignored */
#define CF_CTRL_DATA_DONE_SEND 8 /* 0 NULL ignored */
@ -539,12 +539,6 @@ CURLcode Curl_cf_send_bufq(struct Curl_cfilter *cf,
*/
CURLcode Curl_conn_ev_data_setup(struct Curl_easy *data);
/**
* Notify connection filters that now would be a good time to
* perform any idle, e.g. time related, actions.
*/
CURLcode Curl_conn_ev_data_idle(struct Curl_easy *data);
/**
* Notify connection filters that the transfer represented by `data`
* is done with sending data (e.g. has uploaded everything).

View file

@ -244,8 +244,7 @@ static ssize_t xfer_recv_resp(struct Curl_easy *data,
* buffer)
*/
static CURLcode sendrecv_dl(struct Curl_easy *data,
struct SingleRequest *k,
int *didwhat)
struct SingleRequest *k)
{
struct connectdata *conn = data->conn;
CURLcode result = CURLE_OK;
@ -309,7 +308,6 @@ static CURLcode sendrecv_dl(struct Curl_easy *data,
/* We only get a 0-length receive at the end of the response */
blen = (size_t)nread;
is_eos = (blen == 0);
*didwhat |= KEEP_RECV;
if(!blen) {
/* if we receive 0 or less here, either the data transfer is done or the
@ -369,17 +367,15 @@ out:
/*
* Send data to upload to the server, when the socket is writable.
*/
static CURLcode sendrecv_ul(struct Curl_easy *data, int *didwhat)
static CURLcode sendrecv_ul(struct Curl_easy *data)
{
/* We should not get here when the sending is already done. It
* probably means that someone set `data-req.keepon |= KEEP_SEND`
* when it should not. */
DEBUGASSERT(!Curl_req_done_sending(data));
if(!Curl_req_done_sending(data)) {
*didwhat |= KEEP_SEND;
if(!Curl_req_done_sending(data))
return Curl_req_send_more(data);
}
return CURLE_OK;
}
@ -391,7 +387,6 @@ CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp)
{
struct SingleRequest *k = &data->req;
CURLcode result = CURLE_OK;
int didwhat = 0;
DEBUGASSERT(nowp);
if(Curl_xfer_is_blocked(data)) {
@ -402,21 +397,14 @@ CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp)
/* We go ahead and do a read if we have a readable socket or if the stream
was rewound (in which case we have data in a buffer) */
if(k->keepon & KEEP_RECV) {
result = sendrecv_dl(data, k, &didwhat);
result = sendrecv_dl(data, k);
if(result || data->req.done)
goto out;
}
/* If we still have writing to do, we check if we have a writable socket. */
if(Curl_req_want_send(data) || (data->req.keepon & KEEP_SEND_TIMED)) {
result = sendrecv_ul(data, &didwhat);
if(result)
goto out;
}
if(!didwhat) {
/* Transfer wanted to send/recv, but nothing was possible. */
result = Curl_conn_ev_data_idle(data);
result = sendrecv_ul(data);
if(result)
goto out;
}

View file

@ -2040,16 +2040,6 @@ static CURLcode cf_ngtcp2_cntrl(struct Curl_cfilter *cf,
}
break;
}
case CF_CTRL_DATA_IDLE: {
struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
CURL_TRC_CF(data, cf, "data idle");
if(stream && !stream->closed) {
result = check_and_set_expiry(cf, data, NULL);
if(result)
CURL_TRC_CF(data, cf, "data idle, check_and_set_expiry -> %d", result);
}
break;
}
case CF_CTRL_CONN_INFO_UPDATE:
if(!cf->sockindex && cf->connected) {
cf->conn->httpversion_seen = 30;

View file

@ -2207,14 +2207,6 @@ static CURLcode cf_osslq_cntrl(struct Curl_cfilter *cf,
}
break;
}
case CF_CTRL_DATA_IDLE: {
struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
CURL_TRC_CF(data, cf, "data idle");
if(stream && !stream->closed) {
result = check_and_set_expiry(cf, data);
}
break;
}
case CF_CTRL_CONN_INFO_UPDATE:
if(!cf->sockindex && cf->connected) {
cf->conn->httpversion_seen = 30;

View file

@ -1232,15 +1232,6 @@ static CURLcode cf_quiche_cntrl(struct Curl_cfilter *cf,
}
break;
}
case CF_CTRL_DATA_IDLE: {
struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
if(stream && !stream->closed) {
result = cf_flush_egress(cf, data);
if(result)
CURL_TRC_CF(data, cf, "data idle, flush egress -> %d", result);
}
break;
}
case CF_CTRL_CONN_INFO_UPDATE:
if(!cf->sockindex && cf->connected) {
cf->conn->httpversion_seen = 30;