From 70c6ad5dfce33cb7d1cc11e342e5fa706c8fca6a Mon Sep 17 00:00:00 2001 From: etienne Date: Wed, 24 Jan 2007 15:13:12 +0000 Subject: * a new command (ivyreplay) is dedicated to replay. ivymon does not provide this functionality anymore. * fixed a bug causing the clients bindings list to be empty when ivy version >= 4.18. * removed additional space char in list of messages to send. --- src/ivymon | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ivymon b/src/ivymon index 8e584d1..4d7ccc5 100755 --- a/src/ivymon +++ b/src/ivymon @@ -1032,6 +1032,7 @@ sub removeIvyBinding { # Functions related to connected applications management #---------------------------------------------------------------------------------- sub checkClientsStatus { + my $appname = $_[3]; my $status = $_[4]; my $host; @@ -1046,16 +1047,18 @@ sub checkClientsStatus { $host = $_[5]; $regexp = $host; } + $host =~ s/:.*//; + print "status=$status host=$host regexp=$regexp\n"; $appname =~ s/ /_/g; if ($status eq 'died') { &removeClient($appname, $host); } elsif ($status eq 'new') { &addClient($appname, $host); } elsif ($status eq 'subscribing') { - $clientsBindings{$appname}->{$host}++; - &newBinding($regexp); + $clientsBindings{$appname}->{$regexp}++; + &addBindingAndMsgToSend($regexp); } elsif ($status eq 'unsubscribing') { - $clientsBindings{$appname}->{$host}--; + $clientsBindings{$appname}->{$regexp}--; } else { carp "In Ivymon, checkClientsStatus function, unknown status <$status>\n"; } @@ -1239,7 +1242,7 @@ sub showClientBindings { $t->tagConfigure('1', -background => '#e5e5e5'); my $i = 0; for my $regexp (sort keys(%{$clientsBindings{$client}})) { - print "client=$client regexp=$regexp\n"; + #print "client=$client regexp=$regexp\n"; $t->insert('end', $regexp."\n", $i % 2) if $clientsBindings{$client}->{$regexp} > 0; $i++; @@ -1515,7 +1518,7 @@ sub addBindingInList { # add a binding in the bindings list and, after some modifications, # add a new message in the list of messages to send. -sub newBinding { +sub addBindingAndMsgToSend { my $regexp = shift; return if $regexp eq '(.*)'; @@ -1567,8 +1570,15 @@ sub newBinding { &addMsgToSend(undef, $msg); } -} # end newBinding +} # end addBindingAndMsgToSend + + +sub removeBindingAndMsgToSend { + + my $regexp = shift; + my $host = shift; +} # end removeBindingAndMsgToSend sub selectBinding { -- cgit v1.1