CURLOPT_LOW_SPEED_LIMIT.3 1.4 KB

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