]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC CC: Tweaks
authorHugo Landau <hlandau@openssl.org>
Tue, 28 Mar 2023 07:00:53 +0000 (08:00 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 1 May 2023 10:03:54 +0000 (11:03 +0100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20423)

test/quic_cc_test.c

index 3eef4d64a206c07989cedbb7d3f0e504773dbb78..87f9e268d277ef74678e58e979dd02db2ae82bc4 100644 (file)
@@ -125,14 +125,14 @@ static int net_sim_init(struct net_sim *s,
     return 1;
 }
 
-static void net_sim_cleanup(struct net_sim *s)
+static void do_free(NET_PKT *pkt)
 {
-    NET_PKT *pkt;
-
-    while ((pkt = ossl_pqueue_NET_PKT_pop(s->pkts)) != NULL)
-        OPENSSL_free(pkt);
+    OPENSSL_free(pkt);
+}
 
-    ossl_pqueue_NET_PKT_free(s->pkts);
+static void net_sim_cleanup(struct net_sim *s)
+{
+    ossl_pqueue_NET_PKT_pop_free(s->pkts, do_free);
 }
 
 static int net_sim_process(struct net_sim *s, size_t skip_forward);
@@ -221,7 +221,7 @@ static int net_sim_process_one(struct net_sim *s, int skip_forward)
     if (ossl_time_compare(fake_time, pkt->determination_time) < 0)
         return 2;
 
-    if (!ossl_assert(!pkt->success || pkt->arrived))
+    if (!TEST_true(!pkt->success || pkt->arrived))
         return 0;
 
     if (!pkt->success) {