X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FExtMsg.pm;h=122d3ec837e52cfeccbb3ee9092274784a477c0b;hb=adbdb8b9a0e376b05b1d23234db927db946c8c5d;hp=33c17bfd44bcc18bef606c60a221453989da6259;hpb=94d6432422ca8bdd0918789ce2335a44b29faa81;p=spider.git diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index 33c17bfd..122d3ec8 100644 --- a/perl/ExtMsg.pm +++ b/perl/ExtMsg.pm @@ -58,7 +58,8 @@ sub dequeue my $conn = shift; my $msg; - while ($msg = shift @{$conn->{inqueue}}){ + while (@{$conn->{inqueue}}){ + $msg = shift @{$conn->{inqueue}}; dbg('connect', $msg) unless $conn->{state} eq 'C'; $msg =~ s/\xff\xfa.*\xff\xf0|\xff[\xf0-\xfe].//g; # remove telnet options @@ -91,6 +92,7 @@ sub dequeue } } if ($conn->{msg} && $conn->{state} eq 'WC' && exists $conn->{cmd} && @{$conn->{cmd}}) { + dbg('connect', $conn->{msg}); $conn->_docmd($conn->{msg}); if ($conn->{state} eq 'WC' && exists $conn->{cmd} && @{$conn->{cmd}} == 0) { $conn->{state} = 'C'; @@ -270,6 +272,10 @@ sub _doclient my @f = split /\s+/, $line; $conn->{call} = uc $f[0] if $f[0]; $conn->{csort} = $f[1] if $f[1]; + $conn->{state} = 'C'; + &{$conn->{rproc}}($conn, "O$conn->{call}|telnet"); + delete $conn->{cmd}; + $conn->{timeout}->del_timer if $conn->{timeout}; } sub _send_file @@ -282,7 +288,7 @@ sub _send_file if ($f) { while (<$f>) { chomp; - $conn->send_later($_); + $conn->send_raw($_ . $conn->{lineend}); } $f->close; }