]> dxcluster.org Git - spider.git/commitdiff
1. I believe I have fixed all the login/logout 'broken pipe' errors
authordjk <djk>
Sat, 17 Jun 2000 21:54:15 +0000 (21:54 +0000)
committerdjk <djk>
Sat, 17 Jun 2000 21:54:15 +0000 (21:54 +0000)
2. Added G0RDI's 'links' command.

Changes
cmd/Commands_en.hlp
cmd/links.pl [new file with mode: 0644]
perl/DXChannel.pm
perl/DXCommandmode.pm
perl/DXProt.pm
perl/client.pl
perl/cluster.pl
perl/console.pl
src/client.c

diff --git a/Changes b/Changes
index a6e8d08a42bbf32b6be52dd1550e69fba823dfa0..76380d4ef30945508d3c56949e89254332ae9860 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+17Jun00=======================================================================
+1. I believe I have fixed all the login/logout 'broken pipe' errors
+2. Added G0RDI's 'links' command.
 14Jun00=======================================================================
 1. fixed sh/node crash
 2. fixed RTT in who.pl
index 1e25f894970cab3b13defa4e3197d8404eba2b70..7dc27bc881233504bd0ebab42761b2c304c55dc2 100644 (file)
@@ -259,6 +259,10 @@ Delete a message (usually a 'bulletin') from the whole cluster system.
 This uses the subject field, so any messages that have exactly the same subject
 will be deleted. Beware!
 
+=== 0^LINKS^Show which nodes is physically connected
+This is a quick listing that shows which links are connected and
+some information about them. See WHO for a list of all connections.
+
 === 9^LOAD/ALIASES^Reload the command alias table
 Reload the /spider/cmd/Aliases file after you have editted it. You will need to
 do this if you change this file whilst the cluster is running in order for the
diff --git a/cmd/links.pl b/cmd/links.pl
new file mode 100644 (file)
index 0000000..456ea72
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# links : which are active
+# a complete list of currently connected linked nodes
+#
+# Created by Iain Philipps G0RDI, based entirely on
+# who.pl, which is Copyright (c) 1999 Dirk Koopman G1TLH
+#
+# 16-Jun-2000
+# $Id: links.pl
+
+
+my $self = shift;
+my $dxchan;
+my @out;
+
+push @out, "  Callsign   Started                 Ave RTT";
+
+foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_ak1a ) {
+       my $call = $dxchan->call();
+       my $t = cldatetime($dxchan->startt);
+       my $name = $dxchan->user->name || " ";
+       my $ping = $dxchan->is_node && $dxchan != $DXProt::me ? sprintf("%8.2f",
+                                                                                                                                       $dxchan->pingave) : "";
+       push @out, sprintf "%10s $t %-6.6s $ping", $call;
+
+}
+
+return (1, @out)
+
+
+
+
index 93d07c1d3a69561ed50e84a40d2f2824a6118645..3637b7626885a6ec63e20720c8b3008ba03ba270 100644 (file)
@@ -376,10 +376,8 @@ sub disconnect
        my $user = $self->{user};
        my $conn = $self->{conn};
        my $call = $self->{call};
-    my $nopc39 = shift || 0;
        
-       $self->finish($nopc39);
-       $conn->send_now("Z$call|bye") if $conn; # this will cause 'client' to disconnect
+       $self->finish($conn);
        $user->close() if defined $user;
        $conn->disconnect() if $conn;
        $self->del();
index 1743af851f59375d2d401f0dfbca70c6e32edb53..ca6a1c4e989cbc264c4b72cf698a6197bf7a6c93 100644 (file)
@@ -306,13 +306,14 @@ sub process
 sub finish
 {
        my $self = shift;
+       my $conn = shift;
        my $call = $self->call;
 
        # I was the last node visited
     $self->user->node($main::mycall);
                
        # log out text
-       if (-e "$main::data/logout") {
+       if ($conn && -e "$main::data/logout") {
                open(I, "$main::data/logout") or confess;
                my @in = <I>;
                close(I);
index 74353d5b0ba8cf8de770070e1229ad609345af7a..fb1b4b95b85e1b28ae0b2e40ae27164f42070699 100644 (file)
@@ -878,11 +878,9 @@ sub finish
 {
        my $self = shift;
        my $call = $self->call;
-       my $nopc39 = shift;
+       my $conn = shift;
        my $ref = DXCluster->get_exact($call);
        
-       $self->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', "System Op"))) unless $nopc39;
-       
        # unbusy and stop and outgoing mail
        my $mref = DXMsg::get_busy($call);
        $mref->stop_msg($call) if $mref;
@@ -1351,5 +1349,17 @@ sub addrcmd
                route(undef, $to, pc34($main::mycall, $to, $cmd));
        }
 }
+
+sub disconnect
+{
+       my $self = shift;
+       my $nopc39 = shift;
+
+       if ($self->{conn} && !$nopc39) {
+               $self->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', "System Op")));
+       }
+
+       $self->SUPER::disconnect;
+}
 1;
 __END__ 
index 1b6757b48c27c09c63ea7f19f1a4167a50c014d8..66c7b0927337d88443097fb62b2c1daa1cc5dce9 100755 (executable)
@@ -51,10 +51,10 @@ use IPC::Open2;
 sub cease
 {
        my $sendz = shift;
-       if ($conn && $sendz) {
-               $conn->send_now("Z$call|bye...");
-               sleep(1);
-       }
+#      if ($conn && $sendz) {
+#              $conn->send_now("Z$call|bye...");
+#              sleep(1);
+#      }
        $stdout->flush if $stdout;
        if ($pid) {
                dbg('connect', "killing $pid");
@@ -99,7 +99,7 @@ sub rec_socket
 {
        my ($con, $msg, $err) = @_;
        if (defined $err && $err) {
-               cease(1);
+               cease(0);
        }
        if (defined $msg) {
                my ($sort, $call, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/;
@@ -155,6 +155,8 @@ sub rec_socket
                # any other sorts that might happen are silently ignored.
                # ******************************************************
                # ******************************************************
+       } else {
+               cease(0);
        }
        $lasttime = time; 
 }
index aa44006786c5d382925d10e45cb324f0ca162766..5d6248efa296ab372364f9ddb684e3de8c3c2149 100755 (executable)
@@ -106,6 +106,11 @@ sub rec
        
        if (!defined $msg || (defined $err && $err)) {
                if ($dxchan) {
+                       if (defined $err) {
+                               $conn->disconnect;
+                               undef $conn;
+                               $dxchan->conn(undef);
+                       }
                        $dxchan->disconnect;
                } elsif ($conn) {
                        $conn->disconnect;
@@ -375,6 +380,11 @@ dbg('err', "orft we jolly well go ...");
 
 #open(DB::OUT, "|tee /tmp/aa");
 
+$SIG{PIPE} = sub { 
+       #$DB::single = 1;  
+       dbg('err', "Broken PIPE signal received"); 
+};
+
 for (;;) {
        my $timenow;
 #      $DB::trace = 1;
index 35e5da7e9bf339aebf3f26e209e6f9e9b262850e..643286f61c4c6091e7efb8c7c9a463c5ff2f0375 100755 (executable)
@@ -101,9 +101,9 @@ sub do_resize
 sub cease
 {
        my $sendz = shift;
-       if ($conn && $sendz) {
-               $conn->send_now("Z$call|bye...");
-       }
+#      if ($conn && $sendz) {
+#              $conn->send_now("Z$call|bye...");
+#      }
        endwin();
        dbgclose();
        print @_ if @_;
@@ -226,6 +226,8 @@ sub rec_socket
                # any other sorts that might happen are silently ignored.
                # ******************************************************
                # ******************************************************
+       } else {
+               cease(0);
        }
        $top->refresh();
        $lasttime = time; 
index 1473682a4acaf8f2cfea3d145b16220735a95396..885b50efa3601a019e4038001dbb84f9787eaae5 100644 (file)
@@ -629,9 +629,11 @@ void term_timeout(int i)
 
 void terminate(int i)
 {
+#if 0
        if (node && send_Z && call) {
                send_msg(node, 'Z', "bye", 3);
        }
+#endif
        
        signal(SIGALRM, term_timeout);
        alarm(10);