mirror of
https://github.com/curl/curl.git
synced 2025-09-04 11:24:59 +03:00
multi: change prefix for the network change bits to CURLMNWC_
Because "CURLM_" is used for curl multi error codes and it is convenient to use the prefix to identify the number family. Closes #18176
This commit is contained in:
parent
96ff6b98b4
commit
3689ef21bd
|
@ -42,13 +42,13 @@ to clear the caches.
|
||||||
The call affects only the connection and DNS cache of the multi handle
|
The call affects only the connection and DNS cache of the multi handle
|
||||||
itself and not the ones owned by SHARE handles.
|
itself and not the ones owned by SHARE handles.
|
||||||
|
|
||||||
## CURLM_NWCOPT_CLEAR_CONNS
|
## CURLMNWC_CLEAR_CONNS
|
||||||
|
|
||||||
No longer reuse any existing connection in the multi handle's
|
No longer reuse any existing connection in the multi handle's
|
||||||
connection cache. This closes all connections that are not in use.
|
connection cache. This closes all connections that are not in use.
|
||||||
Ongoing transfers continue on the connections they operate on.
|
Ongoing transfers continue on the connections they operate on.
|
||||||
|
|
||||||
## CURLM_NWCOPT_CLEAR_DNS
|
## CURLMNWC_CLEAR_DNS
|
||||||
|
|
||||||
Clear the multi handle's DNS cache.
|
Clear the multi handle's DNS cache.
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ int main(void)
|
||||||
CURLM *m = curl_multi_init();
|
CURLM *m = curl_multi_init();
|
||||||
/* do transfers on the multi handle */
|
/* do transfers on the multi handle */
|
||||||
/* do not reuse existing connections */
|
/* do not reuse existing connections */
|
||||||
curl_multi_setopt(m, CURLMOPT_NETWORK_CHANGED, CURLM_NWCOPT_CLEAR_CONNS);
|
curl_multi_setopt(m, CURLMOPT_NETWORK_CHANGED, CURLMNWC_CLEAR_CONNS);
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
|
|
@ -545,21 +545,21 @@ CURLM_BAD_SOCKET 7.15.4
|
||||||
CURLM_CALL_MULTI_PERFORM 7.9.6
|
CURLM_CALL_MULTI_PERFORM 7.9.6
|
||||||
CURLM_CALL_MULTI_SOCKET 7.15.5
|
CURLM_CALL_MULTI_SOCKET 7.15.5
|
||||||
CURLM_INTERNAL_ERROR 7.9.6
|
CURLM_INTERNAL_ERROR 7.9.6
|
||||||
CURLM_NWCOPT_CLEAR_CONNS 8.16.0
|
|
||||||
CURLM_NWCOPT_CLEAR_DNS 8.16.0
|
|
||||||
CURLM_OK 7.9.6
|
CURLM_OK 7.9.6
|
||||||
CURLM_OUT_OF_MEMORY 7.9.6
|
CURLM_OUT_OF_MEMORY 7.9.6
|
||||||
CURLM_RECURSIVE_API_CALL 7.59.0
|
CURLM_RECURSIVE_API_CALL 7.59.0
|
||||||
CURLM_UNKNOWN_OPTION 7.15.4
|
CURLM_UNKNOWN_OPTION 7.15.4
|
||||||
CURLM_UNRECOVERABLE_POLL 7.84.0
|
CURLM_UNRECOVERABLE_POLL 7.84.0
|
||||||
CURLM_WAKEUP_FAILURE 7.68.0
|
CURLM_WAKEUP_FAILURE 7.68.0
|
||||||
CURLMINFO_NONE 8.16.0
|
|
||||||
CURLMINFO_XFERS_CURRENT 8.16.0
|
|
||||||
CURLMINFO_XFERS_RUNNING 8.16.0
|
|
||||||
CURLMINFO_XFERS_PENDING 8.16.0
|
|
||||||
CURLMINFO_XFERS_DONE 8.16.0
|
|
||||||
CURLMINFO_XFERS_ADDED 8.16.0
|
|
||||||
CURLMIMEOPT_FORMESCAPE 7.81.0
|
CURLMIMEOPT_FORMESCAPE 7.81.0
|
||||||
|
CURLMINFO_NONE 8.16.0
|
||||||
|
CURLMINFO_XFERS_ADDED 8.16.0
|
||||||
|
CURLMINFO_XFERS_CURRENT 8.16.0
|
||||||
|
CURLMINFO_XFERS_DONE 8.16.0
|
||||||
|
CURLMINFO_XFERS_PENDING 8.16.0
|
||||||
|
CURLMINFO_XFERS_RUNNING 8.16.0
|
||||||
|
CURLMNWC_CLEAR_CONNS 8.16.0
|
||||||
|
CURLMNWC_CLEAR_DNS 8.16.0
|
||||||
CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE 7.30.0
|
CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE 7.30.0
|
||||||
CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE 7.30.0
|
CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE 7.30.0
|
||||||
CURLMOPT_MAX_CONCURRENT_STREAMS 7.67.0
|
CURLMOPT_MAX_CONCURRENT_STREAMS 7.67.0
|
||||||
|
|
|
@ -403,15 +403,15 @@ typedef enum {
|
||||||
|
|
||||||
/* Definition of bits for the CURLMOPT_NETWORK_CHANGED argument: */
|
/* Definition of bits for the CURLMOPT_NETWORK_CHANGED argument: */
|
||||||
|
|
||||||
/* - CURLM_NWCOPT_CLEAR_CONNS tells libcurl to prevent further reuse
|
/* - CURLMNWC_CLEAR_CONNS tells libcurl to prevent further reuse of existing
|
||||||
of existing connections. Connections that are idle will be closed.
|
connections. Connections that are idle will be closed. Ongoing transfers
|
||||||
Ongoing transfers will continue with the connection they have. */
|
will continue with the connection they have. */
|
||||||
#define CURLM_NWCOPT_CLEAR_CONNS (1L<<0)
|
#define CURLMNWC_CLEAR_CONNS (1L<<0)
|
||||||
|
|
||||||
/* - CURLM_NWCOPT_CLEAR_DNS tells libcurl to prevent further reuse
|
/* - CURLMNWC_CLEAR_DNS tells libcurl to prevent further reuse of existing
|
||||||
of existing connections. Connections that are idle will be closed.
|
connections. Connections that are idle will be closed. Ongoing transfers
|
||||||
Ongoing transfers will continue with the connection they have. */
|
will continue with the connection they have. */
|
||||||
#define CURLM_NWCOPT_CLEAR_DNS (1L<<0)
|
#define CURLMNWC_CLEAR_DNS (1L<<0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Name: curl_multi_setopt()
|
* Name: curl_multi_setopt()
|
||||||
|
|
14
lib/multi.c
14
lib/multi.c
|
@ -3244,13 +3244,13 @@ CURLMcode curl_multi_setopt(CURLM *m,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CURLMOPT_NETWORK_CHANGED: {
|
case CURLMOPT_NETWORK_CHANGED: {
|
||||||
long val = va_arg(param, long);
|
long val = va_arg(param, long);
|
||||||
if(val & CURLM_NWCOPT_CLEAR_DNS) {
|
if(val & CURLMNWC_CLEAR_DNS) {
|
||||||
Curl_dnscache_clear(multi->admin);
|
Curl_dnscache_clear(multi->admin);
|
||||||
}
|
}
|
||||||
if(val & CURLM_NWCOPT_CLEAR_CONNS) {
|
if(val & CURLMNWC_CLEAR_CONNS) {
|
||||||
Curl_cpool_nw_changed(multi->admin);
|
Curl_cpool_nw_changed(multi->admin);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -36,7 +36,7 @@ static CURLcode t3033_req_test(CURLM *multi, CURL *easy,
|
||||||
|
|
||||||
if(index == 1) {
|
if(index == 1) {
|
||||||
curl_multi_setopt(multi, CURLMOPT_NETWORK_CHANGED,
|
curl_multi_setopt(multi, CURLMOPT_NETWORK_CHANGED,
|
||||||
CURLM_NWCOPT_CLEAR_CONNS);
|
CURLMNWC_CLEAR_CONNS);
|
||||||
curl_mprintf("[1] signal network change\n");
|
curl_mprintf("[1] signal network change\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user