]> dxcluster.net Git - spider.git/commitdiff
1. fixed a problem with DXLogPrint repeating log entries.
authordjk <djk>
Fri, 18 Jun 1999 14:12:01 +0000 (14:12 +0000)
committerdjk <djk>
Fri, 18 Jun 1999 14:12:01 +0000 (14:12 +0000)
2. altered the permissions on disconnnect so that priv 5 users can disconnect
clusters, but still require priv 8 to disconnect users.
3. made sure that an incoming PC18 clears out all the cluster info for
that channel before re-initialising.
4. add init command.
5. disconnect users before nodess on shutdown

Changes
cmd/disconnect.pl
cmd/forward/mail.pl [new file with mode: 0644]
cmd/init.pl [new file with mode: 0644]
cmd/show/log.pl
perl/DXLogPrint.pm
perl/DXProt.pm
perl/Messages
perl/cluster.pl

diff --git a/Changes b/Changes
index 17d937a782e21f1eee33e9e0556198f8a2a53141..3fd33ec3a67d6e9e49a024ac6b2f7cc89b1345b5 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,11 @@
+18Jun99=======================================================================
+1. fixed a problem with DXLogPrint repeating log entries.
+2. altered the permissions on disconnnect so that priv 5 users can disconnect
+clusters, but still require priv 8 to disconnect users.
+3. made sure that an incoming PC18 clears out all the cluster info for
+that channel before re-initialising.
+4. add init command.
+5. disconnect users before nodess on shutdown
 15Jun99=======================================================================
 1. added grepdbg program (so you can search your debug files and get times
 and dates of incidents).
index e8e83b89c4778f18f5c730e7c5c2d858dd9a1236..02f9f45cf3088ea8c17ed1f8ba32b7364706e00b 100644 (file)
@@ -6,25 +6,26 @@ my @calls = split /\s+/, $line;
 my $call;
 my @out;
 
-if ($self->priv < 8) {
-  return (1, $self->msg('e5'));
+if ($self->priv < 5) {
+       return (1, $self->msg('e5'));
 }
 
 foreach $call (@calls) {
-  $call = uc $call;
-  next if $call eq $main::mycall;
-  my $dxchan = DXChannel->get($call);
-  if ($dxchan) {
-    if ($dxchan->is_ak1a) {
-      $dxchan->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', $self->call)));
-    } else {
-         $dxchan->send_now('D', $self->msg('disc1', $self->call));
-       } 
-    $dxchan->disconnect;
-       push @out, $self->msg('disc2', $call);
-  } else {
-    push @out, $self->msg('e10', $call);
-  }
+       $call = uc $call;
+       next if $call eq $main::mycall;
+       my $dxchan = DXChannel->get($call);
+       if ($dxchan) {
+               if ($dxchan->is_ak1a) {
+                       $dxchan->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', $self->call)));
+               } else {
+                       return (1, $self->msg('e5')) if $self->priv < 8;
+                       $dxchan->send_now('D', $self->msg('disc1', $self->call));
+               } 
+               $dxchan->disconnect;
+               push @out, $self->msg('disc2', $call);
+       } else {
+               push @out, $self->msg('e10', $call);
+       }
 }
 
 return (1, @out);
diff --git a/cmd/forward/mail.pl b/cmd/forward/mail.pl
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/cmd/init.pl b/cmd/init.pl
new file mode 100644 (file)
index 0000000..bfcb9bd
--- /dev/null
@@ -0,0 +1,35 @@
+#
+# reinit a cluster connection
+#
+my ($self, $line) = @_;
+my @calls = split /\s+/, $line;
+my $call;
+my @out;
+
+return (1, $self->msg('e5')) if $self->priv < 5;
+
+foreach $call (@calls) {
+       $call = uc $call;
+       next if $call eq $main::mycall;
+       my $dxchan = DXChannel->get($call);
+       if ($dxchan) {
+               if ($dxchan->is_ak1a) {
+                       
+                       # first clear out any nodes on this dxchannel
+                       my @gonenodes = map { $_->dxchan == $dxchan ? $_ : () } DXNode::get_all();
+                       foreach my $node (@gonenodes) {
+                               next if $dxchan == $DXProt::me;
+                               DXProt::broadcast_ak1a(DXProt::pc21($node->call, 'Gone, re-init') , $dxchan) unless $dxchan->{isolate}; 
+                               $node->del();
+                       }
+                       $dxchan->send(DXProt::pc38());
+                       $dxchan->send(DXProt::pc18());
+                       push @out, $self->msg('init1', $call);
+               } 
+       } else {
+               push @out, $self->msg('e10', $call);
+       }
+}
+
+return (1, @out);
+
index 106bfd47b9816bdb75f36108710dcdd0bdd4c753..26b99ef213fc062a514edf47012e2b6a7dd0c3bd 100644 (file)
@@ -7,7 +7,7 @@
 #
 my $self = shift;
 
-return (1, $self->msg('e5')) if $self->priv < 9;
+return (1, $self->msg('e5')) if $self->priv < 6;
 
 my $cmdline = shift;
 my @f = split /\s+/, $cmdline;
index 3c0203575d978e3355bd95b41df023268080a98f..b287413da9a511d7e5cb8e3863889c0228bde6d9 100644 (file)
@@ -25,15 +25,15 @@ use strict;
 #
 sub print
 {
-       my $self = $DXLog::log;
+       my $fcb = $DXLog::log;
        my $from = shift;
        my $to = shift;
-       my @date = $self->unixtoj(shift);
+       my @date = Julian::unixtojm(shift);
        my $pattern = shift;
        my $who = uc shift;
        my $search;
        my @in;
-       my @out;
+       my @out = ();
        my $eval;
        my $count;
            
@@ -55,25 +55,28 @@ sub print
                                }
                          );
        
-       $self->close;                                      # close any open files
+       $fcb->close;                                      # close any open files
 
-       my $fh = $self->open(@date); 
+       my $fh = $fcb->open(@date); 
        for ($count = 0; $count < $to; ) {
-               my @spots = ();
+               my $ref;
                if ($fh) {
+                       @in = ();
                        while (<$fh>) {
                                chomp;
-                               push @in, [ split '\^' ];
+                               $ref = [ split '\^' ];
+                               push @{$ref}, "" unless @{$ref} >= 4;
+                               push @in, $ref;
                        }
                        eval $eval;               # do the search on this file
                        last if $count >= $to;                  # stop after n
                        return ("Log search error", $@) if $@;
                }
-               $fh = $self->openprev();      # get the next file
+               $fh = $fcb->openprev();      # get the next file
                last if !$fh;
        }
        
-       return @out if defined @out;
+       return @out;
 }
 
 #
index 16b67023a7f09d579ff8bfd01ac2246f3188f74a..4cf7db7fae76c184b2f3b38e61bac3356a048d90 100644 (file)
@@ -371,9 +371,17 @@ sub normal
                }
                
                if ($pcno == 18) {              # link request
+                       $self->state('init');   
+
+                       # first clear out any nodes on this dxchannel
+                       my @gonenodes = map { $_->dxchan == $self ? $_ : () } DXNode::get_all();
+                       foreach my $node (@gonenodes) {
+                               next if $node->dxchan == $DXProt::me;
+                               broadcast_ak1a(pc21($node->call, 'Gone, re-init') , $self) unless $self->{isolate}; 
+                               $node->del();
+                       }
                        $self->send_local_config();
                        $self->send(pc20());
-                       $self->state('init');   
                        return;             # we don't pass these on
                }
                
index e2be0e3fa36536ca68063854c1e5395f0159e5ae..956778bf7f7e6852204600fd742d8a6cd0ffe41f 100644 (file)
@@ -54,6 +54,7 @@ package DXM;
                                hnodee1 => 'Please enter your Home Node, set/homenode <your home DX Cluster>',
                                hnodee2 => 'Failed to set homenode on $_[0]',
                                hnode => 'Your Homenode is now \"$_[0]\"',
+                               init1 => 'sent initialisation message to $_[0]',
                                iso => '$_[0] Isolated',
                                isou => '$_[0] UnIsolated',
                                isoc => '$_[0] created and Isolated',
index 5b43496e879e488e9a78e7dd5e37b3ed1fabd9e6..94fe0478664473b657b6297b9189ae8e091c1696 100755 (executable)
@@ -174,8 +174,22 @@ sub cease
                Local::finish();   # end local processing
        };
        dbg('local', "Local::finish error $@") if $@;
-       
+
+       # disconnect users
+       foreach $dxchan (DXChannel->get_all()) {
+               next if $dxchan->is_ak1a;
+               disconnect($dxchan) unless $dxchan == $DXProt::me;
+       }
+       Msg->event_loop(1, 0.05);
+       Msg->event_loop(1, 0.05);
+       Msg->event_loop(1, 0.05);
+       Msg->event_loop(1, 0.05);
+       Msg->event_loop(1, 0.05);
+       Msg->event_loop(1, 0.05);
+
+       # disconnect nodes
        foreach $dxchan (DXChannel->get_all()) {
+               next unless $dxchan->is_ak1a;
                disconnect($dxchan) unless $dxchan == $DXProt::me;
        }
        Msg->event_loop(1, 0.05);