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.20 by root, Thu Aug 16 21:55:35 2001 UTC vs.
Revision 1.21 by root, Fri Aug 17 03:33:00 2001 UTC

76 76
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 => 6, parked => 1,
84 cb => \&Coro::schedule);
82 85
83our %conn; # $conn{ip}{fh} => connobj 86our %conn; # $conn{ip}{fh} => connobj
84our %blocked; 87our %blocked;
85our %mimetype; 88our %mimetype;
86 89
480 } else { 483 } else {
481 aio_read($fh, $l, ($h > $::BUFSIZE ? $::BUFSIZE : $h), 484 aio_read($fh, $l, ($h > $::BUFSIZE ? $::BUFSIZE : $h),
482 $buf, 0, sub { 485 $buf, 0, sub {
483 $r = $_[0]; 486 $r = $_[0];
484 $current->ready; 487 $current->ready;
488 $scheduler->now;
485 }); 489 });
486 &Coro::schedule; 490 &Coro::schedule;
487 last unless $r; 491 last unless $r;
488 } 492 }
489 my $w = $self->{fh}->syswrite($buf) 493 my $w = $self->{fh}->syswrite($buf)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines