PDA

View Full Version : [Fixed] ioB zs bug on APPE


Mouton
01-23-2004, 08:08 PM
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...

Zer0Racer
01-23-2004, 08:26 PM
This is a perfect post I would say. Thanks for quick fix too. :i'm not gonna use the dancing banana:

Mouton
01-23-2004, 08:30 PM
let me just fix vbb settings so ":i'm not gonna use the dancing banana:" shows the banana....

*edit: hahaha seems like ":i'm not g " is the longest possible string for a smilie! :)

Zer0Racer
01-23-2004, 08:36 PM
w00t :eek:

hehehe

Harm
01-24-2004, 03:43 AM
Ok, I will do that.

I thought the uploaded files appear to be 0bytes until the transfer completes (unless you flush the dir cache).

FlashFXP uses the SIZE command before APPE/REST.
Does the wrong answer come from the directory cache ?

Mouton
01-24-2004, 10:15 AM
Could be. Yould have to sniff packets to know what happens exactly. I only know that non-valid files bigger than they should be were marked as valid.

ViNcE
01-25-2004, 04:57 PM
True... i got the same problem with my own sfv checker that will be released soon maybe.. i don't know yet..

But anyway, for my case, the file was 2 time in my race file and ioFTPD told to zipscript that file was complete 2 times.. (and marked as good)

I think the best way is like Mouton said, to disable resuming...

Darkone should show file size in realtime.. that should fix most of the problems... but i dunno if that is possible now with the dir caching...

Anyway guys.. have fun

Bye!