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

Comparing cvsroot/Coro/myhttpd/access.pl (file contents):
Revision 1.9 by root, Tue Aug 28 02:30:48 2001 UTC vs.
Revision 1.31 by root, Thu Nov 21 09:52:34 2002 UTC

56 56
57read_blockuri; 57read_blockuri;
58read_blockref; 58read_blockref;
59 59
60use Tie::Cache; 60use Tie::Cache;
61tie %whois_cache, Tie::Cache::, $::MAX_CONNECTS * 1.5; 61tie %whois_cache, Tie::Cache::, 32;
62 62
63sub access_check { 63sub access_check {
64 my $self = shift; 64 my $self = shift;
65 65
66 my $ref = $self->{h}{referer}; 66 my $ref = $self->{h}{referer};
68 my %disallow; 68 my %disallow;
69 69
70 $self->err_block_referer 70 $self->err_block_referer
71 if $self->{h}{referer} =~ $blockref; 71 if $self->{h}{referer} =~ $blockref;
72 72
73 my $whois = $whois_cache{$self->{remote_addr}} 73 my $ra = $self->{remote_addr};
74 ||= netgeo::ip_request($self->{remote_addr}); 74 my $whois = $whois_cache{$ra} ||= netgeo::ip_request($ra);
75 75
76 my $country = "XX"; 76 my $country = "XX";
77 77
78 if ($whois =~ /^\*cy: (\S+)/m) { 78 if ($whois =~ /^\*cy: (\S+)/m) {
79 $country = uc $1; 79 $country = uc $1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines