]> dxcluster.net Git - spider.git/commitdiff
fixed problem with blank line input (for now)
authorminima <minima>
Sat, 3 Mar 2001 11:19:31 +0000 (11:19 +0000)
committerminima <minima>
Sat, 3 Mar 2001 11:19:31 +0000 (11:19 +0000)
perl/DXM.pm
perl/ExtMsg.pm
perl/Msg.pm

index ee2f4539c050940b81ec6d49a61ee3edc9af778e..fe1bca7db2af02b5e4c41bb8136c0fbe191108f3 100644 (file)
@@ -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;
 }
 
index 58fb619f89925642561631e85dc6867e9b08b3ff..122d3ec837e52cfeccbb3ee9092274784a477c0b 100644 (file)
@@ -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;
                }
index 7af8566e09f800f56b232b471945bdd40c827581..1099ba8804f881106e918c699798a3b233810868 100644 (file)
@@ -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 {