-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
option CURLOPT_TCP_KEEPALIVE doesn't work with new version #14368
Comments
I used wireShark to analyze the net package .The new version really doesn't send the [Tcp keep-alive ack] package. |
Tell us how you build your libcurl. Or maybe single-step through tcpkeepalive and tell us where it goes wrong? Line 171 in acbc6b7
|
cmake-gui output info: |
I built curl on windows 10 with the default cmake options, and the problem is in lib\cf-socket.c KEEPALIVE_FACTOR is set to 1000 so they are being converted to milliseconds, but it is using setsockopt which is expecting seconds. PR here, sorry if any mistakes, first time: #14606 |
I did this
I use curl to request to a php web api.
The PHP server will take a long time to answer the request ,like 600 seconds.So,I need to keep alive to wait the reply.
Old version 7.65.3 works well,but new version failed .I tried new two version 8.9.0,8.9.1,complied in win 10 with vs2019.
main code like this:
`//http is the same,this url sleep ,eg,300s ,then reply
curl_easy_setopt(curl, CURLOPT_URL, "https://www.some.com");
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
//
curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE,60L);
//
curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 30L);
//
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 600L);//600s timeout
CURLcode res = curl_easy_perform(curl);
if(res == CURLE_OK) {
//7.65.3 will come here
} else {
//timeout
//new version will come here 8.9.0,8.9.1
}`
I expected the following
keep alive
curl/libcurl version
version 7.65.3 works
version 8.9.0 or 8.9.1 does'nt work
operating system
win10,with openssl 3.3.1
The text was updated successfully, but these errors were encountered: