From 45185ed44c53fefc9450a4e307eb66373f30b7a6 Mon Sep 17 00:00:00 2001 From: "Michael P. Soulier" Date: Tue, 20 Jul 2010 15:41:15 -0400 Subject: [PATCH] Fixing setNextBlock to roll over at 2**16 - 1 instead of 2**16, which was causing problems when uploading large files. Thanks to LawrenceK for the bug report. Fixes issue15. --- tftpy/TftpStates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tftpy/TftpStates.py b/tftpy/TftpStates.py index 103dbc0..fdc4566 100644 --- a/tftpy/TftpStates.py +++ b/tftpy/TftpStates.py @@ -132,7 +132,7 @@ class TftpContext(object): host = property(gethost, sethost) def setNextBlock(self, block): - if block > 2 ** 16: + if block >= 2 ** 16: log.debug("Block number rollover to 0 again") block = 0 self.__eblock = block