Skip to content

Commit e10173b

Browse files
committed
MINOR: quic: simplify qc_prep_pkts() exit path
1 parent 23a3301 commit e10173b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/quic_tx.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf,
659659

660660
if (err == QC_BUILD_PKT_ERR_ALLOC || err == QC_BUILD_PKT_ERR_ENCRYPT)
661661
goto leave;
662+
first_pkt = NULL;
662663
goto out;
663664
}
664665

@@ -693,10 +694,8 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf,
693694
BUG_ON(padding && !next_qel);
694695

695696
/* Build only one datagram when an immediate close is required. */
696-
if (cc) {
697-
qc_txb_store(buf, dglen, first_pkt);
697+
if (cc)
698698
goto out;
699-
}
700699

701700
/* Only one short packet by datagram when probing. */
702701
if (probe && qel == qc->ael)
@@ -743,10 +742,10 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf,
743742
TRACE_DEVEL("next encryption level", QUIC_EV_CONN_PHPKTS, qc);
744743
}
745744

745+
out:
746746
if (first_pkt)
747747
qc_txb_store(buf, wrlen, first_pkt);
748748

749-
out:
750749
if (cc && total) {
751750
BUG_ON(buf != &qc->tx.cc_buf);
752751
BUG_ON(dglen != total);

0 commit comments

Comments
 (0)