Skip to content

Commit 0b7fff8

Browse files
a-denoyellehaproxyFred
authored andcommitted
MINOR: quic: simplify qc_prep_pkts() exit path
1 parent 217e467 commit 0b7fff8

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

670670
if (err == QC_BUILD_PKT_ERR_ALLOC || err == QC_BUILD_PKT_ERR_ENCRYPT)
671671
goto leave;
672+
first_pkt = NULL;
672673
goto out;
673674
}
674675

@@ -703,10 +704,8 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf,
703704
BUG_ON(padding && !next_qel);
704705

705706
/* Build only one datagram when an immediate close is required. */
706-
if (cc) {
707-
qc_txb_store(buf, dglen, first_pkt);
707+
if (cc)
708708
goto out;
709-
}
710709

711710
/* Only one short packet by datagram when probing. */
712711
if (probe && qel == qc->ael)
@@ -753,10 +752,10 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf,
753752
TRACE_DEVEL("next encryption level", QUIC_EV_CONN_PHPKTS, qc);
754753
}
755754

755+
out:
756756
if (first_pkt)
757757
qc_txb_store(buf, wrlen, first_pkt);
758758

759-
out:
760759
if (cc && total) {
761760
BUG_ON(buf != &qc->tx.cc_buf);
762761
BUG_ON(dglen != total);

0 commit comments

Comments
 (0)