tried to sort out last in
[spider.git] / perl / client.pl
index ffae6e584ebfbc5fc4c5fa44ef7f929cbe031bc9..9e948a181a64bee603208586c1573d65ddccf327 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
 #
 # A thing that implements dxcluster 'protocol'
 #
@@ -41,12 +41,11 @@ BEGIN {
 use Msg;
 use DXVars;
 use DXDebug;
-use DXUser;
 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 +59,8 @@ sub cease
                dbg('connect', "killing $pid");
                kill(9, $pid);
        }
+       dbgclose();
+#      $SIG{__WARN__} = sub {my $a = shift; cluck($a); };
        sleep(1);
        exit(0);        
 }
@@ -128,7 +129,8 @@ sub rec_socket
                                $mode = $line;          # set echo mode from cluster
                                my $term = POSIX::Termios->new;
                                $term->getattr(fileno($sock));
-                               $term->setflag( &POSIX::ISIG );
+                               $term->setiflag( 0 );
+                               $term->setoflag( 0 );
                                $term->setattr(fileno($sock), &POSIX::TCSANOW );
                        }
                } elsif ($sort eq 'I') {
@@ -365,6 +367,8 @@ if ($loginreq) {
        }
        
 
+       use DXUser;
+       
        DXUser->init($userfn);
        
        # allow a login from an existing user. I could create a user but
@@ -470,7 +474,7 @@ if (! $conn) {
                open IN, "$data/offline" or die;
                while (<IN>) {
                        s/\n/\r/og if $mode == 1;
-                       print $stdout;
+                       print $stdout $_;
                }
                close IN;
        } else {