o ignore response-body on redirect even if compressed
o OpenSSL handshake state-machine for multi interface
o TFTP timeout option sent correctly
+ o TFTP block id wrap
This release includes the following known bugs:
Rainer Canavan, Paul Howarth, Jerome Vouillon, Ruslan Gazizov, Yang Tse,
Kamil Dudka, Alex Bligh, Ben Greear, Hoi-Ho Chan, Howard Chu, Dirk Manske,
- Pavel Raiskup, John-Mark Bell, Eric Mertens, Tor Arntsen
+ Pavel Raiskup, John-Mark Bell, Eric Mertens, Tor Arntsen, Douglas Kilpatrick
Thanks! (and sorry if I forgot to mention someone)
return res;
}
+/* the next blocknum is x + 1 but it needs to wrap at an unsigned 16bit
+ boundary */
+#define NEXT_BLOCKNUM(x) (((x)+1)&0xffff)
+
/**********************************************************
*
* tftp_rx
case TFTP_EVENT_DATA:
/* Is this the block we expect? */
rblock = getrpacketblock(&state->rpacket);
- if((state->block+1) != rblock) {
+ if(NEXT_BLOCKNUM(state->block) != rblock) {
/* No, log it, up the retry count and fail if over the limit */
infof(data,
"Received unexpected DATA packet block %d\n", rblock);
state->retries++;
if(state->retries>state->retry_max) {
failf(data, "tftp_rx: giving up waiting for block %d",
- state->block+1);
+ NEXT_BLOCKNUM(state->block));
return CURLE_TFTP_ILLEGAL;
}
}
state->retries++;
infof(data,
"Timeout waiting for block %d ACK. Retries = %d\n",
- state->block+1, state->retries);
+ NEXT_BLOCKNUM(state->block), state->retries);
if(state->retries > state->retry_max) {
state->error = TFTP_ERR_TIMEOUT;
state->state = TFTP_STATE_FIN;
/* Increment the retry counter and log the timeout */
state->retries++;
infof(data, "Timeout waiting for block %d ACK. "
- " Retries = %d\n", state->block+1, state->retries);
+ " Retries = %d\n", NEXT_BLOCKNUM(state->block), state->retries);
/* Decide if we've had enough */
if(state->retries > state->retry_max) {
state->error = TFTP_ERR_TIMEOUT;
case TFTP_EVENT_DATA:
/* Don't pass to the client empty or retransmitted packets */
if(state->rbytes > 4 &&
- ((state->block+1) == getrpacketblock(&state->rpacket))) {
+ (NEXT_BLOCKNUM(state->block) == getrpacketblock(&state->rpacket))) {
result = Curl_client_write(conn, CLIENTWRITE_BODY,
- (char *)state->rpacket.data+4,
- state->rbytes-4);
+ (char *)state->rpacket.data+4,
+ state->rbytes-4);
if(result) {
tftp_state_machine(state, TFTP_EVENT_ERROR);
return result;