-# Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
#
# XXX This is a totally unstable API for public-inbox internal use only
$self;
}
-sub main_cb ($$$) {
- my ($http, $fh, $bref) = @_;
+sub main_cb ($$) {
+ my ($http, $fh) = @_;
sub {
my ($self) = @_;
- my $r = sysread($self->{sock}, $$bref, 8192);
+ my $r = sysread($self->{sock}, my $buf, 65536);
if ($r) {
- $fh->write($$bref); # may call $http->close
+ $fh->write($buf); # may call $http->close
if ($http->{sock}) { # !closed
$self->requeue;
# let other clients get some work done, too
# will automatically close this ($self) object.
$http->{forward} = $self;
$fh->write($$bref); # PublicInbox:HTTP::{chunked,identity}_wcb
- my $cb = $self->{cb} = main_cb($http, $fh, $bref);
+ $$bref = undef; # we're done with this
+ my $cb = $self->{cb} = main_cb($http, $fh);
$cb->($self); # either hit EAGAIN or ->requeue to keep EPOLLET happy
}