From: Amaury Denoyelle Date: Mon, 8 Apr 2024 13:25:56 +0000 (+0200) Subject: MINOR: quic: simplify qc_send_hdshk_pkts() return X-Git-Tag: v3.0-dev8~109 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=44eec848e84cc2533f9b412950e297771979d9e1;p=thirdparty%2Fhaproxy.git MINOR: quic: simplify qc_send_hdshk_pkts() return Clean up trailer of qc_send_hdshk_pkts() by removing label "leave". Only "out" label is now used. This operation is safe as LIST_DEL_INIT() is idempotent. Caller of qc_send_hdshk_pkts() also ensures input frame lists are freed, so it's better to always reset quic_enc_level member. Also take the opportunity to reset QUIC_FL_CONN_RETRANS_OLD_DATA only if already set. This is considered more robust and will also remove unneeded trace occurences. No functional change. The main objective of this commit is to clean up code in preparation of a refactoring on send functions. --- diff --git a/src/quic_tx.c b/src/quic_tx.c index 94646a68d2..356bc4a818 100644 --- a/src/quic_tx.c +++ b/src/quic_tx.c @@ -911,7 +911,7 @@ int qc_send_hdshk_pkts(struct quic_conn *qc, int old_data, if (!buf) { TRACE_ERROR("buffer allocation failed", QUIC_EV_CONN_TXPKT, qc); - goto leave; + goto out; } if (b_data(buf) && !qc_purge_txbuf(qc, buf)) { @@ -969,10 +969,12 @@ int qc_send_hdshk_pkts(struct quic_conn *qc, int old_data, qel2->retrans_frms = NULL; } - TRACE_STATE("no more need old data for probing", QUIC_EV_CONN_TXPKT, qc); - qc->flags &= ~QUIC_FL_CONN_RETRANS_OLD_DATA; - leave: - TRACE_LEAVE(QUIC_EV_CONN_TXPKT, qc); + if (old_data) { + TRACE_STATE("no more need old data for probing", QUIC_EV_CONN_TXPKT, qc); + qc->flags &= ~QUIC_FL_CONN_RETRANS_OLD_DATA; + } + + TRACE_DEVEL((status ? "leaving" : "leaving in error"), QUIC_EV_CONN_TXPKT, qc); return status; }