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.93 by root, Sun Mar 21 00:21:14 2010 UTC vs.
Revision 1.94 by root, Sat Aug 13 23:42:05 2011 UTC

1use AnyEvent ();
2
1use Coro; 3use Coro;
2use Coro::Semaphore; 4use Coro::Semaphore;
3use Coro::SemaphoreSet; 5use Coro::SemaphoreSet;
4use Coro::EV; 6use Coro::EV;
5use Coro::Socket; 7use Coro::Socket;
136 138
137use Socket; 139use Socket;
138use HTTP::Date; 140use HTTP::Date;
139use Convert::Scalar 'weaken'; 141use Convert::Scalar 'weaken';
140use IO::AIO; 142use IO::AIO;
143use AnyEvent::AIO;
141 144
142IO::AIO::min_parallel $::AIO_PARALLEL; 145IO::AIO::min_parallel $::AIO_PARALLEL;
143
144our $AIO_WATCHER = EV::io IO::AIO::poll_fileno, EV::READ, \&IO::AIO::poll_cb;
145 146
146our %conn; # $conn{ip}{self} => connobj 147our %conn; # $conn{ip}{self} => connobj
147our %uri; # $uri{ip}{uri}{self} 148our %uri; # $uri{ip}{uri}{self}
148our %blocked; 149our %blocked;
149our %mimetype; 150our %mimetype;
209 for (keys %blocked) { 210 for (keys %blocked) {
210 delete $blocked{$_} unless $blocked{$_}[0] > $::NOW; 211 delete $blocked{$_} unless $blocked{$_}[0] > $::NOW;
211 } 212 }
212} 213}
213 214
214our $PRUNE_WATCHER = EV::timer 60, 60, \&prune_caches; 215our $PRUNE_WATCHER = AE::timer 60, 60, \&prune_caches;
215 216
216sub slog { 217sub slog {
217 my $self = shift; 218 my $self = shift;
218 main::slog($_[0], "$self->{remote_id}> $_[1]"); 219 main::slog($_[0], "$self->{remote_id}> $_[1]");
219} 220}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines