Just a
follow-up on the performance issue that we were experiencing. Someone had
enabled IdentityChecks in Apache's httpd.conf file and some of our clients were
behind firewalls and would cause up to a 30 delay per request... It's documented
in the apache docs.
::::: ad2, Inc.
::::: 2118 Wilshire Blvd # 205
::::: Santa Monica, CA 90403
::::: 2118 Wilshire Blvd # 205
::::: Santa Monica, CA 90403
-----Original Message-----
From: John Brahy [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 2:24 PM
To: 'Modperl List'
Subject: Performance Issues with mod_perl's PerlAccessHandlerHello,We're experiencing problems with an authentication handler I wrote. I probably did something wrong when I wrote it.Apache 1.3.27mod_perl mod_perl/1.26I know I'm not running the latest versions, if you think that is the problem I will upgrade.in .htaccess I have: ad2::Extranet::Authenticatewhich refers to:
sub handler {
my $r = shift;
my $uri = $r->uri;
my $ticket = &getTicket($r);
my $validTicket = &isValidTicket($dbh,$ticket);
if ($validTicket){
my $allowedURI = &isAllowedURI($dbh,$ticket,$uri);
if ($allowedURI){
&updateTicket($dbh,$ticket);
return OK;
} else {
$r->content_type('text/html');
&reportError($dbh,"Unauthorized Access",$ticket,$r);
$r->header_out(Location => 'http://www.ad2.com/login/index.ad2');
return REDIRECT;
}
} else {
my $expiredString = "";
my $inactiveTime = &getInactiveSpanForTicket($dbh,$ticket);
$r->content_type('text/html');
if ($inactiveTime < 60) {
$expiredString = " $inactiveTime seconds ";} else {
my $minutes = int($inactiveTime / 60);
my $seconds = $inactiveTime % 60;
$expiredString = " $minutes minutes and $seconds seconds";
}
&reportError($dbh,"Ticket has been expired for $expiredString ",$ticket,$r);
$r->header_out(Location => 'http://www.ad2.com/login/index.ad2?error=expired_session&expiredURL=' . $uri);
return REDIRECT;
}$r->content_type('text/html');
&reportError($dbh,"Expired",$ticket,$r);
$r->header_out(Location => 'http://www.ad2.com/login/index.ad2');
return REDIRECT;
}
sub getTicket {
my ($r) = @_;
my %cookies = CGI::Cookie->parse($r->header_in('Cookie'));
if (defined $cookies{'Ticket'}){
return $cookies{'Ticket'}->value;
}
}Thanks in advance for any assistance.John::::: ad2, Inc.
::::: 2118 Wilshire Blvd # 205
::::: Santa Monica, CA 90403