From: Daniel Stenberg Date: Mon, 6 Oct 2025 15:32:50 +0000 (+0200) Subject: tftp: default timeout per block is now 15 seconds X-Git-Tag: rc-8_17_0-1~94 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc90f80556a731d31a60cbe76b82b3060bda48bc;p=thirdparty%2Fcurl.git tftp: default timeout per block is now 15 seconds Down from the previous (rather ridiculous) 3600. Reported-by: Joshua Rogers Closes #18893 --- diff --git a/lib/tftp.c b/lib/tftp.c index baebe466a1..56b7afda52 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -206,7 +206,7 @@ const struct Curl_handler Curl_handler_tftp = { **********************************************************/ static CURLcode tftp_set_timeouts(struct tftp_conn *state) { - time_t maxtime, timeout; + time_t timeout; timediff_t timeout_ms; bool start = (state->state == TFTP_STATE_START); @@ -219,13 +219,11 @@ static CURLcode tftp_set_timeouts(struct tftp_conn *state) return CURLE_OPERATION_TIMEDOUT; } + /* Set per-block timeout to total */ if(timeout_ms > 0) - maxtime = (time_t)(timeout_ms + 500) / 1000; + timeout = (time_t)(timeout_ms + 500) / 1000; else - maxtime = 3600; /* use for calculating block timeouts */ - - /* Set per-block timeout to total */ - timeout = maxtime; + timeout = 15; /* Average reposting an ACK after 5 seconds */ state->retry_max = (int)timeout/5;