MEDIUM: h2: prevent the various mux encoders from modifying the buffer
authorWilly Tarreau <w@1wt.eu>
Thu, 14 Jun 2018 11:33:30 +0000 (13:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:41 +0000 (16:23 +0200)
commit5dd17353d5834c3c3da97fa730f22553bb512b50
tree09ebe418d9a71b1f67a2e22f2e8317f14248e187
parent1dc41e75d876f052d3a002d0c00e0872a4adb073
MEDIUM: h2: prevent the various mux encoders from modifying the buffer

Functions h2s_frt_make_resp_headers() and h2s_frt_make_resp_data() used
to modify the buffer's output data count. This is problematic for the
buffer's rework as we don't want to rely on this anymore. This commit
modifies these functions to take an offset (relative to the buffer's
head) and a maximum byte count. Thus h2_snd_buf() now calls them with
buf->o and takes care of removing deleted data itself. The send functions
now almost support being passed const buffers (except for the data part
which is still embedded).
src/mux_h2.c