fixed the 'ever lengthening msg' syndrome and probably made the whole
authorminima <minima>
Tue, 2 Oct 2001 13:52:04 +0000 (13:52 +0000)
committerminima <minima>
Tue, 2 Oct 2001 13:52:04 +0000 (13:52 +0000)
thing more reliable at the same time.

Changes
cmd/stat/msg.pl
perl/DXMsg.pm

diff --git a/Changes b/Changes
index ef6a225f34aa6774cc7fee0a9a2af120321c9ce6..e10e1b04121fe42479de88c9ca278681c74f6ed5 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+02Oct01=======================================================================
+1. fixed the 'ever lengthening msg' syndrome and probably made the whole
+thing more reliable at the same time.
 01Oct01=======================================================================
 1. made login info not the default
 2. change the looping protoection for PC16/17/19/21 and also be more rigorous
index 2b937d81f1db2633e5bb51310a5fde04afe1c6fe..57eccca4293aea042bb48039e27863bc5890f3ca 100644 (file)
@@ -13,7 +13,7 @@ return (1, $self->msg('e5')) if $self->priv < 1;
 if (@list == 0) {
        my $ref;
        push @out, "Work Queue Keys";
-       push @out, map { " $_" } sort keys %DXMsg::work;
+       push @out, map { " $_" } sort DXMsg::get_all_fwq();
        push @out, "Busy Queue Data";
        foreach $ref (sort {$a->to cmp $b->to} DXMsg::get_all_busy) {
                my $msgno = $ref->msgno;
@@ -24,10 +24,11 @@ if (@list == 0) {
                my $count = $ref->count;
                my $to = $ref->to;
                my $from = $ref->from;
+               my $tonode = $ref->tonode;
                my $lastt = $ref->lastt ? " Last Processed: " . cldatetime($ref->lastt) : "";
                my $waitt = $ref->waitt ? " Waiting since: " . cldatetime($ref->waitt) : "";
                
-               push @out, "$from -> $to msg: $msgno stream: $stream Count: $count Lines: $lines$lastt$waitt";
+               push @out, " $tonode: $from -> $to msg: $msgno stream: $stream Count: $count Lines: $lines$lastt$waitt";
        }
 } else {
        foreach my $msgno (@list) {
index 24e4d6be1b560da60bee5f78b8cf43f42dd1f927..e3ea16ad4d7fb672ddce392ad6b2f3d5a40b8b07 100644 (file)
@@ -636,12 +636,8 @@ sub queue_msg
                my $dxchan;
                if ($ref->{private}) {
                        next if $ref->{'read'};           # if it is read, it is stuck here
+                       next if $ref->{tonode};           # ignore it if it already being processed
                        $clref = Route::get($ref->{to});
-#                      unless ($clref) {             # otherwise look for a homenode
-#                              my $uref = DXUser->get_current($ref->{to});
-#                              my $hnode =  $uref->homenode if $uref;
-#                              $clref = Route::Node::get($hnode) if $hnode;
-#                      }
                        if ($clref) {
                                $dxchan = $clref->dxchan;
                                if ($dxchan) {
@@ -666,6 +662,7 @@ sub queue_msg
                                next if $call eq $main::mycall;
                                next if ref $ref->{gotit} && grep $_ eq $call, @{$ref->{gotit}};
                                next unless $ref->forward_it($call);           # check the forwarding file
+                               next if $ref->{tonode};           # ignore it if it already being processed
                                
                                # if we are here we have a node that doesn't have this message
                                if (!get_busy($call)  && $dxchan->state eq 'normal') {
@@ -700,6 +697,7 @@ sub start_msg
 {
        my ($self, $dxchan) = @_;
        
+       confess("trying to start started msg $self->{msgno} nodes: $self->{fromnode} -> $self->{tonode}") if $self->{tonode};
        dbg("start msg $self->{msgno}\n") if isdbg('msg');
        $self->{linesreq} = 10;
        $self->{count} = 0;
@@ -724,13 +722,37 @@ sub get_busy
 # get the busy queue
 sub get_all_busy
 {
-       return values %busy;
+       return keys %busy;
 }
 
-# get the forwarding queue
+# get a forwarding queue entry
 sub get_fwq
 {
-       return values %work;
+       my $call = shift;
+       my $stream = shift || '0';
+       return $work{"$call,$stream"};
+}
+
+# delete a forwarding queue entry
+sub del_fwq
+{
+       my $call = shift;
+       my $stream = shift || '0';
+       return delete $work{"$call,$stream"};
+}
+
+# set a fwq entry
+sub set_fwq
+{
+       my $call = shift;
+       my $stream = shift || '0';
+       return $work{"$call,$stream"} = shift;
+}
+
+# get the whole forwarding queue
+sub get_all_fwq
+{
+       return keys %work;
 }
 
 # stop a message from continuing, clean it out, unlock interlocks etc