Use double eval for alarms as recommended by DBI(3)
This commit is contained in:
parent
e05d948ac4
commit
36ee1b80c2
|
@ -93,6 +93,9 @@ logLevel = warn
|
||||||
|
|
||||||
[configuration]
|
[configuration]
|
||||||
|
|
||||||
|
; confTimeout: maximum time to get configuration (default 10)
|
||||||
|
;confTimeout = 5
|
||||||
|
|
||||||
; GLOBAL CONFIGURATION ACCESS TYPE
|
; GLOBAL CONFIGURATION ACCESS TYPE
|
||||||
; (File, REST, SOAP, RDBI/CDBI, LDAP, YAMLFile)
|
; (File, REST, SOAP, RDBI/CDBI, LDAP, YAMLFile)
|
||||||
; Set here the parameters needed to access to LemonLDAP::NG configuration.
|
; Set here the parameters needed to access to LemonLDAP::NG configuration.
|
||||||
|
|
|
@ -403,9 +403,12 @@ sub _launch {
|
||||||
my $res;
|
my $res;
|
||||||
eval {
|
eval {
|
||||||
local $SIG{ALRM} = sub { die "TIMEOUT\n" };
|
local $SIG{ALRM} = sub { die "TIMEOUT\n" };
|
||||||
alarm ($self->{confTimeout} || 10);
|
eval {
|
||||||
$res = &{ $self->{type} . "::$sub" }( $self, @_ );
|
alarm( $self->{confTimeout} || 10 );
|
||||||
|
$res = &{ $self->{type} . "::$sub" }( $self, @_ );
|
||||||
|
};
|
||||||
alarm 0;
|
alarm 0;
|
||||||
|
die $@ if $@;
|
||||||
};
|
};
|
||||||
$msg .= $@ if $@;
|
$msg .= $@ if $@;
|
||||||
return $res;
|
return $res;
|
||||||
|
|
|
@ -166,19 +166,23 @@ sub _tie_session {
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
local $SIG{ALRM} = sub { die "TIMEOUT\n" };
|
local $SIG{ALRM} = sub { die "TIMEOUT\n" };
|
||||||
alarm $self->timeout;
|
eval {
|
||||||
|
alarm $self->timeout;
|
||||||
|
|
||||||
# SOAP/REST session module must be directly tied
|
# SOAP/REST session module must be directly tied
|
||||||
if ( $self->storageModule =~ /^Lemonldap::NG::Common::Apache::Session/ )
|
if ( $self->storageModule =~
|
||||||
{
|
/^Lemonldap::NG::Common::Apache::Session/ )
|
||||||
tie %h, $self->storageModule, $self->id,
|
{
|
||||||
{ %{ $self->options }, %$options, kind => $self->kind };
|
tie %h, $self->storageModule, $self->id,
|
||||||
}
|
{ %{ $self->options }, %$options, kind => $self->kind };
|
||||||
else {
|
}
|
||||||
tie %h, 'Lemonldap::NG::Common::Apache::Session', $self->id,
|
else {
|
||||||
{ %{ $self->options }, %$options };
|
tie %h, 'Lemonldap::NG::Common::Apache::Session', $self->id,
|
||||||
}
|
{ %{ $self->options }, %$options };
|
||||||
|
}
|
||||||
|
};
|
||||||
alarm 0;
|
alarm 0;
|
||||||
|
die $@ if $@;
|
||||||
|
|
||||||
};
|
};
|
||||||
if ( $@ or not tied(%h) ) {
|
if ( $@ or not tied(%h) ) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user