BUG/MINOR: mux-quic: support initial 0 max-stream-data
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 9 Oct 2023 14:15:20 +0000 (16:15 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 11 Oct 2023 12:15:31 +0000 (14:15 +0200)
commit9d905dfd73f3b5025ba0bd3ede0713fad2df826e
treeaad2d8650a92fb5f9e0c82fff94deb24cd23a398
parentd85f9f9d439e4d482b9ff96bb7c157fd4007a6c1
BUG/MINOR: mux-quic: support initial 0 max-stream-data

Support stream opening with an initial max-stream-data of 0.

In normal case, QC_SF_BLK_SFCTL is set when a qcs instance cannot
transfer more data due to flow-control. This flag is set when
transfering data from MUX to quic-conn instance.

However, it's possible to define an initial value of 0 for
max-stream-data. In this case, qcs instance is blocked despite
QC_SF_BLK_SFCTL not set. No STREAM frame is prepared for this stream as
it's not possible to emit any byte, so QC_SF_BLK_SFCTL flag is never
set.

This behavior should cause no harm. However, this can cause a BUG_ON()
crash on qcc_io_send(). Indeed, when sending is retried, it ensures that
only qcs instance waiting for a new qc_stream_buf or with
QC_SF_BLK_SFCTL set is present in the send_list.

To fix this, initialize qcs with 0 value for msd and QC_SF_BLK_SFCTL.
The flag is removed only if transport parameter msd value is non null.

This should be backported up to 2.6.
src/mux_quic.c