MEDIUM: mux-quic: refactor streams opening
Review the whole API used to access/instantiate qcs.
A public function qcc_open_stream_local() is available to the
application protocol layer. It allows to easily opening a local stream.
The ID is automatically attributed to the next one available.
For remote streams, qcc_open_stream_remote() has been implemented. It
will automatically take care of allocating streams in a linear way
according to the ID. This function is called via qcc_get_qcs() which can
be used for each qcc_recv*() operations. For the moment, it is only used
for STREAM frames via qcc_recv(), but soon it will be implemented for
other frames types which can also be used to open a new stream.
qcs_new() and qcs_free() has been restricted to the MUX QUIC only as
they are now reserved for internal usage.
This change is a pure refactoring and should not have any noticeable
impact. It clarifies the developer intent and help to ensure that a
stream is not automatically opened when not desired.
diff --git a/src/h3.c b/src/h3.c
index 60c003b..eb930af 100644
--- a/src/h3.c
+++ b/src/h3.c
@@ -1081,7 +1081,7 @@
struct h3c *h3c = ctx;
struct qcs *qcs;
- qcs = qcs_new(h3c->qcc, 0x3, QCS_SRV_UNI);
+ qcs = qcc_open_stream_local(h3c->qcc, 0);
if (!qcs)
return 0;