X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FExtMsg.pm;h=4475f6a10cbf6623f5c8f12163acb6cf14f97198;hb=9bba449d12641232d51d259f470ce6b21205c622;hp=2fd19873eae890b619030266f1bc34db625bf030;hpb=b7e47e72297ced0ec9ce120922e6de2e5614a3fe;p=spider.git diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index 2fd19873..4475f6a1 100644 --- a/perl/ExtMsg.pm +++ b/perl/ExtMsg.pm @@ -115,8 +115,8 @@ sub to_connected delete $conn->{cmd}; $conn->{timeout}->del if $conn->{timeout}; delete $conn->{timeout}; - $conn->_send_file("$main::data/connected"); &{$conn->{rproc}}($conn, "$dir$call|$sort"); + $conn->_send_file("$main::data/connected"); } sub new_client { @@ -125,6 +125,8 @@ sub new_client { if ($sock) { my $conn = $server_conn->new($server_conn->{rproc}); $conn->{sock} = $sock; + Msg::blocking($sock, 0); + $conn->{blocking} = 0; my ($rproc, $eproc) = &{$server_conn->{rproc}} ($conn, $conn->{peerhost} = $sock->peerhost(), $conn->{peerport} = $sock->peerport()); if ($eproc) { @@ -250,7 +252,7 @@ sub _doconnect *STDOUT = IO::File->new_from_fd($b, 'w') or die; *STDERR = IO::File->new_from_fd($b, 'w') or die; close $a; - unless ($^O =~ /^MS/) { + unless ($main::is_win) { # $SIG{HUP} = 'IGNORE'; $SIG{HUP} = $SIG{CHLD} = $SIG{TERM} = $SIG{INT} = 'DEFAULT'; alarm(0); @@ -316,8 +318,10 @@ sub _dochat return; } if ($line =~ /\Q$expect/i) { - dbg('connect', "got: \"$expect\" sending: \"$send\""); - $conn->send_later("D$conn->{call}|$send"); + if (length $send) { + dbg('connect', "got: \"$expect\" sending: \"$send\""); + $conn->send_later("D$conn->{call}|$send"); + } delete $conn->{msg}; # get rid any input if a match return; } @@ -361,6 +365,7 @@ sub _send_file if ($f) { while (<$f>) { chomp; + dbg('connll', $_); $conn->send_raw($_ . $conn->{lineend}); } $f->close;