From f4a3ff6356a32485b7c1cf98b188e0886390387e Mon Sep 17 00:00:00 2001 From: "Michael P. Soulier" Date: Mon, 24 May 2010 08:25:49 -0400 Subject: [PATCH] Fixing failure to set default blocksize if options were provided but blksize was not one of them. --- tftpy/TftpStates.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tftpy/TftpStates.py b/tftpy/TftpStates.py index ac464b9..f99d7c9 100644 --- a/tftpy/TftpStates.py +++ b/tftpy/TftpStates.py @@ -408,13 +408,14 @@ class TftpState(object): if not self.context.tidport: self.context.tidport = rport log.info("Setting tidport to %s" % rport) - if not options: - log.debug("Setting default options, blksize") - # FIXME: put default options elsewhere - self.context.options = { 'blksize': DEF_BLKSIZE } - else: + + log.debug("Setting default options, blksize") + self.context.options = { 'blksize': DEF_BLKSIZE } + + if options: log.debug("Options requested: %s" % options) - self.context.options = self.returnSupportedOptions(options) + supported_options = self.returnSupportedOptions(options) + self.context.options.update(supported_options) sendoack = True # FIXME - only octet mode is supported at this time.