]> Sergey Matveev's repositories - public-inbox.git/commit
http: fix various race conditions
authorEric Wong <e@80x24.org>
Tue, 24 May 2016 03:41:52 +0000 (03:41 +0000)
committerEric Wong <e@80x24.org>
Tue, 24 May 2016 04:12:09 +0000 (04:12 +0000)
commit8648f519a95872600689c3a5d6d87fd17770f9fc
tree0a223fa836c02bf674d7d48b9b883908abeca1ce
parent74bbc3da398d00ba12e9294e360ad177ab2061ed
http: fix various race conditions

We no longer override Danga::Socket::event_write and instead
re-enable reads by queuing up another callback in the $close
response callback.  This is necessary because event_write may not be
completely done writing a response, only the existing buffered data.

Furthermore, the {closed} field can almost be set at any time when
writing, so we must check it before acting on pipelined requests as
well as during write callbacks in more().
lib/PublicInbox/HTTP.pm