]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: mux-h2: remove padlen during headers phase
authorWilly Tarreau <w@1wt.eu>
Fri, 21 Dec 2018 14:34:50 +0000 (15:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Dec 2018 10:45:00 +0000 (11:45 +0100)
commit3bf6918cb2b9baa58ed0347008a94631a1034539
tree98c535baab8432989b2127c5ce3a89ede7074bed
parenta87546624369ef94546907d90a17da9c985399fd
MEDIUM: mux-h2: remove padlen during headers phase

Three types of frames may be padded : DATA, HEADERS and PUSH_PROMISE.
Currently, each of these independently deals with padding and needs to
wait for and skip the initial padlen byte. Not only this complicates
frame processing, but it makes it very hard to process CONTINUATION
frames after a padded HEADERS frame, and makes it complicated to perform
atomic calls to h2s_decode_headers(), which are needed if we want to be
able to maintain the HPACK decompressor's context even when dropping
streams.

This patch takes a different approach : the padding is checked when
parsing the frame header, the padlen byte is waited for and parsed,
and the dpl value is updated with this padlen value. This will allow
the frame parsers to decide to overwrite the padding if needed when
merging adjacent frames.
src/mux_h2.c