1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

TFTP: don't ack if wrong block num is received

If an unexpected block number was received, break out of the
switch loop.
This commit is contained in:
Daniel Stenberg 2010-05-21 23:07:59 +02:00
parent 0a29e2445c
commit 0bb6deda72

View File

@ -599,11 +599,12 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
infof(data,
"Received unexpected DATA packet block %d\n", rblock);
state->retries++;
if(state->retries>state->retry_max) {
if(state->retries > state->retry_max) {
failf(data, "tftp_rx: giving up waiting for block %d",
NEXT_BLOCKNUM(state->block));
return CURLE_TFTP_ILLEGAL;
}
break;
}
/* This is the expected block. Reset counters and ACK it. */
state->block = (unsigned short)rblock;