aboutsummaryrefslogtreecommitdiff
path: root/lib/multi.c
diff options
context:
space:
mode:
authorBrad Spencer <bspencer@blackberry.com>2018-12-14 17:18:22 -0400
committerDaniel Stenberg <daniel@haxx.se>2019-01-07 10:05:20 +0100
commit84a30d0a419ad95c53cbdfc76eb2eb75d2e51835 (patch)
tree5a7c04df819a465e7711f9c9b0c831f5532b0326 /lib/multi.c
parentebe658c1e5a6577178981a7f406794699305be5c (diff)
curl_multi_remove_handle() don't block terminating c-ares requests
Added Curl_resolver_kill() for all three resolver modes, which only blocks when necessary, along with test 1592 to confirm curl_multi_remove_handle() doesn't block unless it must. Closes #3428 Fixes #3371
Diffstat (limited to 'lib/multi.c')
-rw-r--r--lib/multi.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 54d954e65..249280f2b 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -537,10 +537,8 @@ static CURLcode multi_done(struct connectdata **connp,
/* Stop if multi_done() has already been called */
return CURLE_OK;
- if(data->mstate == CURLM_STATE_WAITRESOLVE) {
- /* still waiting for the resolve to complete */
- (void)Curl_resolver_wait_resolv(conn, NULL);
- }
+ /* Stop the resolver and free its own resources (but not dns_entry yet). */
+ Curl_resolver_kill(conn);
Curl_getoff_all_pipelines(data, conn);
@@ -587,7 +585,6 @@ static CURLcode multi_done(struct connectdata **connp,
}
data->state.done = TRUE; /* called just now! */
- Curl_resolver_cancel(conn);
if(conn->dns_entry) {
Curl_resolv_unlock(data, conn->dns_entry); /* done with this */