Filesize limit on linux wasteserver
Status: Beta
Brought to you by:
sh4rd
It is only possible to upload the first 2 GB of large
files to the wastesrv on linux, furthermore all shared
files larger than 2 GB are shown as much smaller and
you get a file not found when you try to download them
from a client.
Logged In: YES
user_id=225986
Originator: NO
I've been looking at the source code to see what could be producing the 2GB problem. It looks like we are using the function stat to figure out the size of each file (sharedmain.cpp ~ line 702). I believe st_size is pretty much an int and in 32 bit arch, I believe int goes from ~ -2 Billion to 2 Billion (which would give us an upper limit for filesize around 2GB).
I will look to see if I can find a solution for this. Does anyone off the type of their heads have any ideas of how to fix this?
Logged In: YES
user_id=225986
Originator: NO
I have done some research, and from the pages I have read, it looks like we can change stat to stat64 and struct stat to struct stat64 and that should do it. I'll try to work on making these changes and testing them in a linux environment ASAP.
Logged In: YES
user_id=225986
Originator: NO
Changes were made to filedb.cpp to allow usage of length_high (filesize) so that files larger then 2GB-1 can be represented correctly. I changed the code to use stat64 instead of stat. I also make a change to the Makefile so that flags -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES would be set, so that large files will be supported properly. filedb.cpp and Makefile will be send to Eric so he can merge them in with the project.
Logged In: YES
user_id=225986
Originator: NO
the fix for this is located at http://sourceforge.net/tracker/index.php?func=detail&aid=1750667&group_id=82356&atid=565811