From e64a3a9cbfdf4456161862fc97d5ead307fddcb0 Mon Sep 17 00:00:00 2001 From: mertz Date: Mon, 10 Jun 2002 09:36:53 +0000 Subject: amélioration de qqs messages d'erruer (pour Ivy::sendDirectMsgs et Ivy::ping) --- Ivy.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Ivy.pm b/Ivy.pm index 4411da9..29f135e 100644 --- a/Ivy.pm +++ b/Ivy.pm @@ -800,7 +800,7 @@ sub sendDirectMsgs my $self = ref($_[0]) eq __PACKAGE__ ? shift : $globalIvy; my ($to, $id, @msgs) = @_; - if (defined ($self->[appliList]{$to})) { + if (defined $to and defined ($self->[appliList]{$to})) { my @fds = @{$self->[appliList]{$to}}; # pour tous les messages foreach my $msg (@msgs) { @@ -812,8 +812,10 @@ sub sendDirectMsgs } } return 1; - } else { - carp "Warning in Ivy::sendDirectMsgs, application $to unknown"; + } + else { + my $to_appli = (defined $to) ? $to : ''; + carp "Warning in Ivy::sendDirectMsgs, application $to_appli unknown"; return 0; } } @@ -838,7 +840,7 @@ sub sendDieTo return 1; } else { - my $to_appli = (defined $to) ? $to : ''; + my $to_appli = (defined $to) ? $to : ''; carp "Warning in Ivy::sendDieTo, application '$to_appli' is unknown" if $^W; return 0; } @@ -851,7 +853,7 @@ sub ping my $self = ref($_[0]) eq __PACKAGE__ ? shift : $globalIvy; my ($to, $timeout) = @_; - if (defined ($self->[appliList]{$to})) { + if (defined $to and defined ($self->[appliList]{$to})) { my @fds = @{$self->[appliList]{$to}}; @@ -861,6 +863,11 @@ sub ping or $self->_removeFileDescriptor ($fd); } } + else { + my $to_appli = (defined $to) ? $to : ''; + carp "Warning in Ivy::ping, application '$to_appli' is unknown" if $^W; + return 0; + } } ############### METHODE MAINLOOP -- cgit v1.1