mirror of
https://github.com/curl/curl.git
synced 2026-08-04 17:56:13 +03:00
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:
parent
b830f9ba9e
commit
a55256cfb2
9 changed files with 58 additions and 29 deletions
|
|
@ -807,8 +807,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
config->authtype |= CURLAUTH_BEARER;
|
||||
break;
|
||||
case 'c': /* connect-timeout */
|
||||
err = str2udouble(&config->connecttimeout, nextarg,
|
||||
(double)LONG_MAX/1000);
|
||||
err = secs2ms(&config->connecttimeout_ms, nextarg);
|
||||
if(err)
|
||||
return err;
|
||||
break;
|
||||
|
|
@ -1374,8 +1373,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
return err;
|
||||
break;
|
||||
case 'R': /* --expect100-timeout */
|
||||
err = str2udouble(&config->expect100timeout, nextarg,
|
||||
(double)LONG_MAX/1000);
|
||||
err = secs2ms(&config->expect100timeout_ms, nextarg);
|
||||
if(err)
|
||||
return err;
|
||||
break;
|
||||
|
|
@ -2068,7 +2066,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
break;
|
||||
case 'm':
|
||||
/* specified max time */
|
||||
err = str2udouble(&config->timeout, nextarg, (double)LONG_MAX/1000);
|
||||
err = secs2ms(&config->timeout_ms, nextarg);
|
||||
if(err)
|
||||
return err;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue