]> Sergey Matveev's repositories - public-inbox.git/commit
nntp: prevent event_read from firing twice in a row
authorEric Wong <e@80x24.org>
Thu, 6 Dec 2018 02:40:06 +0000 (02:40 +0000)
committerEric Wong <e@80x24.org>
Thu, 6 Dec 2018 03:42:55 +0000 (03:42 +0000)
commit74923a7cb6ace0369455e2155cbf63dfa4be33ea
treea28d35e1b71a711265a0f2d9d1f1b8bc49e3130b
parentfbfd63996ddfc9a23b8a1e0f8756e378f2e196ba
nntp: prevent event_read from firing twice in a row

When a client starts pipelining requests to us which trigger
long responses, we need to keep socket readiness checks disabled
and only enable them when our socket rbuf is drained.

Failure to do this caused aborted clients with
"BUG: nested long response" when Danga::Socket calls event_read
for read-readiness after our "next_tick" sub fires in the
same event loop iteration.

Reported-by: Jonathan Corbet <corbet@lwn.net>
cf. https://public-inbox.org/meta/20181013124658.23b9f9d2@lwn.net/
lib/PublicInbox/NNTP.pm
t/nntpd.t