Always allow uploads if client starts at 0B

This commit is contained in:
Radim Kolar 2009-09-14 18:36:27 +02:00
parent dd63b15fce
commit 26070b103a
2 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,9 @@ Version NEXT
Now if you want to overwrite file you must have permission for
deleting and adding files or be directory owner.
Turning on debug in SCons turns on maintainer mode also.
Upload starting at zero position are now always allowed no matter if
source port was reused or not. Old code did that but not over
server restarts.
Version 2.8.1b25 - 10 Sep 2009
GNU autotools build system was entirely replaced by SCons

View File

@ -833,6 +833,8 @@ const char *server_up_load (char * data, unsigned int len, unsigned long pos,
{
fclose(fp);
unlink(tname);
if ( pos == 0 )
return server_up_load(data, len, pos, inet_num, port_num);
return("Non continuous upload detected. Restart upload please.");
}
/* seek to starting position */
@ -867,6 +869,8 @@ const char *server_up_load (char * data, unsigned int len, unsigned long pos,
{
f_cache_delete_entry(fpcache,cache_f);
unlink(tname);
if ( pos == 0 )
return server_up_load(data, len, pos, inet_num, port_num);
return("Non continuous upload detected. Restart upload please.");
}
if ( pos != sf.st_size )