about summary refs log tree commit homepage
path: root/lib/PublicInbox/NNTP.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-05-18 18:58:04 +0000
committerEric Wong <e@80x24.org>2016-05-18 18:58:59 +0000
commitd9f8d7fbc53dfef25f8a8b260274afcade86ed42 (patch)
tree89ffbc4b3f01dc3c077a1ca4233b1a4966001a80 /lib/PublicInbox/NNTP.pm
parent46f3581902ac04e835d3bff9f84f8331906da02f (diff)
downloadpublic-inbox-d9f8d7fbc53dfef25f8a8b260274afcade86ed42.tar.gz
There's no place for them in the commands and we don't take
messages; potentially printing them into a log opened in a
terminal is too dangerous.

Hoist out read_til_dot in the test while we're at it.
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r--lib/PublicInbox/NNTP.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index e77ccaa4..ac536f71 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -12,7 +12,6 @@ use PublicInbox::Msgmap;
 use PublicInbox::Git;
 use PublicInbox::MID qw(mid2path);
 use Email::Simple;
-use Data::Dumper qw(Dumper);
 use POSIX qw(strftime);
 use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC);
 use URI::Escape qw(uri_escape_utf8);
@@ -151,7 +150,7 @@ sub process_line ($$) {
         my $res = eval { $req->($self, @args) };
         my $err = $@;
         if ($err && !$self->{closed}) {
-                chomp($l = Dumper(\$l));
+                chomp($l);
                 err($self, 'error from: %s (%s)', $l, $err);
                 $res = '503 program fault - command not performed';
         }
@@ -972,6 +971,7 @@ sub event_read {
         $self->{rbuf} .= $$buf;
         while ($r > 0 && $self->{rbuf} =~ s/\A\s*([^\r\n]+)\r?\n//) {
                 my $line = $1;
+                return $self->close if $line =~ /[[:cntrl:]]/s;
                 my $t0 = now();
                 my $fd = $self->{fd};
                 $r = eval { process_line($self, $line) };