Commit 200546b2 authored by Christophe Maudoux's avatar Christophe Maudoux 🐛

Fix logger

parent 32a0d094
......@@ -14,7 +14,7 @@ use strict;
use Cache::Memcached;
use Apache::Session::Generate::MD5;
our $VERSION = '2.0.6';
our $VERSION = '2.0.7';
# Shared variables
our $secureTokenMemcachedConnection;
......@@ -32,7 +32,7 @@ BEGIN {
# @return Apache2::Const value ($class->OK, $class->FORBIDDEN, $class->REDIRECT or $class->SERVER_ERROR)
sub run {
my $class = shift;
my $r = $_[0];
my $r = shift;
my ( $ret, $session ) = $class->Lemonldap::NG::Handler::Main::run($r);
# Continue only if user is authorized
......@@ -150,9 +150,7 @@ sub _createMemcachedConnection {
# @return Token key
sub _setToken {
my ( $class, $value, $secureTokenExpiration ) = @_;
my $key = Apache::Session::Generate::MD5::generate();
my $res =
$secureTokenMemcachedConnection->set( $key, $value,
$secureTokenExpiration );
......@@ -173,7 +171,6 @@ sub _setToken {
# @return result
sub _deleteToken {
my ( $class, $key ) = @_;
my $res = $secureTokenMemcachedConnection->delete($key);
unless ($res) {
......@@ -192,16 +189,13 @@ sub _deleteToken {
# @return result
sub _isAlive {
my ($class) = @_;
return 0 unless defined $secureTokenMemcachedConnection;
my $stats = $secureTokenMemcachedConnection->stats();
if ( $stats and defined $stats->{'total'} ) {
my $total_c = $stats->{'total'}->{'connection_structures'};
my $total_i = $stats->{'total'}->{'total_items'};
$class->logger->debug->(
$class->logger->debug(
"Memcached connection is alive ($total_c connections / $total_i items)"
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment