View Single Post
Old 01-23-2004, 08:08 PM  
Mouton
Posse Member
 
Join Date: Dec 2002
Posts: 1,956
Default ioB zs bug on APPE

I dunno if other zipscripts does same as ioB, so i post public in case other zs authors wanna check their work.

Situation:

client1 sends a file.
ioFTPD has pre_allocation activated to let's say 1024... file size increase by 1024kB during the upload. Say this file is 50MB.

After half the file is sent, client2 list that dir. It sees the file as being 25MB.

client1 finishes sending the 50MB file. file is ok, and zs mark it as good (in it's .race file).

client2, without refreshing the dir list, tries to upload that same file. client2 uses APPE (file resuming).

since client2 thinks the file is 25MB, it will issue a APPE filename command, and will send the content of the file, starting at 25MB...
Resulting file is 75MB and is, u should have guessed, bad.

ioB zs bug: when a file is sent, and marked as ok, subsequent OnUploadComplete events called for that same file, wheter it's good or bad, will result in a "Next time you overwrite a perfectly good file, you'll get your balls ripped off!!!" and the file not being processed.

Harm: just commenting the whole '// Check if that file was already upped and ok..?' section should fix it, since the second call to OnUploadComplete is made with a bad CRC value.

Other ppl: u might wanna put APPE = M and REST = M on your ioFTPD.ini [FTP_Command_Permissions] section... just in case some ppl wanna resume files they send on your site, and u don't want them to... I also changed Upload_PreAllocation back to 0, just as a precaution...
Mouton is offline   Reply With Quote