MINOR: quic: Code reordering to help in reviewing/modifying.
Reorder by increasing type the switch/case in qc_parse_pkt_frms()
which is the high level frame parser.
Add new STREAM_X frame types to support some tests with ngtcp2 client.
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 9c8ab29..e4e6b62 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -1519,6 +1519,32 @@
goto err;
switch (frm.type) {
+ case QUIC_FT_PADDING:
+ if (pos != end) {
+ TRACE_DEVEL("wrong frame", QUIC_EV_CONN_PRSHPKT, ctx->conn, pkt);
+ goto err;
+ }
+ break;
+ case QUIC_FT_PING:
+ break;
+ case QUIC_FT_ACK:
+ {
+ unsigned int rtt_sample;
+
+ rtt_sample = 0;
+ if (!qc_parse_ack_frm(&frm, ctx, qel, &rtt_sample, &pos, end))
+ goto err;
+
+ if (rtt_sample) {
+ unsigned int ack_delay;
+
+ ack_delay = !quic_application_pktns(qel->pktns, conn) ? 0 :
+ MS_TO_TICKS(QUIC_MIN(quic_ack_delay_ms(&frm.ack, conn), conn->max_ack_delay));
+ quic_loss_srtt_update(&conn->path->loss, rtt_sample, ack_delay, conn);
+ }
+ tasklet_wakeup(ctx->wait_event.tasklet);
+ break;
+ }
case QUIC_FT_CRYPTO:
if (frm.crypto.offset != qel->rx.crypto.offset) {
struct quic_rx_crypto_frm *cf;
@@ -1548,40 +1574,20 @@
pkt, &cf))
goto err;
}
- break;
- case QUIC_FT_PADDING:
- if (pos != end) {
- TRACE_DEVEL("wrong frame", QUIC_EV_CONN_PRSHPKT, ctx->conn, pkt);
- goto err;
- }
- break;
- case QUIC_FT_ACK:
- {
- unsigned int rtt_sample;
-
- rtt_sample = 0;
- if (!qc_parse_ack_frm(&frm, ctx, qel, &rtt_sample, &pos, end))
- goto err;
-
- if (rtt_sample) {
- unsigned int ack_delay;
-
- ack_delay = !quic_application_pktns(qel->pktns, conn) ? 0 :
- MS_TO_TICKS(min(quic_ack_delay_ms(&frm.ack, conn), conn->max_ack_delay));
- quic_loss_srtt_update(&conn->path->loss, rtt_sample, ack_delay, conn);
- }
- tasklet_wakeup(ctx->wait_event.tasklet);
break;
- }
- case QUIC_FT_PING:
+ case QUIC_FT_STREAM_8:
+ case QUIC_FT_STREAM_9:
+ case QUIC_FT_STREAM_A:
+ case QUIC_FT_STREAM_B:
+ case QUIC_FT_STREAM_C:
+ case QUIC_FT_STREAM_D:
+ case QUIC_FT_STREAM_E:
+ case QUIC_FT_STREAM_F:
+ case QUIC_FT_NEW_CONNECTION_ID:
break;
case QUIC_FT_CONNECTION_CLOSE:
case QUIC_FT_CONNECTION_CLOSE_APP:
break;
- case QUIC_FT_NEW_CONNECTION_ID:
- case QUIC_FT_STREAM_A:
- case QUIC_FT_STREAM_B:
- break;
case QUIC_FT_HANDSHAKE_DONE:
if (objt_listener(ctx->conn->target))
goto err;