X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FHTTP.pm;h=7697ac5c61136b6d50e6ca1ba821f8ce49165989;hb=2101e27b937893aa427d8693161966e3673b887e;hp=fbca9a54720b774c64a9947bf69755c8fcb435a2;hpb=c100879166cbbd6c2481ce68a549dab7d018d826;p=public-inbox.git diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index fbca9a54..7697ac5c 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -75,17 +75,9 @@ sub event_step { # called by PublicInbox::DS # otherwise we can be buffering infinitely w/o backpressure return read_input($self) if defined $self->{env}; - - my $off = bytes::length($self->{rbuf}); - my $r = sysread($self->{sock}, $self->{rbuf}, 8192, $off); - if (defined $r) { - return $self->close if $r == 0; - return rbuf_process($self); - } - - # common for clients to break connections without warning, - # would be too noisy to log here: - $! == EAGAIN ? $self->watch_in1 : $self->close; + my $rbuf = \($self->{rbuf}); + my $off = bytes::length($$rbuf); + $self->do_read($rbuf, 8192, $off) and rbuf_process($self); } sub rbuf_process {