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
This commit is contained in:
Joshua Rogers 2025-09-17 00:52:28 +05:00 committed by Daniel Stenberg
parent f8175b1536
commit ad147ec53d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -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) {