Skip to content

Commit

Permalink
tftp: add debug logging for issue 12040
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Oct 6, 2023
1 parent 6dd6654 commit b07a266
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/tftp.c
Expand Up @@ -1202,8 +1202,8 @@ static timediff_t tftp_state_timeout(struct Curl_easy *data,
struct tftp_state_data *state = conn->proto.tftpc;
timediff_t timeout_ms;

if(event)
*event = TFTP_EVENT_NONE;
DEBUGASSERT(event);
*event = TFTP_EVENT_NONE;

timeout_ms = Curl_timeleft(state->data, NULL,
(state->state == TFTP_STATE_START));
Expand All @@ -1214,8 +1214,10 @@ static timediff_t tftp_state_timeout(struct Curl_easy *data,
}
time(&current);
if(current > state->rx_time + state->retry_time) {
if(event)
*event = TFTP_EVENT_TIMEOUT;
DEBUGF(infof(data, "tftp_state_timeout: %ld > %ld + %ld",
(long)current, (long)state->rx_time,
(long)state->retry_time));
*event = TFTP_EVENT_TIMEOUT;
time(&state->rx_time); /* update even though we received nothing */
}

Expand Down

0 comments on commit b07a266

Please sign in to comment.