Skip to content

Commit

Permalink
quiche, expire all active transfers on connection close
Browse files Browse the repository at this point in the history
- when a connection close is detected, all ongoing transfers
  need to expire bc no more POLL events are likely to happen
  for them.
- refs curl#13439
  • Loading branch information
icing committed Apr 23, 2024
1 parent f8011ff commit 4d32b82
Show file tree
Hide file tree
Showing 2 changed files with 220 additions and 1 deletion.
199 changes: 199 additions & 0 deletions ci-quiche-finished-ids.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
[t-0]
[t-100]
[t-101]
[t-102]
[t-103]
[t-104]
[t-105]
[t-106]
[t-107]
[t-108]
[t-109]
[t-10]
[t-110]
[t-111]
[t-112]
[t-113]
[t-114]
[t-115]
[t-116]
[t-117]
[t-118]
[t-119]
[t-11]
[t-120]
[t-121]
[t-122]
[t-123]
[t-124]
[t-125]
[t-126]
[t-127]
[t-128]
[t-129]
[t-12]
[t-130]
[t-131]
[t-132]
[t-133]
[t-134]
[t-135]
[t-136]
[t-137]
[t-138]
[t-139]
[t-13]
[t-140]
[t-141]
[t-142]
[t-143]
[t-144]
[t-145]
[t-146]
[t-147]
[t-148]
[t-149]
[t-14]
[t-150]
[t-151]
[t-152]
[t-153]
[t-154]
[t-155]
[t-156]
[t-157]
[t-158]
[t-159]
[t-15]
[t-160]
[t-161]
[t-162]
[t-163]
[t-164]
[t-165]
[t-166]
[t-167]
[t-168]
[t-169]
[t-16]
[t-170]
[t-171]
[t-172]
[t-173]
[t-174]
[t-175]
[t-176]
[t-177]
[t-178]
[t-179]
[t-17]
[t-180]
[t-181]
[t-182]
[t-183]
[t-184]
[t-185]
[t-186]
[t-187]
[t-189]
[t-18]
[t-190]
[t-191]
[t-192]
[t-193]
[t-194]
[t-195]
[t-196]
[t-197]
[t-198]
[t-199]
[t-19]
[t-1]
[t-20]
[t-21]
[t-22]
[t-23]
[t-24]
[t-25]
[t-26]
[t-27]
[t-28]
[t-29]
[t-2]
[t-30]
[t-31]
[t-32]
[t-33]
[t-34]
[t-35]
[t-36]
[t-37]
[t-38]
[t-39]
[t-3]
[t-40]
[t-41]
[t-42]
[t-43]
[t-44]
[t-45]
[t-46]
[t-47]
[t-48]
[t-49]
[t-4]
[t-50]
[t-51]
[t-52]
[t-53]
[t-54]
[t-55]
[t-56]
[t-57]
[t-58]
[t-59]
[t-5]
[t-60]
[t-61]
[t-62]
[t-63]
[t-64]
[t-65]
[t-66]
[t-67]
[t-68]
[t-69]
[t-6]
[t-70]
[t-71]
[t-72]
[t-73]
[t-74]
[t-75]
[t-76]
[t-77]
[t-78]
[t-79]
[t-7]
[t-80]
[t-81]
[t-82]
[t-83]
[t-84]
[t-85]
[t-86]
[t-87]
[t-88]
[t-89]
[t-8]
[t-90]
[t-91]
[t-92]
[t-93]
[t-94]
[t-95]
[t-96]
[t-97]
[t-98]
[t-99]
[t-9]
22 changes: 21 additions & 1 deletion lib/vquic/curl_quiche.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,20 @@ static struct Curl_easy *get_stream_easy(struct Curl_cfilter *cf,
return NULL;
}

static void cf_quiche_expire_conn_transfers(struct Curl_cfilter *cf,
struct Curl_easy *data)
{
struct Curl_easy *sdata;

DEBUGASSERT(data->multi);
CURL_TRC_CF(data, cf, "expiring all transfers on this connection");
for(sdata = data->multi->easyp; sdata; sdata = sdata->next) {
if(sdata == data || sdata->conn != data->conn)
continue;
Curl_expire(sdata, 0, EXPIRE_RUN_NOW);
}
}

/*
* write_resp_raw() copies response data in raw format to the `data`'s
* receive buffer. If not enough space is available, it appends to the
Expand Down Expand Up @@ -686,7 +700,13 @@ static CURLcode cf_flush_egress(struct Curl_cfilter *cf,
if(!expiry_ns) {
quiche_conn_on_timeout(ctx->qconn);
if(quiche_conn_is_closed(ctx->qconn)) {
failf(data, "quiche_conn_on_timeout closed the connection");
if(quiche_conn_is_timed_out(ctx->qconn))
failf(data, "connection closed by idle timeout");
else
failf(data, "connection closed by server");
/* Connection timed out, expire all transfers belonging to it
* as will not get any more POLL events here. */
cf_quiche_expire_conn_transfers(cf, data);
return CURLE_SEND_ERROR;
}
}
Expand Down

0 comments on commit 4d32b82

Please sign in to comment.