QUIC CONFORMANCE: Wire the DATA_SENT state
authorHugo Landau <hlandau@openssl.org>
Tue, 6 Jun 2023 15:25:12 +0000 (16:25 +0100)
committerPauli <pauli@openssl.org>
Sun, 16 Jul 2023 22:17:57 +0000 (08:17 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)

ssl/quic/quic_txp.c

index dcfdca22649a2e6b31a618cc07203e1e7db78f24..313c2fef3628705a03f7602ad60b053f0b6ed1c4 100644 (file)
@@ -2372,8 +2372,16 @@ static int txp_generate_for_el_actual(OSSL_QUIC_TX_PACKETISER *txp,
          */
         ossl_quic_stream_map_update_state(txp->args.qsm, stream);
 
-        if (stream->txp_drained)
+        if (stream->txp_drained) {
             assert(!ossl_quic_sstream_has_pending(stream->sstream));
+
+            /*
+             * Transition to DATA_SENT if stream has a final size and we have
+             * sent all data.
+             */
+            if (ossl_quic_sstream_get_final_size(stream->sstream, NULL))
+                ossl_quic_stream_map_notify_all_data_sent(txp->args.qsm, stream);
+        }
     }
 
     /* We have now sent the packet, so update state accordingly. */