Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set correct tsize option in server OACK when negotiating download #50

Merged
merged 2 commits into from
Oct 15, 2015
Merged

set correct tsize option in server OACK when negotiating download #50

merged 2 commits into from
Oct 15, 2015

Conversation

zgyarmati
Copy link
Contributor

Small patch, fixes
TftpServer reports incorrect tsize #45
please feel free to review and comment

@msoulier
Copy link
Owner

This looks like it's always going to send an oack with a tsize whether the client requested that option or not.

@zgyarmati
Copy link
Contributor Author

Hm, true, i didn't consider this (in my usecase the client always sends tsize...). Will add and test this later today and resend, thanks!

@msoulier
Copy link
Owner

msoulier commented Jun 7, 2015

Did you get around to updating this? Otherwise I'll look at it.

@zgyarmati
Copy link
Contributor Author

Thanks for pinging me, i pushed a fix, please feel free to comment

@msoulier
Copy link
Owner

Patch looks good. I just need to add a testcase for it.

@msoulier
Copy link
Owner

Hmm. New test cases are failing.

ERROR: testClientServerUploadTsize (main.TestTftpyState)

Traceback (most recent call last):
File "t/test.py", line 228, in testClientServerUploadTsize
self.clientServerUploadOptions({'tsize': 64*1024}, transmitname='/foo/bar/640KBFILE')
File "t/test.py", line 166, in clientServerUploadOptions
input)
File "/Users/msoulier/work/tftpy/tftpy/TftpClient.py", line 86, in upload
self.context.start()
File "/Users/msoulier/work/tftpy/tftpy/TftpContexts.py", line 298, in start
self.cycle()
File "/Users/msoulier/work/tftpy/tftpy/TftpContexts.py", line 190, in cycle
self.state = self.state.handle(recvpkt, raddress, rport)
File "/Users/msoulier/work/tftpy/tftpy/TftpStates.py", line 492, in handle
self.handleOACK(pkt)
File "/Users/msoulier/work/tftpy/tftpy/TftpStates.py", line 37, in handleOACK
if pkt.match_options(self.context.options):
File "/Users/msoulier/work/tftpy/tftpy/TftpPacketTypes.py", line 440, in match_options
raise TftpException, "Unsupported option: %s" % name
TftpException: Unsupported option: tsize

@msoulier msoulier merged commit 971076a into msoulier:master Oct 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants