From 1225d36188e56a68b3f0cc6ed0c602c3c3e00615 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 13 Jan 2009 23:24:06 +0000 Subject: Grant Erickson fixed timeouts for TFTP --- lib/tftp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/tftp.c') 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; -- cgit v1.2.3