Subject: | infinite client retries |
Date: | Tue, 25 Jan 2011 15:37:34 +1100 |
To: | bug-POE-Component-TFTPd [...] rt.cpan.org |
From: | Brendan Beveridge <brendan.beveridge [...] optusnet.com.au> |
Hi,
I noticed that the module does not allow a client to hit the retry limit
if the client stops responding.
The reason for this is that the module resets the retry counter if the
server sends data to the client rather than when the client ack's the
packet.
Below is a 1 line fix under sub send_data :
elsif($opname eq 'ack') {
$opcode = &TFTP_OPCODE_ACK;
$data = q();
+ $client->retries = $self->retries;
$n = $client->last_block;
$done = $client->almost_done;
}
@@ -370,7 +371,7 @@
if($bytes) {
$self->log(trace => $client, "sent $opname $n");
- $client->retries = $self->retries;
$client->timestamp = time;
$self->cleanup($client) if($done);
}
Cheers
Brendan