about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-09-25 02:27:54 +0000
committerEric Wong <e@80x24.org>2015-09-25 02:29:07 +0000
commitf233800d169c9ccaea1d2a4bdccf9dee6853d82b (patch)
treecd1b5da6404a5cccdf3c8459b307373134620043 /lib
parent561eb87f68891106a43eedf7bf054b74e52c2db8 (diff)
downloadpublic-inbox-f233800d169c9ccaea1d2a4bdccf9dee6853d82b.tar.gz
This can help us track down what request patterns clients
will perform when we have multiple clients.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/NNTP.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 7e2c2abd..3490a098 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -492,11 +492,12 @@ sub long_response ($$$$) {
         my ($self, $beg, $end, $cb) = @_;
         die "BUG: nested long response" if $self->{long_res};
 
+        my $fd = $self->{fd};
+        defined $fd or return;
         # make sure we disable reading during a long response,
         # clients should not be sending us stuff and making us do more
         # work while we are stream a response to them
         $self->watch_read(0);
-        my $fd = fileno $self->{sock};
         my $t0 = now();
         $self->{long_res} = sub {
                 # limit our own running time for fairness with other
@@ -885,10 +886,11 @@ sub event_read {
         while ($r > 0 && $self->{rbuf} =~ s/\A\s*([^\r\n]+)\r?\n//) {
                 my $line = $1;
                 my $t0 = now();
+                my $fd = $self->{fd};
                 $r = eval { $self->process_line($line) };
                 my $d = $self->{long_res} ?
-                        ' deferred['.fileno($self->{sock}).']' : '';
-                out($self, "$line - %0.6f$d", now() - $t0);
+                        " deferred[$fd]" : '';
+                out($self, "[$fd] $line - %0.6f$d", now() - $t0);
         }
 
         return $self->close if $r < 0;