X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FExtMsg.pm;h=01a30924393e088535a9d2f98f97cff11004b5b7;hb=112a95fceb1effe735e555bb93ecebd3383e515a;hp=a601d4edfa01c0a09da64a74859e50ffdd9d94c6;hpb=2f1b948ea733e0ece1909a31987dc8f03044e851;p=spider.git diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index a601d4ed..01a30924 100644 --- a/perl/ExtMsg.pm +++ b/perl/ExtMsg.pm @@ -68,9 +68,9 @@ sub dequeue if ($conn->{state} eq 'WC' && exists $conn->{cmd} && @{$conn->{cmd}} == 0) { $conn->to_connected($conn->{call}, 'O', 'telnet'); } - } elsif ($conn->{msg} =~ /\n/) { - my @lines = split /\r?\n/, $conn->{msg}; - if ($conn->{msg} =~ /\n$/) { + } elsif ($conn->{msg} =~ /\cJ/) { + my @lines = $conn->{msg} =~ /([^\cM\cJ]*)\cM?\cJ/g; + if ($conn->{msg} =~ /\cJ$/) { delete $conn->{msg}; } else { $conn->{msg} = pop @lines; @@ -247,7 +247,7 @@ sub _dochat my $conn = shift; my $cmd = shift; my $line = shift; - + if ($line) { my ($expect, $send) = $cmd =~ /^\s*\'(.*)\'\s+\'(.*)\'/; if ($expect) { @@ -261,6 +261,7 @@ sub _dochat if ($line =~ /$expect/i) { dbg('connect', "got: \"$expect\" sending: \"$send\""); $conn->send_later($send); + delete $conn->{msg}; # get rid any input if a match return; } }