diff options
author | bustico | 2010-03-04 09:37:55 +0000 |
---|---|---|
committer | bustico | 2010-03-04 09:37:55 +0000 |
commit | 8a9ebd6320907ca943b2630baea33e8ee60e668f (patch) | |
tree | 9e6a7b9b02d4c3a0a1a725af378832c89ee6640b /Ivy.pm | |
parent | 2f351fab323bdae9b7d3e73bf8b0ea6b1ce1a1a0 (diff) | |
download | ivy-perl-8a9ebd6320907ca943b2630baea33e8ee60e668f.zip ivy-perl-8a9ebd6320907ca943b2630baea33e8ee60e668f.tar.gz ivy-perl-8a9ebd6320907ca943b2630baea33e8ee60e668f.tar.bz2 ivy-perl-8a9ebd6320907ca943b2630baea33e8ee60e668f.tar.xz |
fix: an internal table used to send direct message was not updated when application disconnects.
Diffstat (limited to 'Ivy.pm')
-rw-r--r-- | Ivy.pm | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -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; } |