diff options
Diffstat (limited to 'libs/libcurl/src/vquic/vquic.c')
-rw-r--r-- | libs/libcurl/src/vquic/vquic.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/libs/libcurl/src/vquic/vquic.c b/libs/libcurl/src/vquic/vquic.c index e49b6567ad..8b9c1ae223 100644 --- a/libs/libcurl/src/vquic/vquic.c +++ b/libs/libcurl/src/vquic/vquic.c @@ -100,6 +100,7 @@ CURLcode vquic_ctx_init(struct cf_quic_ctx *qctx) }
}
#endif
+ vquic_ctx_update_time(qctx);
return CURLE_OK;
}
@@ -109,6 +110,11 @@ void vquic_ctx_free(struct cf_quic_ctx *qctx) Curl_bufq_free(&qctx->sendbuf);
}
+void vquic_ctx_update_time(struct cf_quic_ctx *qctx)
+{
+ qctx->last_op = Curl_now();
+}
+
static CURLcode send_packet_no_gso(struct Curl_cfilter *cf,
struct Curl_easy *data,
struct cf_quic_ctx *qctx,
@@ -242,6 +248,7 @@ static CURLcode vquic_send_packets(struct Curl_cfilter *cf, const uint8_t *pkt, size_t pktlen,
size_t gsolen, size_t *psent)
{
+ CURLcode result;
#ifdef DEBUGBUILD
/* simulate network blocking/partial writes */
if(qctx->wblock_percent > 0) {
@@ -254,10 +261,14 @@ static CURLcode vquic_send_packets(struct Curl_cfilter *cf, }
#endif
if(qctx->no_gso && pktlen > gsolen) {
- return send_packet_no_gso(cf, data, qctx, pkt, pktlen, gsolen, psent);
+ result = send_packet_no_gso(cf, data, qctx, pkt, pktlen, gsolen, psent);
}
-
- return do_sendmsg(cf, data, qctx, pkt, pktlen, gsolen, psent);
+ else {
+ result = do_sendmsg(cf, data, qctx, pkt, pktlen, gsolen, psent);
+ }
+ if(!result)
+ qctx->last_io = qctx->last_op;
+ return result;
}
CURLcode vquic_flush(struct Curl_cfilter *cf, struct Curl_easy *data,
@@ -524,13 +535,17 @@ CURLcode vquic_recv_packets(struct Curl_cfilter *cf, size_t max_pkts,
vquic_recv_pkt_cb *recv_cb, void *userp)
{
+ CURLcode result;
#if defined(HAVE_SENDMMSG)
- return recvmmsg_packets(cf, data, qctx, max_pkts, recv_cb, userp);
+ result = recvmmsg_packets(cf, data, qctx, max_pkts, recv_cb, userp);
#elif defined(HAVE_SENDMSG)
- return recvmsg_packets(cf, data, qctx, max_pkts, recv_cb, userp);
+ result = recvmsg_packets(cf, data, qctx, max_pkts, recv_cb, userp);
#else
- return recvfrom_packets(cf, data, qctx, max_pkts, recv_cb, userp);
+ result = recvfrom_packets(cf, data, qctx, max_pkts, recv_cb, userp);
#endif
+ if(!result)
+ qctx->last_io = qctx->last_op;
+ return result;
}
/*
|