1CURLOPT_SERVER_RESPONSE_TIMEOUT(3)  libcurl CURLOPT_SERVER_RESPONSE_TIMEOUT(3)
2
3
4

NAME

6       CURLOPT_SERVER_RESPONSE_TIMEOUT  -  time allowed to wait for server re‐
7       sponse
8

SYNOPSIS

10       #include <curl/curl.h>
11
12       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SERVER_RESPONSE_TIMEOUT,
13                                 long timeout);
14

DESCRIPTION

16       Pass a long.  Causes libcurl to set a timeout period  (in  seconds)  on
17       the  amount of time that the server is allowed to take in order to send
18       a response message for a command before the session is considered dead.
19       While  libcurl  is  waiting  for  a response, this value overrides CUR‐
20       LOPT_TIMEOUT(3). It is recommended that if  used  in  conjunction  with
21       CURLOPT_TIMEOUT(3),  you  set  CURLOPT_SERVER_RESPONSE_TIMEOUT(3)  to a
22       value smaller than CURLOPT_TIMEOUT(3).
23
24       This option was formerly known as CURLOPT_FTP_RESPONSE_TIMEOUT.
25

DEFAULT

27       None
28

PROTOCOLS

30       FTP, IMAP, POP3, SMTP, and SSH
31

EXAMPLE

33       CURL *curl = curl_easy_init();
34       if(curl) {
35         curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/slow.txt");
36         /* wait no more than 23 seconds */
37         curl_easy_setopt(curl, CURLOPT_SERVER_RESPONSE_TIMEOUT, 23L);
38         ret = curl_easy_perform(curl);
39
40         curl_easy_cleanup(curl);
41       }
42

AVAILABILITY

44       Added in 7.10.8. Used under this name since 7.20.0
45
46       Support for SSH is predicated on a new enough (1.11.0) version of  lib‐
47       ssh2 being available when compiling libcurl.
48

RETURN VALUE

50       Returns CURLE_OK if supported, and CURLE_UNKNOWN_OPTION if not. Returns
51       CURLE_BAD_FUNCTION_ARGUMENT if set to a negative value or a value  that
52       when converted to milliseconds is too large.
53

SEE ALSO

55       CURLOPT_TIMEOUT(3),           CURLOPT_CONNECTTIMEOUT(3),           CUR‐
56       LOPT_LOW_SPEED_LIMIT(3),
57
58
59
60ibcurl 8.2.1                    April 26, 202C3URLOPT_SERVER_RESPONSE_TIMEOUT(3)
Impressum