1CURLOPT_LOW_SPEED_LIMIT(3) curl_easy_setopt options CURLOPT_LOW_SPEED_LIMIT(3)
2
3
4

NAME

6       CURLOPT_LOW_SPEED_LIMIT - set low speed limit in bytes per second
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode  curl_easy_setopt(CURL  *handle, CURLOPT_LOW_SPEED_LIMIT, long
12       speedlimit);
13

DESCRIPTION

15       Pass a long as parameter. It contains the  average  transfer  speed  in
16       bytes  per  second  that  the  transfer  should  be  below  during CUR‐
17       LOPT_LOW_SPEED_TIME(3) seconds for libcurl to consider  it  to  be  too
18       slow and abort.
19

DEFAULT

21       0, disabled
22

PROTOCOLS

24       All
25

EXAMPLE

27       curl = curl_easy_init();
28       if(curl) {
29         curl_easy_setopt(curl, CURLOPT_URL, url);
30         /* abort if slower than 30 bytes/sec during 60 seconds */
31         curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 60L);
32         curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 30L);
33         res = curl_easy_perform(curl);
34         if(CURLE_OPERATION_TIMEDOUT == res) {
35           printf("Timeout!\n");
36         }
37         /* always cleanup */
38         curl_easy_cleanup(curl);
39       }
40

AVAILABILITY

42       Always
43

RETURN VALUE

45       Returns CURLE_OK
46

SEE ALSO

48       CURLOPT_LOW_SPEED_TIME(3), CURLOPT_TIMEOUT(3),
49
50
51
52libcurl 7.71.1                   May 06, 2017       CURLOPT_LOW_SPEED_LIMIT(3)
Impressum