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:
Stefan Eissing 2025-06-13 12:38:44 +02:00 committed by Daniel Stenberg
parent 7b8594176d
commit 55c045c863
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
19 changed files with 354 additions and 4 deletions

View file

@ -273,7 +273,7 @@ test3000 test3001 test3002 test3003 test3004 test3005 test3006 test3007 \
test3008 test3009 test3010 test3011 test3012 test3013 test3014 test3015 \
test3016 test3017 test3018 test3019 test3020 test3021 test3022 test3023 \
test3024 test3025 test3026 test3027 test3028 test3029 test3030 test3031 \
test3032 \
test3032 test3033 \
\
test3100 test3101 test3102 test3103 test3104 test3105 \
\

53
tests/data/test3033 Normal file
View file

@ -0,0 +1,53 @@
<testcase>
<info>
<keywords>
curl_easy_setopt
connection reuse
libtest
</keywords>
</info>
#
# Server-side
<reply>
<data>
HTTP/1.1 200 OK
Content-Length: 6
-foo-
</data>
<datacheck>
[0] no network change
-foo-
[1] signal network change
-foo-
[2] no network change
-foo-
</datacheck>
</reply>
#
# Client-side
<client>
<server>
http
</server>
<name>
CURLOPT_FRESH_CONNECT=2
</name>
<tool>
lib%TESTNUMBER
</tool>
<command>
http://%HOSTIP:%HTTPPORT/%TESTNUMBER
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<errorcode>
0
</errorcode>
</verify>
</testcase>