diff options
author | Eric Wong <e@80x24.org> | 2016-06-19 06:32:41 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-06-19 06:33:10 +0000 |
commit | 271301a493f5418ddf5065d412811fde0a68e984 (patch) | |
tree | c560b73ed522308de605d11a9e45bda2d39f8620 /lib/PublicInbox | |
parent | 37f9ab9084d1808e45ea72db1d6e9ba5160f1481 (diff) | |
download | public-inbox-271301a493f5418ddf5065d412811fde0a68e984.tar.gz |
Use the EvCleanup::asap handler to reschedule our writes after yielding to other clients.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/HTTP.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 6df1c3fc..e0ed2d15 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -271,9 +271,12 @@ sub getline_response { while ($forward && defined(my $buf = $forward->getline)) { $write->($buf); last if $self->{closed}; - if ((--$n) <= 0 || $self->{write_buf_size}) { + if ($self->{write_buf_size}) { $self->write($self->{pull}); return; + } elsif ((--$n) <= 0) { + PublicInbox::EvCleanup::asap($self->{pull}); + return; } } $self->{forward} = $self->{pull} = undef; |