BUG/MEDIUM: mux-h2: don't stall on a failed rxbuf alloc without stream
When h2c_dec_hdrs() fails to allocate the temporary buffer used to
decode the HEADERS frame of a new request, it sets H2_CF_DEM_SALLOC and
the connection is queued in the buffer wait list. But h2_buf_available()
only serves H2_CF_DEM_SALLOC for a stream which has a stream connector,
which is not the case yet, so it never succeeds: the demux remains
blocked and the request is not processed until the connection times
out. This can be reproduced by faking a failed allocation there on the
first request of a connection.
There is no buffer the callback could allocate in this case, so let's
clear the flag and restart the demux, which will retry by itself. Since
b_alloc() refuses to allocate when other entries are queued, the retry
would be queued again and the offered buffer would be lost for
everyone, so a new flag H2_CF_DEM_MAYALLOC is set to let the next
h2_get_buf() allocate with DB_F_NOQUEUE, as mux-h1 does with
H1C_F_IN_MAYALLOC.
This was introduced in 2.0 by commit
5c8cafae3 ("MEDIUM: mux-h2: decode
HEADERS frames before allocating the stream"). It must be backported to
all supported versions. Before 3.0 there is no DB_F_NOQUEUE and the new
flag is not needed, clearing H2_CF_DEM_SALLOC and restarting the demux
is enough.