curl: timeout in the read callback

The read callback can timeout if there's nothing to read within the
given maximum period. Example use case is when doing "curl -m 3
telnet://example.com" or anything else that expects input on stdin or
similar that otherwise would "hang" until something happens and then not
respect the timeout.

This fixes KNOWN_BUG 8.1, first filed in July 2009.

Bug: https://sourceforge.net/p/curl/bugs/846/

Closes #9815
This commit is contained in:
Daniel Stenberg 2022-10-27 13:40:06 +02:00
parent b830f9ba9e
commit a55256cfb2
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
9 changed files with 58 additions and 29 deletions

View file

@ -70,8 +70,8 @@ struct OperationConfig {
char *postfields;
curl_off_t postfieldsize;
char *referer;
double timeout;
double connecttimeout;
long timeout_ms;
long connecttimeout_ms;
long maxredirs;
curl_off_t max_filesize;
char *output_dir;
@ -272,7 +272,7 @@ struct OperationConfig {
bool abstract_unix_socket; /* path to an abstract Unix domain socket */
bool falsestart;
bool path_as_is;
double expect100timeout;
long expect100timeout_ms;
bool suppress_connect_headers; /* suppress proxy CONNECT response headers
from user callbacks */
bool synthetic_error; /* if TRUE, this is tool-internal error */