]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntp: do not re-enable reads during long responses
authorEric Wong <e@80x24.org>
Sun, 20 Sep 2015 03:11:09 +0000 (03:11 +0000)
committerEric Wong <e@80x24.org>
Sun, 20 Sep 2015 03:18:09 +0000 (03:18 +0000)
Long responses may leave the buffer momentarily empty,
but we must prevent read events from firing at that point.

lib/PublicInbox/NNTP.pm

index d513953abf060a7abfa9a2ffebb3ab37eaef57bb..0e9108249b07207643252df3cf84665168e4af3e 100644 (file)
@@ -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 {