diff options
-rw-r--r-- | Ivy.pm | 21 | ||||
-rw-r--r-- | debian/changelog | 7 |
2 files changed, 24 insertions, 4 deletions
@@ -881,6 +881,16 @@ sub bindRegexp ($$$;$$) # on rajoute le couple $regexp, $cb dans la liste des messages # qu'on prend + # on teste la validité de l'argument + if (ref ($cb) ne 'ARRAY') { + carp ("Warning binRegexp on $regexp :\nargument 3 (callback) is not correct and will be ignored\n"); + return (); + } + if (ref ($cb->[0]) ne 'CODE') { + carp ("Warning binRegexp on $regexp :\nargument 3 (callback) is not correct and will be ignored\n"); + return (); + } + # on commence par tester si on a un id libere dans le tableau for ($id=0; $id <= ($#{$self->[recCbList]}+1); $id++) { last unless (defined $self->[recCbList][$id]) && @{$self->[recCbList][$id]->[1]}; @@ -891,7 +901,6 @@ sub bindRegexp ($$$;$$) _sendLastRegexpToAllreadyConnected ($self, $id) ; } else { - # on vire le callback, et on se desabonne de cette regexp for (my $id=0; $id <= $#{$self->[recCbList]}; $id++) { @@ -1519,10 +1528,14 @@ sub _getMessages ($$) # on recupere le couple call back, regexp correspondant # a l'identifiant et on appelle la fonction avec les parametres # traites par la regexp - if (ref ($self->[recCbList][$id]) eq 'ARRAY') { - my @cb = @{$self->[recCbList][$id]->[1]}; - my $cb = shift @cb; +# if ((ref ($self->[recCbList][$id]) eq 'ARRAY') && +# (my @cb = @{$self->[recCbList][$id]->[1]})) { + + + if (my @cb = @{$self->[recCbList][$id]->[1]}) { + my $cb = shift @cb; + # cleaning $sendername with previous \004 used for connection status # bindRegexp avancé : on envoie une liste nom adresse port au lieu du nom $senderName = [$senderName, _getHostByAddr ($addr), $peerPort] diff --git a/debian/changelog b/debian/changelog index 3de3cf6..503fb3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ivy-perl (4.25-5) unstable; urgency=low + + * New upstream version: * verify validity callback arg in bindRegexp + instead of verifiying it whell actually calling the callback + + -- Alexandre Bustico <bustico@cena.fr> Wed, 14 Fev 2008 16:43:00 +0200 + ivy-perl (4.25-4) unstable; urgency=low * New upstream version: * verify validity of data structure before using it |