From 8a9ebd6320907ca943b2630baea33e8ee60e668f Mon Sep 17 00:00:00 2001 From: bustico Date: Thu, 4 Mar 2010 09:37:55 +0000 Subject: fix: an internal table used to send direct message was not updated when application disconnects. --- Ivy.pm | 23 ++++++++++++++++++++--- debian/changelog | 5 +++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Ivy.pm b/Ivy.pm index d64c60f..2ed610f 100644 --- a/Ivy.pm +++ b/Ivy.pm @@ -1883,12 +1883,23 @@ sub _removeFileDescriptor ($$$) # $fd->peerport())); &$fileEventFunc ($fd, '') ; delete $self->[sendRegList]->{$fd}; + delete $self->[sendRegListSrc]->{$fd}; delete $self->[sockList]->{$fd}; delete $self->[bufRecByCnnx]->{$fd}; delete $self->[bufEmiByCnnx]->{$fd}; $fd->close(); + # remove all occurence of fd from $self->[appliList] + foreach my $name (keys %{$self->[appliList]}) { + for (my $i=0; $i < scalar (@{$self->[appliList]{$name}}); $i++) { + my $fdp = $self->[appliList]{$name}->[$i]; + if ($fd eq $fdp) { + delete ($self->[appliList]{$name}->[$i]); + } + } + } + unless (defined $diedAppName) { warn "Ivy::__removeFileDescriptor (called by $callBy) : disconnection of NONAME\n" if $^W; return; @@ -1962,8 +1973,10 @@ TABLE DE REGEXPS : EOF foreach my $appSock (keys %{$self->[sendRegListSrc]}) { -# my $appName = $self->_getNameByFileDes ($appSock); - print $fh "POUR l'application $nameByHandle{$appSock} : \n"; + my $appName = $self->_getNameByFileDes ($appSock); +# my $ap2 = $self->[cnnxion]{$nameByHandle{$appSock}}; +# $ap2 =~ s/^\004//g; + print $fh "POUR l'application ${appName}[$nameByHandle{$appSock}] : \n"; print $fh join ("\n", @{$self->[sendRegListSrc]{$appSock}}); print $fh "\n-----------------------------------\n"; } @@ -2041,6 +2054,10 @@ sub _univSend ($$$) { my ($self, $fd, $msg) = @_; + unless (defined $fd) { + carp "WARN _univSend fd is undefined, message will not be sent\n" if $^W; + afficher la call stack + } my $bufEmiRef = \($self->[bufEmiByCnnx]->{$fd}); my $enCongestion = $$bufEmiRef ? 1 : 0; if (ref $msg) { @@ -2355,7 +2372,7 @@ sub _getNameByFileDes ($$) EXT_LOOP: foreach my $name (keys %{$self->[appliList]}) { foreach my $fdp (@{$self->[appliList]{$name}}) { - if ($fd == $fdp) { + if ($fd eq $fdp) { $appName = $name; last EXT_LOOP; } diff --git a/debian/changelog b/debian/changelog index 83793bb..8c45f14 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,8 @@ +ivy-perl (4.25-11) unstable; urgency=low + + * fix : an internal table used to send direct message was not updated when application disconnects. Add 2 messages on the protocol to permits debug by asking an agent to dump his internal tables. + + -- Alexandre Bustico Mon, 4 march 2010 10:35:00 +0200 ivy-perl (4.25-10) unstable; urgency=low * fix (bad) generation of the paquet for lenny and etch -- cgit v1.1