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