Libcurl - Strange timeout after 5 seconds

I use libcurl to communicate with Twitter and Identi.ca. Everything works fine until my connection is busy. But if I upload a large file, curl requests a timeout after 5 seconds.

I set the following options in the curl knob:

curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 60);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 15);

and they do not matter, curl_easy_perform()always returns after 5 seconds. The values ​​of CURLINFO_RESPONSE_CODEand are CURLINFO_HTTP_CONNECTCODEalways zero.

Any ideas? Are there any other timeouts I need to set, or is there a reason why the above does not take effect?

EDIT: The return value of curl_easy_perform is equal to CURLE_OPERATION_TIMEDOUT

+3
source share
2 answers

I would say this because one of two reasons:

  • , - , libcurl .

  • libcurl , . , libcurl .

, , URL-.

+1

? , 5 .

. HEAD , , :

curl_easy_setopt(curl, CURLOPT_BINARYTRANSFER, 1);
curl_easy_setopt(curl, CURLOPT_RANGE, start_range + "-" + (start_range + chunk_size));

, , .

0

All Articles