mirror of
https://github.com/curl/curl.git
synced 2026-04-14 23:01:41 +03:00
asyn-thrdd: item cleanup using resolv_id
Now that we support multiple async operations at the same transfer, fix the thread queue cleanup to match not only the mid but also the resolv_id. Found by Codex Security Closes #21202
This commit is contained in:
parent
33e43985b8
commit
99d5b90878
1 changed files with 11 additions and 3 deletions
|
|
@ -257,11 +257,16 @@ void Curl_async_thrdd_shutdown(struct Curl_easy *data,
|
|||
Curl_async_thrdd_destroy(data, async);
|
||||
}
|
||||
|
||||
struct async_thrdd_match_ctx {
|
||||
uint32_t mid;
|
||||
uint32_t resolv_id;
|
||||
};
|
||||
|
||||
static bool async_thrdd_match_item(void *qitem, void *match_data)
|
||||
{
|
||||
struct Curl_easy *data = match_data;
|
||||
const struct async_thrdd_match_ctx *ctx = match_data;
|
||||
struct async_thrdd_item *item = qitem;
|
||||
return item->mid == data->mid;
|
||||
return (item->mid == ctx->mid) && (item->resolv_id == ctx->resolv_id);
|
||||
}
|
||||
|
||||
void Curl_async_thrdd_destroy(struct Curl_easy *data,
|
||||
|
|
@ -271,8 +276,11 @@ void Curl_async_thrdd_destroy(struct Curl_easy *data,
|
|||
if(async->queries_ongoing && !async->done &&
|
||||
data->multi && data->multi->resolv_thrdq) {
|
||||
/* Remove any resolve items still queued */
|
||||
struct async_thrdd_match_ctx mctx;
|
||||
mctx.mid = data->mid;
|
||||
mctx.resolv_id = async->id;
|
||||
Curl_thrdq_clear(data->multi->resolv_thrdq,
|
||||
async_thrdd_match_item, data);
|
||||
async_thrdd_match_item, &mctx);
|
||||
}
|
||||
#ifdef USE_HTTPSRR_ARES
|
||||
if(async->thrdd.rr.channel) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue