]> dxcluster.net Git - spider.git/commitdiff
fiddled with \r\n settings a bit
authordjk <djk>
Mon, 12 Jun 2000 09:15:58 +0000 (09:15 +0000)
committerdjk <djk>
Mon, 12 Jun 2000 09:15:58 +0000 (09:15 +0000)
perl/client.pl

index f59c5847c09be00f2cb481be4387331899a2a92d..4a472984a0c3320684edc357148f6c295e823e68 100755 (executable)
@@ -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/");