CURLOPT_LOW_SPEED_TIME.3 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. .\" generated by cd2nroff 0.1 from CURLOPT_LOW_SPEED_TIME.md
  2. .TH CURLOPT_LOW_SPEED_TIME 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_LOW_SPEED_TIME \- low speed limit time period
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_LOW_SPEED_TIME,
  9. long speedtime);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a long as parameter. It contains the time in number seconds that the
  13. transfer speed should be below the \fICURLOPT_LOW_SPEED_LIMIT(3)\fP for the
  14. library to consider it too slow and abort.
  15. .SH DEFAULT
  16. 0, disabled
  17. .SH PROTOCOLS
  18. This functionality affects all supported protocols
  19. .SH EXAMPLE
  20. .nf
  21. int main(void)
  22. {
  23. CURL *curl = curl_easy_init();
  24. if(curl) {
  25. CURLcode res;
  26. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  27. /* abort if slower than 30 bytes/sec during 60 seconds */
  28. curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 60L);
  29. curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 30L);
  30. res = curl_easy_perform(curl);
  31. if(CURLE_OPERATION_TIMEDOUT == res) {
  32. printf("Timeout!\\n");
  33. }
  34. /* always cleanup */
  35. curl_easy_cleanup(curl);
  36. }
  37. }
  38. .fi
  39. .SH AVAILABILITY
  40. Added in curl 7.1
  41. .SH RETURN VALUE
  42. Returns CURLE_OK
  43. .SH SEE ALSO
  44. .BR CURLOPT_LOW_SPEED_LIMIT (3),
  45. .BR CURLOPT_TIMEOUT (3)