]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEV: h2: support reading frame payload from a file
authorWilly Tarreau <w@1wt.eu>
Wed, 26 Apr 2023 09:25:46 +0000 (11:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 26 Apr 2023 09:36:02 +0000 (11:36 +0200)
commite8ae99b111b4b365a9615f6ac7c60aba101d6ea6
tree2b1a0381c4d7e78d6c4a049c6b5cf7fa2481706c
parent78bb934607b2ed35df1a491faebe5a0d68f5e405
DEV: h2: support reading frame payload from a file

Now we can build a series of data frames by reading from a file and
chunking it into frames of requested length. It's mostly useful for
data frames (e.g. post). One way to announce these upfront is to
capture the output of curl use without content-length:

  $ nc -lp4446 > post-h2-nocl.bin
  $ curl -v --http2-prior-knowledge http://127.0.0.1:4446/url -H "content-length:" -d @/dev/null

Then just change the 5th byte from the end from 1 to 0 to remove the
end-of-stream bit, it will allow to chain a file, then to send an
empty DATA frame with ES set :

  $ (dev/h2/mkhdr.sh -i 1 -t data -d CHANGELOG;
     dev/h2/mkhdr.sh -i 1 -t data -l 0 -f es) > h2-data-changelog.bin

Then post that to the server:
  $ cat post-h2-nocl.bin h2-data-changelog.bin | nc 0 4446
dev/h2/mkhdr.sh