X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=docs%2Flibcurl%2Fopts%2FCURLOPT_LOW_SPEED_TIME.3;h=c5b7ddf5de4945dffdb9793b053c284a4d014675;hb=cfd75dcdb18d0a4291f48020211c65507a97d9eb;hp=ed3b8296c793036d9494e8218239cae83bf5f076;hpb=24b9957402f17c422eeeb3386bf049feeb342e78;p=platform%2Fupstream%2Fcurl.git diff --git a/docs/libcurl/opts/CURLOPT_LOW_SPEED_TIME.3 b/docs/libcurl/opts/CURLOPT_LOW_SPEED_TIME.3 index ed3b829..c5b7ddf 100644 --- a/docs/libcurl/opts/CURLOPT_LOW_SPEED_TIME.3 +++ b/docs/libcurl/opts/CURLOPT_LOW_SPEED_TIME.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. .\" * .\" * This software is licensed as described in the file COPYING, which .\" * you should have received as part of this distribution. The terms @@ -20,7 +20,8 @@ .\" * .\" ************************************************************************** .\" -.TH CURLOPT_LOW_SPEED_TIME 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options" +.TH CURLOPT_LOW_SPEED_TIME 3 "May 06, 2017" "libcurl 7.59.0" "curl_easy_setopt options" + .SH NAME CURLOPT_LOW_SPEED_TIME \- set low speed limit time period .SH SYNOPSIS @@ -36,7 +37,21 @@ library to consider it too slow and abort. .SH PROTOCOLS All .SH EXAMPLE -TODO +.nf +curl = curl_easy_init(); +if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, url); + /* abort if slower than 30 bytes/sec during 60 seconds */ + curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 60L); + curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 30L); + res = curl_easy_perform(curl); + if(CURLE_OPERATION_TIMEDOUT == res) { + printf("Timeout!\\n"); + } + /* always cleanup */ + curl_easy_cleanup(curl); +} +.fi .SH AVAILABILITY Always .SH RETURN VALUE