BUG/MEDIUM: h1: Make sure we subscribe before going into idle list.
authorOlivier Houchard <cognet@ci0.org>
Sun, 22 Mar 2020 18:56:03 +0000 (19:56 +0100)
committerOlivier Houchard <cognet@ci0.org>
Sun, 22 Mar 2020 19:05:59 +0000 (20:05 +0100)
commit3c49c1bd5ce1b47baa63d3c4058437e341389d98
treedc17643cb377b09e6d3601247d96b2cd7ff2cac2
parent18eeb8e8156c4f32a65cee40a96b0b30e74eeb59
BUG/MEDIUM: h1: Make sure we subscribe before going into idle list.

In h1_detach(), make sure we subscribe before we call
srv_add_to_idle_list(), not after. As soon as srv_add_to_idle_list() is
called, and it is put in an idle list, another thread can take it, and
we're no longer allowed to subscribe.
This fixes a race condition when another thread grabs a connection as soon
as it is put, the original owner would subscribe, and thus the new thread
would fail to do so, and to activate polling.
src/mux_h1.c