url: don't touch the multi handle when closing internal handles
Reported-by: Maksymilian Arciemowicz Closes #12165
This commit is contained in:
parent
d31a8424e8
commit
b0bee93dfe
@ -373,7 +373,7 @@ struct Curl_addrinfo *Curl_doh(struct Curl_easy *data,
|
|||||||
int slot;
|
int slot;
|
||||||
struct dohdata *dohp;
|
struct dohdata *dohp;
|
||||||
struct connectdata *conn = data->conn;
|
struct connectdata *conn = data->conn;
|
||||||
*waitp = TRUE; /* this never returns synchronously */
|
*waitp = FALSE;
|
||||||
(void)hostname;
|
(void)hostname;
|
||||||
(void)port;
|
(void)port;
|
||||||
|
|
||||||
@ -413,12 +413,14 @@ struct Curl_addrinfo *Curl_doh(struct Curl_easy *data,
|
|||||||
dohp->pending++;
|
dohp->pending++;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
*waitp = TRUE; /* this never returns synchronously */
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
curl_slist_free_all(dohp->headers);
|
curl_slist_free_all(dohp->headers);
|
||||||
data->req.doh->headers = NULL;
|
data->req.doh->headers = NULL;
|
||||||
for(slot = 0; slot < DOH_PROBE_SLOTS; slot++) {
|
for(slot = 0; slot < DOH_PROBE_SLOTS; slot++) {
|
||||||
|
(void)curl_multi_remove_handle(data->multi, dohp->probe[slot].easy);
|
||||||
Curl_close(&dohp->probe[slot].easy);
|
Curl_close(&dohp->probe[slot].easy);
|
||||||
}
|
}
|
||||||
Curl_safefree(data->req.doh);
|
Curl_safefree(data->req.doh);
|
||||||
|
|||||||
@ -363,6 +363,7 @@ CURLcode Curl_close(struct Curl_easy **datap)
|
|||||||
/* Detach connection if any is left. This should not be normal, but can be
|
/* Detach connection if any is left. This should not be normal, but can be
|
||||||
the case for example with CONNECT_ONLY + recv/send (test 556) */
|
the case for example with CONNECT_ONLY + recv/send (test 556) */
|
||||||
Curl_detach_connection(data);
|
Curl_detach_connection(data);
|
||||||
|
if(!data->internal) {
|
||||||
if(data->multi)
|
if(data->multi)
|
||||||
/* This handle is still part of a multi handle, take care of this first
|
/* This handle is still part of a multi handle, take care of this first
|
||||||
and detach this handle from there. */
|
and detach this handle from there. */
|
||||||
@ -374,6 +375,7 @@ CURLcode Curl_close(struct Curl_easy **datap)
|
|||||||
curl_multi_cleanup(data->multi_easy);
|
curl_multi_cleanup(data->multi_easy);
|
||||||
data->multi_easy = NULL;
|
data->multi_easy = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data->magic = 0; /* force a clear AFTER the possibly enforced removal from
|
data->magic = 0; /* force a clear AFTER the possibly enforced removal from
|
||||||
the multi handle, since that function uses the magic
|
the multi handle, since that function uses the magic
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user