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