XFileSharing Free - my download is limited
my download is limited
After i installed the script my download was limited by the script.. when i pus a file to download without script i download with 11 mb/sec but when i upload a file with the script my download is limited at 600 kb/sec
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Also try this quick hack: in upload.cgi replace subfunction "sub hook {...}"
with new one:
with new one:
Code: Select all
sub hook
{
my ($fname, $buffer) = @_;
my $buff_size = length($buffer);
$current_bytes+=$buff_size;
$time = time;
$time_spent = $time - $time_start;
my ($changed,$nf);
if($fname_old ne $fname || $buff_old<$buff_size)
{
$files_uploaded++ if $fname_old;
$fname_old=$fname;
my $fsize = $current_bytes-$total_old;
$total_old=$current_bytes;
$nf = "file_uploaded:$files_uploaded:$fsize\n";
}
$buff_old = $buff_size;
if($time>$old_time)
{
$speed = int( ($current_bytes-$old_size)/($time-$old_time) );
$old_size = $current_bytes;
$old_time = $time;
$changed=1;
}
if($changed || $nf)
{
open F,"$temp_dir/flength";
my @arr = <F>;
close F;
$arr[0] = "$ENV{CONTENT_LENGTH}:$current_bytes:$time_spent:$speed:$files_uploaded\n";
push(@arr, $nf) if $nf;
open F,"+< $temp_dir/flength" or die"Can't open flength";
flock F, LOCK_EX or die"Can't lock flength";
truncate F, 0;
print F @arr;
close F;
}
}