]> dxcluster.org Git - spider.git/commitdiff
tried to get rid of some of the annoying global destructions messages
authordjk <djk>
Mon, 24 May 1999 11:33:19 +0000 (11:33 +0000)
committerdjk <djk>
Mon, 24 May 1999 11:33:19 +0000 (11:33 +0000)
on end of program

perl/DXCluster.pm
perl/DXLog.pm
perl/Msg.pm
perl/client.pl
perl/cluster.pl

index 021ff7f270875b3e0ea2cbab2e11609bc8c2e43e..c0ec375a88f56eabc3fe39e2fce91417564ae0af 100644 (file)
@@ -136,11 +136,11 @@ sub cluster
        return " $DXNode::nodes nodes, $users local / $tot total users  Max users $DXNode::maxusers  Uptime $uptime";
 }
 
-sub DESTROY
-{
-       my $self = shift;
-       dbg('cluster', "destroying $self->{call}\n");
-}
+#sub DESTROY
+#{
+#      my $self = shift;
+#      dbg('cluster', "destroying $self->{call}\n");
+#}
 
 no strict;
 sub AUTOLOAD
index 2dc6d2feec4136958eb46678f953137ecf5343b5..8e2fc66febaa2021d06fa641bc8771cace0d9708 100644 (file)
@@ -27,7 +27,7 @@ package DXLog;
 
 require Exporter;
 @ISA = qw(Exporter);
-@EXPORT = qw(Log);
+@EXPORT = qw(Log Logclose);
 
 use FileHandle;
 use DXVars;
@@ -174,10 +174,8 @@ sub Log
        $log->writeunix($t, join('^', $t, @_) );
 }
 
-sub DESTROY                                            # catch undefs and do what is required further down the tree
+sub Logclose
 {
-       my $self = shift;
-#      DXDebug::dbg("dxlog", "closing $self->{fn}\n");
-       undef $self->{fh} if defined $self->{fh};
-} 
+       $log->close();
+}
 1;
index 65a32a662c64e7e1ec82df62d2bc94ba19cd848f..aaa38b533b47397ac40193c82fe771872e52d7d7 100644 (file)
@@ -68,6 +68,7 @@ sub disconnect {
     return unless defined($sock);
     set_event_handler ($sock, "read" => undef, "write" => undef);
     shutdown($sock, 3);
+       close($sock);
 }
 
 sub send_now {
index c6f5bd2806c12d0ad0359af074fbf132cc7821ed..850b81d6f108da40bf7194e937438aa03e7cf402 100755 (executable)
@@ -45,7 +45,7 @@ use IO::File;
 use IO::Socket;
 use IPC::Open2;
 use Net::Telnet qw(TELOPT_ECHO);
-use Carp;
+use Carp qw{cluck};
 
 # cease communications
 sub cease
@@ -60,6 +60,7 @@ sub cease
                kill(9, $pid);
        }
        dbgclose();
+#      $SIG{__WARN__} = sub {my $a = shift; cluck($a); };
        sleep(1);
        exit(0);        
 }
index b471c754ec82a7999c39b8c50b69e0287ad05292..a070353752075c18c1453f0704d5c4511b07b490 100755 (executable)
@@ -61,7 +61,7 @@ use Filter;
 use Local;
 use Fcntl ':flock'; 
 
-use Carp;
+use Carp qw(cluck);
 
 package main;
 
@@ -194,7 +194,9 @@ sub cease
        dbg('chan', "DXSpider version $version ended");
        Log('cluster', "DXSpider V$version stopped");
        dbgclose();
+       Logclose();
        unlink $lockfn;
+#      $SIG{__WARN__} = $SIG{__DIE__} =  sub {my $a = shift; cluck($a); };
        exit(0);
 }