Fixed the use of the tsize option in RRQ packets.
parent
0a5df33dca
commit
ca7a06a09b
6
README
6
README
|
@ -62,7 +62,7 @@ Purpose:
|
|||
Tftpy is a TFTP library for the Python programming language. It includes
|
||||
client and server classes, with sample implementations. Hooks are included for
|
||||
easy inclusion in a UI for populating progress indicators. It supports RFCs
|
||||
1350, 2347 and 2348.
|
||||
1350, 2347, 2348 and the tsize option from RFC 2349.
|
||||
|
||||
Dependencies:
|
||||
-------------
|
||||
|
@ -81,8 +81,8 @@ Limitations:
|
|||
------------
|
||||
- Server only supports downloads.
|
||||
- Client only supports downloads.
|
||||
- Only 'octet' mode is supported
|
||||
- The only option supported is blksize
|
||||
- Only 'octet' mode is supported.
|
||||
- The only options supported are blksize and tsize.
|
||||
|
||||
Future:
|
||||
-------
|
||||
|
|
|
@ -79,7 +79,7 @@ def main():
|
|||
if options.blocksize:
|
||||
tftp_options['blksize'] = int(options.blocksize)
|
||||
if options.tsize:
|
||||
tftp_options['tsize'] = 1
|
||||
tftp_options['tsize'] = 0
|
||||
|
||||
tclient = tftpy.TftpClient(options.host,
|
||||
int(options.port),
|
||||
|
|
|
@ -151,10 +151,10 @@ class TftpPacketInitial(TftpPacket, TftpPacketWithOptions):
|
|||
if self.options.keys() > 0:
|
||||
logger.debug("there are options to encode")
|
||||
for key in self.options:
|
||||
# Populate the option name
|
||||
format += "%dsx" % len(key)
|
||||
options_list.append(key)
|
||||
# Not all options have values.
|
||||
if key != 'tsize':
|
||||
# Populate the option value
|
||||
format += "%dsx" % len(str(self.options[key]))
|
||||
options_list.append(str(self.options[key]))
|
||||
|
||||
|
|
Reference in New Issue