aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-01-13 23:24:06 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-01-13 23:24:06 +0000
commit1225d36188e56a68b3f0cc6ed0c602c3c3e00615 (patch)
treecbe5210b2220c00ccd3dec1b205c0281bd3c6b56 /lib
parenta19e02be5e3fc41aee1ecee73a26d363e186e36e (diff)
Grant Erickson fixed timeouts for TFTP
Diffstat (limited to 'lib')
-rw-r--r--lib/tftp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/tftp.c b/lib/tftp.c
index c87ecce6f..4f53580fd 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -195,11 +195,12 @@ static CURLcode tftp_set_timeouts(tftp_state_data_t *state)
{
time_t maxtime, timeout;
long timeout_ms;
+ const bool start = (state->state == TFTP_STATE_START);
time(&state->start_time);
/* Compute drop-dead time */
- timeout_ms = Curl_timeleft(state->conn, NULL, TRUE);
+ timeout_ms = Curl_timeleft(state->conn, NULL, start);
if(timeout_ms < 0) {
/* time-out, bail out, go home */
@@ -207,7 +208,7 @@ static CURLcode tftp_set_timeouts(tftp_state_data_t *state)
return CURLE_OPERATION_TIMEDOUT;
}
- if(state->state == TFTP_STATE_START) {
+ if(start) {
maxtime = (time_t)(timeout_ms + 500) / 1000;
state->max_time = state->start_time+maxtime;