-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
multi: support mark conncache as stale when network change #17246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Thanks! Here are some good next steps:
|
Analysis of PR #17246 at 3db12794: Test 1119 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 540 different CI jobs (the link just goes to one of them). Test 284 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Test 2301 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Test 2302 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Test 2101 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Test 987 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Test 988 failed, which has NOT been flaky recently, so there could be a real issue in this PR. There are more failures, but that's enough from Gha. Generated by Testclutch |
#include <unistd.h>
#include "curl/curl.h"
int mycurl_debug(CURL *handle, curl_infotype type, char *data,
size_t size, void *userptr)
{
if(type == CURLINFO_TEXT)
printf("mycurl_debug[%d]: %s\n", type, data);
return 0;
}
int main(void)
{
CURLM *multi_handle;
CURL *easy_handle;
CURLMsg *msg;
const int try_times = 3;
const char *url = "https://www.example.com/";
curl_global_init(CURL_GLOBAL_ALL);
printf("%s\n", curl_version());
multi_handle = curl_multi_init();
for(int req_id = 0; req_id < try_times; req_id++) {
printf("New Request[%d]: %s\n", req_id, url);
int still_running = 0;
easy_handle = curl_easy_init();
curl_easy_setopt(easy_handle, CURLOPT_URL, url);
curl_easy_setopt(easy_handle, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(easy_handle, CURLOPT_DEBUGFUNCTION, mycurl_debug);
curl_multi_add_handle(multi_handle, easy_handle);
if(req_id == 1) {
curl_multi_setopt(multi_handle, CURLMOPT_CONNCACHE_STALE, 1L);
printf("Set CURLMOPT_CONNCACHE_STALE=1 before request[%d]\n", req_id);
}
else if(req_id == 2) {
curl_multi_setopt(multi_handle, CURLMOPT_CONNCACHE_STALE, 0L);
printf("Set CURLMOPT_CONNCACHE_STALE=0 before request[%d]\n", req_id);
}
do {
int numfds = 0;
curl_multi_perform(multi_handle, &still_running);
curl_multi_wait(multi_handle, NULL, 0, 10, &numfds);
} while(still_running);
do {
long num_connects = 0L;
CURLcode code;
msg = curl_multi_info_read(multi_handle, &still_running);
if(!msg)
break;
if(msg->msg != CURLMSG_DONE)
continue;
curl_easy_getinfo(easy_handle, CURLINFO_NUM_CONNECTS,
&num_connects);
code = msg->data.result;
curl_multi_remove_handle(multi_handle, easy_handle);
printf("Request[%d] result %ld, num connects %ld\n",
req_id, code, num_connects);
} while(msg);
curl_easy_cleanup(easy_handle);
sleep(1);
}
curl_multi_cleanup(multi_handle);
return 0;
}
|
de7d76c
to
251a3c6
Compare
0572163
to
c39c8d3
Compare
this PR is a simple solution for #17225