delete $conn->{cmd};
$conn->{timeout}->del if $conn->{timeout};
delete $conn->{timeout};
- $conn->_send_file("$main::data/connected");
- Msg->sleep(1);
&{$conn->{rproc}}($conn, "$dir$call|$sort");
+ $conn->_send_file("$main::data/connected");
}
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());
+ dbg('connll', "accept $conn->{cnum} from $conn->{peerhost} $conn->{peerport}");
if ($eproc) {
$conn->{eproc} = $eproc;
Msg::set_event_handler ($sock, "error" => $eproc);
*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);
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;
}
{
my $conn = shift;
dbg('connect', "timed out after $conn->{timeval} seconds");
- $conn->{timeout}->del;
- delete $conn->{timeout};
$conn->disconnect;
}
if ($f) {
while (<$f>) {
chomp;
- $conn->send_raw($_ . $conn->{lineend});
+ my $l = $_;
+ dbg('connll', "connect $conn->{cnum}: $l");
+ $conn->send_raw($l . $conn->{lineend});
}
$f->close;
}