diff options
author | Michael P. Soulier <msoulier@digitaltorque.ca> | 2009-04-10 22:48:51 -0400 |
---|---|---|
committer | Michael P. Soulier <msoulier@digitaltorque.ca> | 2009-04-10 22:48:51 -0400 |
commit | 41bf3a25e615edc2192c2639be7f4a713e48c5ef (patch) | |
tree | b22d86290c33ffae80bfda171c76f6e5b39c35d5 /tftpy/TftpClient.py | |
parent | bd2e19529f451548ccbda194a369cd2a28dddf56 (diff) | |
download | tftpy-41bf3a25e615edc2192c2639be7f4a713e48c5ef.tar.gz |
Improving sample client output on error and fixing default blocksize when
server ignores options.
Diffstat (limited to 'tftpy/TftpClient.py')
-rw-r--r-- | tftpy/TftpClient.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tftpy/TftpClient.py b/tftpy/TftpClient.py index 0935c61..a840689 100644 --- a/tftpy/TftpClient.py +++ b/tftpy/TftpClient.py @@ -119,6 +119,12 @@ class TftpClient(TftpSession): if isinstance(recvpkt, TftpPacketDAT): logger.debug("recvpkt.blocknumber = %d" % recvpkt.blocknumber) logger.debug("curblock = %d" % curblock) + + if self.state.state == 'rrq' and self.options: + logger.info("no OACK, our options were ignored") + self.options = { 'blksize': DEF_BLKSIZE } + self.state.state = 'ack' + expected_block = curblock + 1 if expected_block > 65535: logger.debug("block number rollover to 0 again") |