Swap out Net::Subnets for Net::CIDR::Lite in PerformanceProfiler.
This commit is contained in:
parent
570cdfd9f5
commit
e77b2b9722
1 changed files with 3 additions and 5 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue