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.72 by root, Tue Sep 10 03:08:03 2002 UTC vs.
Revision 1.73 by root, Sat Oct 5 09:02:17 2002 UTC

193sub DESTROY { 193sub DESTROY {
194 #my $self = shift; 194 #my $self = shift;
195 $::conns--; 195 $::conns--;
196} 196}
197 197
198sub prune_cache {
199 my $hash = $_[0];
200
201 for (keys %$hash) {
202 if (ref $hash->{$_} eq HASH::) {
203 prune_cache($hash->{$_});
204 unless (scalar keys %{$hash->{$_}}) {
205 delete $hash->{$_};
206 $d2++;
207 }
208 }
209 }
210}
211
212sub prune_caches {
213 prune_cache \%conn;
214 prune_cache \%uri;
215
216 for (keys %blocked) {
217 delete $blocked{$_} if $blocked{$_}[0] > $::NOW;
218 }
219}
220
221Event->timer(interval => 60, cb => \&prune_caches);
222
198sub slog { 223sub slog {
199 my $self = shift; 224 my $self = shift;
200 main::slog($_[0], "$self->{remote_id}> $_[1]"); 225 main::slog($_[0], "$self->{remote_id}> $_[1]");
201} 226}
202 227

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines