PDA

View Full Version : invalid FileSize reported


andreas
12-29-2011, 07:08 AM
I am transferring some big files using flashfxp and 3cdaemon FTP (not tftp).

The wrong file size reported appear to the image attached.

The actual filesize is:
archive1: 4.41 GB (4,741,809,152 bytes)
archive: 2.28 GB (2,452,177,920 bytes)

Is this reported incorrectly from 3cdaemon?!

FlashFxp verion : 4.1.7.1688
3cdaemon version v2.0.10

andreas
12-29-2011, 07:32 AM
Using filezilla ftp server is reported correctly.
hence it seems to be a problem with 3cdaemon

bigstar
12-29-2011, 11:14 AM
I have determined that 3cdaemon FTP is not correctly reporting file sizes larger than 2,147,483,647 bytes. The size is being stored as a 32bit integer by 3cdaemon and the value is wrapping around for example a file with a size of 3,466,795,008 bytes is being reported as -828,172,288 bytes.

FlashFXP fully supports 64bit file sizes but this also requires the FTP server to support 64bit file sizes.

I've been exploring different ways to partially overcome this issue by unwrapping the size when its a negative value and this appears to work when the real file size is less than 4,294,967,295 bytes.

However there are still some limitations that cannot be overcome by a partial fix, such as resuming the file with an offset greater than 2,147,483,646 bytes.

In my tests with 3cdaemon FTP I was able to crash the server by requesting a resume offset of 2,147,483,647 and then attempting to download the file.

andreas
12-29-2011, 12:34 PM
3cdaemon is 11 years old... This problem,as you said, has to do with 32bit variables; its a classic problem reported to various applications today.

Resuming after 32bit value max (2,147,483,646) isnt going to work...
However, I think I faced problem when trying to resume even after downloading 10 or 20 mbytes....


Moreover, i monitored a strange behavior. Local path is not refreshed (local size remains to 0 mbyte although I have downloaded more than 200mbyte!!). I had to stop downloading and then refresh local directory to get updated!

bigstar
12-29-2011, 04:25 PM
Moreover, i monitored a strange behavior. Local path is not refreshed (local size remains to 0 mbyte although I have downloaded more than 200mbyte!!). I had to stop downloading and then refresh local directory to get updated!

During a download FlashFXP no longer updates the file size in the local browser window, we determined that constantly updating the file size adds unnecessary disk access and cpu overhead.

In order for the Windows OS/Shell to see the updated size; the file must be flushed to disk forcing the OS to write the data to the storage device. This can also create a botteneck limiting the maximum throughput speed by as much as 50%.

andreas
12-29-2011, 04:41 PM
Yes, but I prefer to save data to the disk and be safe than sorry later...

What is going to happen if I download a 4GB file with 30kb/sec speed limit and my PC shut down at 80%? Is any way to alter the default behavior? (No option at Options --> Transfer menu)

bigstar
01-21-2012, 03:11 PM
This doesn't effect the data being written to the disk, only what is reported in FlashFXP and in the windows shell. The cached information is used vs requesting the info again from the storage device.

Right-click on the file in the file list and select Properties (displaying the properties dialog queries the storage device for the file size) and as a result this will update the size reported in FlashFXP.