]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: mux-h2: don't try to read more than needed
authorWilly Tarreau <w@1wt.eu>
Wed, 31 Jul 2019 14:00:48 +0000 (16:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 31 Jul 2019 14:18:25 +0000 (16:18 +0200)
commit4d7a88482770cb1ce401ec9b625bc367bcfb411b
treebe6ac952e1e9f2b1a02c2c115625dc14a6375293
parent53055055c517d018a36677cbae0a0ad464700fd4
MEDIUM: mux-h2: don't try to read more than needed

The h2_recv() loop was historically built around a loop to deal with
the callback model but this is not needed anymore, as it the upper
layer wants more data, it will simply try to read again. Right now
50% of the recvfrom() calls made over H2 return EAGAIN. With this
change it doesn't happen anymore. Note that the code simply consists
in breaking the loop, and reporting real data receipt instead of
always returning 1.

A test was made not to subscribe if we actually read data but it
doesn't change anything since we might be subscribed very early
already.
src/mux_h2.c