[Twisted-Python] dcc, idea for file resume

peter commercials24 at yahoo.de
Wed Oct 21 10:31:08 MDT 2015


On 10/13/2015 02:51 AM, Glyph Lefkowitz wrote:
>
>> On Oct 12, 2015, at 11:01 AM, peter <commercials24 at yahoo.de 
>> <mailto:commercials24 at yahoo.de>> wrote:
>>
>> hi,
>>
>>
>> the way file resume is implemented in DccFileReceive requires to user 
>> to determine the file size manually and set _resumeOffset.
>> wouldnt it make sene to just kill the last few bytes of the file and 
>> resume it?
>>
>> below is the current connectionMade method from:
>> http://twistedmatrix.com/trac/browser/tags/releases/twisted-15.4.0/twisted/words/protocols/irc.py#L3013
>>
>>
>> replace this line:
>> self.file.seek(self._resumeOffset)
>>
>> with:
>> self.file.seek(-3,2)
>>
>>
>> which removes the last 3 bytes from the file end, 3 is just a guess.
>
> Why remove the last 3 bytes?  It seems like either the file's contents 
> are valid or not; if they are, just trust everything that's there, if 
> not, don't try to resume...
>
> Generally though this does sound like a good change!  Don't make the 
> user guess if we can just do the right thing for them.  Can you open a 
> ticket?
>
> -glyph
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python



sorry for the late reply, missed the message.
sure i will.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20151021/dcc447c0/attachment-0002.html>


More information about the Twisted-Python mailing list