Swap out Net::Subnets for Net::CIDR::Lite in PerformanceProfiler.

This commit is contained in:
Colin Kuskie 2010-03-17 13:25:04 -07:00
parent 570cdfd9f5
commit e77b2b9722

View file

@ -64,7 +64,7 @@ use Apache2::FilterRec;
use Apache2::RequestIO; use Apache2::RequestIO;
use Apache2::RequestRec; use Apache2::RequestRec;
use ModPerl::Util; use ModPerl::Util;
use Net::Subnets; use Net::CIDR::Lite;
my @subTimes = (); my @subTimes = ();
my $depth = 0; my $depth = 0;
@ -128,13 +128,11 @@ sub output {
return Apache2::Const::DECLINED unless($f->r->content_type =~ 'text/html'); return Apache2::Const::DECLINED unless($f->r->content_type =~ 'text/html');
my $server = Apache2::ServerUtil->server; my $server = Apache2::ServerUtil->server;
my $sn = $server->dir_config('ProfileSubnet'); my $sn = $server->dir_config('ProfileSubnet');
my $subnet = [ $sn ];
if ($sn) { if ($sn) {
my $conn = $f->c; my $conn = $f->c;
my $ipAddress = $conn->remote_ip; my $ipAddress = $conn->remote_ip;
my $net = Net::Subnets->new(); my $net = Net::CIDR::Lite->new($sn);
$net->subnets($subnet); if (!$net->find($ipAddress)) {
if (!$net->check(\$ipAddress)) {
return Apache2::Const::DECLINED; return Apache2::Const::DECLINED;
} }
} }