mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
fix for millisecond resolution timeouts
This commit is contained in:
parent
e213555c98
commit
77fcad041f
@ -343,14 +343,14 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
|
||||
/* get timeout */
|
||||
if(data->set.timeout && data->set.connecttimeout) {
|
||||
if (data->set.timeout < data->set.connecttimeout)
|
||||
timeout = data->set.timeout*1000;
|
||||
timeout = data->set.timeout;
|
||||
else
|
||||
timeout = data->set.connecttimeout*1000;
|
||||
timeout = data->set.connecttimeout;
|
||||
}
|
||||
else if(data->set.timeout)
|
||||
timeout = data->set.timeout*1000;
|
||||
timeout = data->set.timeout;
|
||||
else if(data->set.connecttimeout)
|
||||
timeout = data->set.connecttimeout*1000;
|
||||
timeout = data->set.connecttimeout;
|
||||
else
|
||||
timeout = DEFAULT_CONNECT_TIMEOUT;
|
||||
|
||||
|
@ -177,7 +177,8 @@ void tftp_set_timeouts(tftp_state_data_t *state)
|
||||
time(&state->start_time);
|
||||
if(state->state == TFTP_STATE_START) {
|
||||
/* Compute drop-dead time */
|
||||
maxtime = (time_t)(data->set.connecttimeout?data->set.connecttimeout:30);
|
||||
maxtime = (time_t)(data->set.connecttimeout/1000L?
|
||||
data->set.connecttimeout/1000L:30);
|
||||
state->max_time = state->start_time+maxtime;
|
||||
|
||||
/* Set per-block timeout to total */
|
||||
@ -195,7 +196,8 @@ void tftp_set_timeouts(tftp_state_data_t *state)
|
||||
else {
|
||||
|
||||
/* Compute drop-dead time */
|
||||
maxtime = (time_t)(data->set.timeout?data->set.timeout/1000L:3600);
|
||||
maxtime = (time_t)(data->set.timeout/1000L?
|
||||
data->set.timeout/1000L:3600);
|
||||
state->max_time = state->start_time+maxtime;
|
||||
|
||||
/* Set per-block timeout to 10% of total */
|
||||
|
Loading…
Reference in New Issue
Block a user