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.22 by root, Fri Aug 17 04:10:38 2001 UTC vs.
Revision 1.23 by root, Sat Aug 18 02:58:38 2001 UTC

77Linux::AIO::min_parallel $::AIO_PARALLEL; 77Linux::AIO::min_parallel $::AIO_PARALLEL;
78 78
79Event->io(fd => Linux::AIO::poll_fileno, 79Event->io(fd => Linux::AIO::poll_fileno,
80 poll => 'r', async => 1, 80 poll => 'r', async => 1,
81 cb => \&Linux::AIO::poll_cb); 81 cb => \&Linux::AIO::poll_cb);
82my $scheduler = Event->idle(
83 max => 0, min => 0, prio => 4, parked => 1,
84 cb => \&Coro::schedule);
85 82
86our %conn; # $conn{ip}{fh} => connobj 83our %conn; # $conn{ip}{fh} => connobj
87our %blocked; 84our %blocked;
88our %mimetype; 85our %mimetype;
89 86
483 } else { 480 } else {
484 aio_read($fh, $l, ($h > $::BUFSIZE ? $::BUFSIZE : $h), 481 aio_read($fh, $l, ($h > $::BUFSIZE ? $::BUFSIZE : $h),
485 $buf, 0, sub { 482 $buf, 0, sub {
486 $r = $_[0]; 483 $r = $_[0];
487 $current->ready; 484 $current->ready;
488 $scheduler->now;
489 }); 485 });
490 &Coro::schedule; 486 &Coro::schedule;
491 last unless $r; 487 last unless $r;
492 } 488 }
493 my $w = $self->{fh}->syswrite($buf) 489 my $w = $self->{fh}->syswrite($buf)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines