quic: add Curl_quic_idle
Add Curl_quic_idle which is called when no HTTP level read or write is performed. It is a good place to handle timer expiry for QUIC transport (.e.g, retransmission). Closes #8698
This commit is contained in:
parent
53678992d5
commit
6fcd3e6f51
@ -54,6 +54,7 @@ void Curl_quic_done(struct Curl_easy *data, bool premature);
|
||||
bool Curl_quic_data_pending(const struct Curl_easy *data);
|
||||
void Curl_quic_disconnect(struct Curl_easy *data,
|
||||
struct connectdata *conn, int tempindex);
|
||||
CURLcode Curl_quic_idle(struct Curl_easy *data);
|
||||
|
||||
#else /* ENABLE_QUIC */
|
||||
#define Curl_quic_done_sending(x)
|
||||
|
||||
@ -1222,6 +1222,14 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
||||
infof(data, "Done waiting for 100-continue");
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_QUIC
|
||||
if(conn->transport == TRNSPRT_QUIC) {
|
||||
result = Curl_quic_idle(data);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if(Curl_pgrsUpdate(data))
|
||||
|
||||
@ -500,4 +500,16 @@ bool Curl_quic_data_pending(const struct Curl_easy *data)
|
||||
return stream->recv_header_len || stream->recv_data_len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Called from transfer.c:Curl_readwrite when neither HTTP level read
|
||||
* nor write is performed. It is a good place to handle timer expiry
|
||||
* for QUIC transport.
|
||||
*/
|
||||
CURLcode Curl_quic_idle(struct Curl_easy *data)
|
||||
{
|
||||
(void)data;
|
||||
H3BUGF(infof(data, "Curl_quic_idle"));
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#endif /* USE_MSH3 */
|
||||
|
||||
@ -1894,4 +1894,26 @@ bool Curl_quic_data_pending(const struct Curl_easy *data)
|
||||
return Curl_dyn_len(&stream->overflow) > 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Called from transfer.c:Curl_readwrite when neither HTTP level read
|
||||
* nor write is performed. It is a good place to handle timer expiry
|
||||
* for QUIC transport.
|
||||
*/
|
||||
CURLcode Curl_quic_idle(struct Curl_easy *data)
|
||||
{
|
||||
struct connectdata *conn = data->conn;
|
||||
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
|
||||
struct quicsocket *qs = conn->quic;
|
||||
|
||||
if(ngtcp2_conn_get_expiry(qs->qconn) > timestamp()) {
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
if(ng_flush_egress(data, sockfd, qs)) {
|
||||
return CURLE_SEND_ERROR;
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -864,4 +864,15 @@ bool Curl_quic_data_pending(const struct Curl_easy *data)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Called from transfer.c:Curl_readwrite when neither HTTP level read
|
||||
* nor write is performed. It is a good place to handle timer expiry
|
||||
* for QUIC transport.
|
||||
*/
|
||||
CURLcode Curl_quic_idle(struct Curl_easy *data)
|
||||
{
|
||||
(void)data;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user