From 5254ea7ecfdf68964a2e50b160ac62524b67dd93 Mon Sep 17 00:00:00 2001 From: djk Date: Mon, 12 Jun 2000 09:15:58 +0000 Subject: [PATCH] fiddled with \r\n settings a bit --- perl/client.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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/"); -- 2.43.0