summaryrefslogtreecommitdiff
path: root/tftpy/TftpClient.py
diff options
context:
space:
mode:
authorMichael P. Soulier <msoulier@digitaltorque.ca>2009-04-10 20:54:20 -0400
committerMichael P. Soulier <msoulier@digitaltorque.ca>2009-04-10 23:09:26 -0400
commit5072f6d93c6fe5ba4f215e2fe6d646594714ef50 (patch)
treef8fe30615194022b037ed08be85b1d34e6088e58 /tftpy/TftpClient.py
parente7a63bbbc2752e79b3c6891951b73bb0ebccbb45 (diff)
downloadtftpy-5072f6d93c6fe5ba4f215e2fe6d646594714ef50.tar.gz
Fixed TftpClient with new state machine.
Diffstat (limited to 'tftpy/TftpClient.py')
-rw-r--r--tftpy/TftpClient.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/tftpy/TftpClient.py b/tftpy/TftpClient.py
index 5947367..c5b0c1f 100644
--- a/tftpy/TftpClient.py
+++ b/tftpy/TftpClient.py
@@ -15,11 +15,8 @@ class TftpClient(TftpSession):
self.iport = port
self.filename = None
self.options = options
- self.blocknumber = 0
- self.fileobj = None
- self.timesent = 0
- self.buffer = None
- self.bytes = 0
+ # FIXME: If the blksize is DEF_BLKSIZE, we should just skip sending
+ # it.
if self.options.has_key('blksize'):
size = self.options['blksize']
tftpassert(types.IntType == type(size), "blksize must be an int")
@@ -74,7 +71,7 @@ class TftpClient(TftpSession):
logger.info("Duration too short, rate undetermined")
else:
logger.info('')
- logger.info("Downloaded %d bytes in %d seconds" % (metrics.bytes, metrics.duration))
+ logger.info("Downloaded %.2f bytes in %.2f seconds" % (metrics.bytes, metrics.duration))
logger.info("Average rate: %.2f kbps" % metrics.kbps)
logger.info("Received %d duplicate packets" % metrics.dupcount)