MINOR: mux-quic/h3: send SETTINGS as soon as transport is ready
As specified by HTTP3 RFC, SETTINGS frame should be sent as soon as
possible. Before this patch, this was only done on the first qc_send()
invocation. This delay significantly SETTINGS emission until the first
H3 response is ready to be transferred.
This patch fixes this by ensuring SETTINGS is emitted when MUX-QUIC is
being setup.
As a side point, return value of finalize operation is checked. This
means that an error during SETTINGS emission will cause the connection
init to fail.
This should be backported up to 2.7.
diff --git a/src/h3.c b/src/h3.c
index f7bd8a1..9a1d97d 100644
--- a/src/h3.c
+++ b/src/h3.c
@@ -1636,6 +1636,10 @@
TRACE_LEAVE(H3_EV_H3S_END, qcs->qcc->conn, qcs);
}
+/* Initialize H3 control stream and prepare SETTINGS emission.
+ *
+ * Returns 0 on success else non-zero.
+ */
static int h3_finalize(void *ctx)
{
struct h3c *h3c = ctx;
@@ -1643,12 +1647,12 @@
qcs = qcc_init_stream_local(h3c->qcc, 0);
if (!qcs)
- return 0;
+ return 1;
h3_control_send(qcs, h3c);
h3c->ctrl_strm = qcs;
- return 1;
+ return 0;
}
/* Generate a GOAWAY frame for <h3c> connection on the control stream.