mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:23:34 +03:00
multi, signal network changed
A modified version of #17246 for signalling changes in network: New multi option `CURLMOPT_NETWORK_CHANGED` with a long value: 0 - does nothing 1 - do not reuse existing connections 2 - as 1, but also clear DNS cache One could also make the long a bitmask, if people want more control. Documentation to be added if this gets the vote to go forward.
This commit is contained in:
parent
7b8594176d
commit
b1e6bae277
14 changed files with 257 additions and 4 deletions
12
lib/multi.c
12
lib/multi.c
|
|
@ -3235,6 +3235,18 @@ CURLMcode curl_multi_setopt(CURLM *m,
|
|||
multi->max_concurrent_streams = (unsigned int)streams;
|
||||
}
|
||||
break;
|
||||
case CURLMOPT_NETWORK_CHANGED: {
|
||||
long val = va_arg(param, long);
|
||||
if(val >= 2) {
|
||||
/* clear DNS cache */
|
||||
Curl_dnscache_clear(multi->admin);
|
||||
}
|
||||
if(val >= 1) {
|
||||
/* do not reuse existing connections */
|
||||
Curl_cpool_nw_changed(multi->admin);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
res = CURLM_UNKNOWN_OPTION;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue