mirror of
https://github.com/curl/curl.git
synced 2026-08-26 07:43:33 +03:00
multi: add CURLMOPT_NETWORK_CHANGED to signal network changed
New multi option CURLMOPT_NETWORK_CHANGED with a long bitmask value: - CURLM_NWCOPT_CLEAR_CONNS: do not reuse existing connections, close all idle connections. - CURLM_NWCOPT_CLEAR_DNS: clear the multi's DNS cache. All other bits reserved for future extensions. Fixes #17225 Reported-by: ウさん Closes #17613
This commit is contained in:
parent
7b8594176d
commit
55c045c863
19 changed files with 354 additions and 4 deletions
10
lib/multi.c
10
lib/multi.c
|
|
@ -3235,6 +3235,16 @@ 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 & CURLM_NWCOPT_CLEAR_DNS) {
|
||||
Curl_dnscache_clear(multi->admin);
|
||||
}
|
||||
if(val & CURLM_NWCOPT_CLEAR_CONNS) {
|
||||
Curl_cpool_nw_changed(multi->admin);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
res = CURLM_UNKNOWN_OPTION;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue