Skip to content

Commit 90d0a8c

Browse files
committed
MINOR: quic: simplify qc_prep_pkts() exit path
1 parent adf76aa commit 90d0a8c

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
@@ -658,6 +658,7 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf,
658658

659659
if (err == QC_BUILD_PKT_ERR_ALLOC || err == QC_BUILD_PKT_ERR_ENCRYPT)
660660
goto leave;
661+
first_pkt = NULL;
661662
goto out;
662663
}
663664

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

694695
/* Build only one datagram when an immediate close is required. */
695-
if (cc) {
696-
qc_txb_store(buf, dglen, first_pkt);
696+
if (cc)
697697
goto out;
698-
}
699698

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

744+
out:
745745
if (first_pkt)
746746
qc_txb_store(buf, wrlen, first_pkt);
747747

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

0 commit comments

Comments
 (0)