1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_LOW_SPEED_TIME 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_LOW_SPEED_LIMIT (3) 9 - CURLOPT_TIMEOUT (3) 10Protocol: 11 - All 12Added-in: 7.1 13--- 14 15# NAME 16 17CURLOPT_LOW_SPEED_TIME - low speed limit time period 18 19# SYNOPSIS 20 21~~~c 22#include <curl/curl.h> 23 24CURLcode curl_easy_setopt(CURL *handle, CURLOPT_LOW_SPEED_TIME, 25 long speedtime); 26~~~ 27 28# DESCRIPTION 29 30Pass a long as parameter. It contains the time in number seconds that the 31transfer speed should be below the CURLOPT_LOW_SPEED_LIMIT(3) for the 32library to consider it too slow and abort. 33 34# DEFAULT 35 360, disabled 37 38# %PROTOCOLS% 39 40# EXAMPLE 41 42~~~c 43int main(void) 44{ 45 CURL *curl = curl_easy_init(); 46 if(curl) { 47 CURLcode res; 48 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); 49 /* abort if slower than 30 bytes/sec during 60 seconds */ 50 curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 60L); 51 curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 30L); 52 res = curl_easy_perform(curl); 53 if(CURLE_OPERATION_TIMEDOUT == res) { 54 printf("Timeout.\n"); 55 } 56 /* always cleanup */ 57 curl_easy_cleanup(curl); 58 } 59} 60~~~ 61 62# %AVAILABILITY% 63 64# RETURN VALUE 65 66Returns CURLE_OK 67