From: minima Date: Sat, 3 Mar 2001 11:19:31 +0000 (+0000) Subject: fixed problem with blank line input (for now) X-Git-Tag: R_1_47~162 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=adbdb8b9a0e376b05b1d23234db927db946c8c5d;p=spider.git fixed problem with blank line input (for now) --- diff --git a/perl/DXM.pm b/perl/DXM.pm index ee2f4539..fe1bca7d 100644 --- a/perl/DXM.pm +++ b/perl/DXM.pm @@ -34,7 +34,7 @@ sub msg } return "unknown message '$m' in lang '$lang'" if !defined $s; my $ans = eval qq{ "$s" }; - confess $@ if $@; + warn $@ if $@; return $ans; } diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index 58fb619f..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'; @@ -286,7 +288,7 @@ sub _send_file if ($f) { while (<$f>) { chomp; - $conn->send_later($_); + $conn->send_raw($_ . $conn->{lineend}); } $f->close; } diff --git a/perl/Msg.pm b/perl/Msg.pm index 7af8566e..1099ba88 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -245,9 +245,12 @@ sub _rcv { # Complement to _send if ($bytes_read > 0) { if ($msg =~ /\n/) { @lines = split /\r?\n/, $msg; - $lines[0] = '' unless @lines; - $lines[0] = $conn->{msg} . $lines[0] if exists $conn->{msg}; - push @lines, ' ' unless @lines; + if (@lines) { + $lines[0] = $conn->{msg} . $lines[0] if exists $conn->{msg}; + } else { + $lines[0] = $conn->{msg} if exists $conn->{msg}; + push @lines, '' unless @lines; + } if ($msg =~ /\n$/) { delete $conn->{msg}; } else {