From: Eric Wong Date: Sun, 20 Sep 2015 03:11:09 +0000 (+0000) Subject: nntp: do not re-enable reads during long responses X-Git-Tag: v1.0.0~859 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f033d9bff75455c6c06ce39de8c60816868f1457;p=public-inbox.git nntp: do not re-enable reads during long responses Long responses may leave the buffer momentarily empty, but we must prevent read events from firing at that point. --- diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index d513953a..0e910824 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -754,7 +754,9 @@ sub event_err { $_[0]->close } sub event_write { my ($self) = @_; # only continue watching for readability when we are done writing: - $self->write(undef) == 1 and $self->watch_read(1); + if ($self->write(undef) == 1 && !$self->{long_res}) { + $self->watch_read(1); + } } sub event_read {