about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-11-18 22:56:23 +0000
committerEric Wong <e@80x24.org>2015-11-18 22:56:23 +0000
commita36e2d3c6f7e5cc1e7aa2b495ad67bbd2b3d709c (patch)
treebd02b22794b6e3a49e5dceb88c9ac6c116b43ff8 /lib
parent3137d85fe7f7cd7c506858a9e8fe99a34900c9ac (diff)
downloadpublic-inbox-a36e2d3c6f7e5cc1e7aa2b495ad67bbd2b3d709c.tar.gz
Error messages and request lines may contain '%' which would
throw off Perl printf.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/NNTP.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 944e9305..0bfafa88 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -114,7 +114,7 @@ sub process_line ($$) {
         my $err = $@;
         if ($err && !$self->{closed}) {
                 chomp($l = Dumper(\$l));
-                err($self, "error from: $l ($err)");
+                err($self, 'error from: %s (%s)', $l, $err);
                 $res = '503 program fault - command not performed';
         }
         return 0 unless defined $res;
@@ -568,8 +568,8 @@ sub long_response ($$$$) {
 
                         if ($err) {
                                 err($self,
-                                    "$err during long response[$fd] - %0.6f",
-                                        now() - $t0);
+                                    "%s during long response[$fd] - %0.6f",
+                                    $err, now() - $t0);
                         }
                         if ($self->{closed}) {
                                 out($self, " deferred[$fd] aborted - %0.6f",
@@ -925,7 +925,7 @@ sub event_read {
                 $r = eval { $self->process_line($line) };
                 my $d = $self->{long_res} ?
                         " deferred[$fd]" : '';
-                out($self, "[$fd] $line - %0.6f$d", now() - $t0);
+                out($self, "[$fd] %s - %0.6f$d", $line, now() - $t0);
         }
 
         return $self->close if $r < 0;