summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ivy.pm17
1 files 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