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

Comparing cvsroot/Coro/myhttpd/httpd.pl (file contents):
Revision 1.85 by root, Mon Feb 18 17:48:00 2008 UTC vs.
Revision 1.87 by root, Wed Nov 19 11:41:06 2008 UTC

555 }; 555 };
556 556
557 my @code = (200, "ok"); 557 my @code = (200, "ok");
558 my ($l, $h); 558 my ($l, $h);
559 559
560 if ($self->{h}{range} =~ /^bytes=(.*)$/) { 560 if ($self->{h}{range} =~ /^bytes=(.*)$/i) {
561 for (split /,/, $1) { 561 for (split /,/, $1) {
562 if (/^-(\d+)$/) { 562 if (/^-(\d+)$/) {
563 ($l, $h) = ($length - $1, $length - 1); 563 ($l, $h) = ($length - $1, $length - 1);
564 } elsif (/^(\d+)-(\d*)$/) { 564 } elsif (/^(\d+)-(\d*)$/) {
565 ($l, $h) = ($1, ($2 ne "" || $2 >= $length) ? $2 : $length - 1); 565 ($l, $h) = ($1, ($2 ne "" || $2 >= $length) ? $2 : $length - 1);
631 631
632 Coro::AIO::aio_read $fh, $l, ($h > $bufsize ? $bufsize : $h), my $buf, 0 632 Coro::AIO::aio_read $fh, $l, ($h > $bufsize ? $bufsize : $h), my $buf, 0
633 or last; 633 or last;
634 634
635 $tbf->request (length $buf); 635 $tbf->request (length $buf);
636 my $w = syswrite $self->{fh}, $buf 636 my $w = $self->{fh}->syswrite ($buf)
637 or last; 637 or last;
638 $::written += $w; 638 $::written += $w;
639 $self->{written} += $w; 639 $self->{written} += $w;
640 $l += $w; 640 $l += $w;
641 } 641 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines