This can help us track down what request patterns clients
will perform when we have multiple clients.
my ($self, $beg, $end, $cb) = @_;
die "BUG: nested long response" if $self->{long_res};
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);
# 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
my $t0 = now();
$self->{long_res} = sub {
# limit our own running time for fairness with other
while ($r > 0 && $self->{rbuf} =~ s/\A\s*([^\r\n]+)\r?\n//) {
my $line = $1;
my $t0 = now();
while ($r > 0 && $self->{rbuf} =~ s/\A\s*([^\r\n]+)\r?\n//) {
my $line = $1;
my $t0 = now();
$r = eval { $self->process_line($line) };
my $d = $self->{long_res} ?
$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;
}
return $self->close if $r < 0;