X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fclient.pl;h=f159ee79ed200153d39cf0e9b01631a9aadec35d;hb=e674587476599456cce169e02b0e441d985f9dd8;hp=f153b589cb455b7eaf3348088697c13daa6f8977;hpb=b73aa9d811a4a1691f4ec2a9aaba0eb51f5ff62d;p=spider.git diff --git a/perl/client.pl b/perl/client.pl index f153b589..f159ee79 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -39,6 +39,7 @@ BEGIN { } use Msg; +use IntMsg; use DXVars; use DXDebug; use DXUtil; @@ -78,9 +79,11 @@ sub sig_term # terminate a child sub sig_chld { - $SIG{CHLD} = \&sig_chld; - $waitedpid = wait; - dbg('connect', "caught $pid"); + unless ($^O =~ /^MS/i) { + $SIG{CHLD} = \&sig_chld; + $waitedpid = wait; + dbg('connect', "caught $waitedpid"); + } } @@ -94,6 +97,7 @@ sub setmode $out_lineend = "\r\n"; } $/ = $mynl; + $out_lineend = $mynl; } # handle incoming messages @@ -235,6 +239,12 @@ sub doconnect $sock->output_record_separator(''); $sock->option_accept(Dont => TELOPT_ECHO, Wont => TELOPT_ECHO); $sock->open($host) or die "Can't connect to $host port $port $!"; + if ($port == 23) { + $sock->telnetmode(1); + $sock->option_send(Dont => TELOPT_ECHO, Wont => TELOPT_ECHO) if $port == 23; + } else { + $sock->telnetmode(0); + } $sock->binmode(0); $mode = 3; } elsif ($sort eq 'ax25' || $sort eq 'prog') { @@ -394,11 +404,12 @@ if ($call eq $mycall) { $stdout->autoflush(1); -$SIG{'INT'} = \&sig_term; -$SIG{'TERM'} = \&sig_term; -$SIG{'HUP'} = \&sig_term; -$SIG{'CHLD'} = \&sig_chld; -$SIG{'ALRM'} = \&timeout; +unless ($^O =~ /^MS/i) { + $SIG{'INT'} = \&sig_term; + $SIG{'TERM'} = \&sig_term; + $SIG{'HUP'} = \&sig_term; + $SIG{'CHLD'} = \&sig_chld; +} dbgadd('connect'); @@ -513,7 +524,7 @@ if ($ssid) { } -$conn = Msg->connect("$clusteraddr", $clusterport, \&rec_socket); +$conn = IntMsg->connect("$clusteraddr", $clusterport, \&rec_socket); if (! $conn) { if (-r "$data/offline") { open IN, "$data/offline" or die; @@ -534,7 +545,7 @@ Msg->set_event_handler($stdin, "read" => \&rec_stdin); for (;;) { my $t; - Msg->event_loop(1, 1); + Msg->event_loop(1, 0.1); $t = time; if ($t > $lasttime) { if ($outqueue) {