aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-06 18:08:11 +0000
committerYang Tse <yangsita@gmail.com>2007-02-06 18:08:11 +0000
commit77fcad041fcf6b078fb70e75eda68bfb20683c3a (patch)
treeaea2136d5666e8b07e8bc8c2d72f83cb8267f223
parente213555c98856d82ff0bed679712f4c00baf128e (diff)
fix for millisecond resolution timeouts
-rw-r--r--lib/socks.c8
-rw-r--r--lib/tftp.c6
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/socks.c b/lib/socks.c
index 32d0c4b54..b8bda8eeb 100644
--- a/lib/socks.c
+++ b/lib/socks.c
@@ -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;
diff --git a/lib/tftp.c b/lib/tftp.c
index b1a34a5df..ed391be13 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -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 */