From: Joshua Rogers Date: Tue, 16 Sep 2025 19:52:28 +0000 (+0500) Subject: tftp: propagate expired timer from tftp_state_timeout() X-Git-Tag: rc-8_17_0-2~466 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad147ec53de822a18b5dec63b72f43688ae53869;p=thirdparty%2Fcurl.git tftp: propagate expired timer from tftp_state_timeout() 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 --- 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) {