From ad147ec53de822a18b5dec63b72f43688ae53869 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Wed, 17 Sep 2025 00:52:28 +0500 Subject: [PATCH] tftp: propagate expired timer from tftp_state_timeout() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When Curl_timeleft() < 0 we used to return 0, masking the expiry and skipping the caller’s (timeout_ms < 0) path. Now we set FIN and return the negative value so tftp_multi_statemach() aborts with CURLE_OPERATION_TIMEDOUT as intended. Closes #18574 --- lib/tftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tftp.c b/lib/tftp.c index 4c2fadc2ca..620ab1e70d 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -1184,7 +1184,7 @@ static timediff_t tftp_state_timeout(struct tftp_conn *state, if(timeout_ms < 0) { state->error = TFTP_ERR_TIMEOUT; state->state = TFTP_STATE_FIN; - return 0; + return timeout_ms; } current = time(NULL); if(current > state->rx_time + state->retry_time) { -- 2.47.3