ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/myhttpd/httpd.pl
(Generate patch)

Comparing Coro/myhttpd/httpd.pl (file contents):
Revision 1.32 by root, Wed Aug 29 01:32:50 2001 UTC vs.
Revision 1.33 by root, Wed Aug 29 01:40:44 2001 UTC

6use HTTP::Date; 6use HTTP::Date;
7 7
8no utf8; 8no utf8;
9use bytes; 9use bytes;
10 10
11our @wait_time = (0); # used to calculcate avg. waiting time 11our @wait_time = (); # used to calculcate avg. waiting time
12our $wait_time_length = 25;
12 13
13# at least on my machine, this thingy serves files 14# at least on my machine, this thingy serves files
14# quite a bit faster than apache, ;) 15# quite a bit faster than apache, ;)
15# and quite a bit slower than thttpd :( 16# and quite a bit slower than thttpd :(
16 17
485 486
486 my $transfer = $::transfers->guard; 487 my $transfer = $::transfers->guard;
487 $self->{fh}->writable or return; 488 $self->{fh}->writable or return;
488 489
489 push @::wait_time, $::NOW - $self->{time}; 490 push @::wait_time, $::NOW - $self->{time};
490 shift @::wait_time if @wait_time > 25; 491 shift @::wait_time if @wait_time > $wait_time_length;
491 $self->{time} = $::NOW; 492 $self->{time} = $::NOW;
492 493
493 my ($fh, $buf, $r); 494 my ($fh, $buf, $r);
494 my $current = $Coro::current; 495 my $current = $Coro::current;
495 open $fh, "<", $self->{path} 496 open $fh, "<", $self->{path}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines