From: djk Date: Mon, 12 Jun 2000 09:15:58 +0000 (+0000) Subject: fiddled with \r\n settings a bit X-Git-Tag: R_1_41~6 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=5254ea7ecfdf68964a2e50b160ac62524b67dd93;p=spider.git fiddled with \r\n settings a bit --- diff --git a/perl/client.pl b/perl/client.pl index f59c5847..4a472984 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -108,6 +108,7 @@ sub rec_socket my $snl = $mynl; my $newsavenl = ""; $snl = "" if $mode == 0; + $snl = "\r\n" if $mode == 2; if ($mode == 2 && $line =~ />$/) { $newsavenl = $snl; $snl = ' '; @@ -273,17 +274,21 @@ sub dochat if ($csort eq 'telnet') { $line = $sock->get(); cease(11) unless $line; # the socket has gone away? + if (length $line == 0) { + dbg('connect', "received 0 length line, aborting..."); + cease(11); + } $line =~ s/\r\n/\n/og; chomp; } elsif ($csort eq 'ax25' || $csort eq 'prog') { local $/ = "\r"; $line = <$rfh>; + if (length $line == 0) { + dbg('connect', "received 0 length line, aborting..."); + cease(11); + } $line =~ s/\r//og; } - if (length $line == 0) { - dbg('connect', "received 0 length line, aborting..."); - cease(11); - } dbg('connect', "received \"$line\""); if ($abort && $line =~ /$abort/i) { dbg('connect', "aborted on /$abort/");