You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice that the tftpclient could be used to download a file into memory (IOStrings). I did a quick and dirty method for TFTPClient:
defgetAsIOString(self, filepath):
""" zieht das file in einen String """self.PTFTP_STATE=state.TFTPState(self.peer, proto.OP_RRQ,
'', filepath, self.transfer_mode, notself.rfc1350)
self.PTFTP_STATE.file=StringIO.StringIO()
self.PTFTP_STATE.packetnum=1self.PTFTP_STATE.state=state.STATE_RECVopts=dict(self.opts)
# When not running in RFC1350 compliance mode, append tsize: 0# to the list of options in the request to get the requested# file size back in the OACK.ifnotself.rfc1350:
opts[proto.TFTP_OPTION_TSIZE] =0packet=proto.TFTPHelper.createRRQ(filepath, self.transfer_mode, opts)
self.sock.sendto(packet, self.peer)
self.handle()
ifself.error:
error, errmsg=self.errorraiseIOError('Downloading failed (%r, %r)'% (error, errmsg))
returnself.PTFTP_STATE.file
But that only works if I remove the close() functions in state.py. But as I'm not that deep into that code I don't know what that breaks.
The text was updated successfully, but these errors were encountered:
It would be nice that the tftpclient could be used to download a file into memory (IOStrings). I did a quick and dirty method for TFTPClient:
But that only works if I remove the close() functions in state.py. But as I'm not that deep into that code I don't know what that breaks.
The text was updated successfully, but these errors were encountered: