Skip to content

Commit 1fc67fa

Browse files
committed
Don't keep creating CONNECTION_CLOSE frames
If we want to send a CONNECTION_CLOSE frame then one is enough unless we are scheduled to send another one. Now that we can create more than one datagram in one go this is now required.
1 parent 293baa3 commit 1fc67fa

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

include/internal/quic_txpim.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ typedef struct quic_txpim_pkt_st {
4040
unsigned int had_max_streams_bidi_frame : 1;
4141
unsigned int had_max_streams_uni_frame : 1;
4242
unsigned int had_ack_frame : 1;
43+
unsigned int had_conn_close : 1;
4344

4445
/* Private data follows. */
4546
} QUIC_TXPIM_PKT;

ssl/quic/quic_txp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,7 @@ static int txp_generate_pre_token(OSSL_QUIC_TX_PACKETISER *txp,
18061806
if (!tx_helper_commit(h))
18071807
return 0;
18081808

1809+
tpkt->had_conn_close = 1;
18091810
*can_be_non_inflight = 0;
18101811
} else {
18111812
tx_helper_rollback(h);
@@ -2946,6 +2947,9 @@ static int txp_pkt_commit(OSSL_QUIC_TX_PACKETISER *txp,
29462947
if (tpkt->had_ack_frame)
29472948
txp->want_ack &= ~(1UL << pn_space);
29482949

2950+
if (tpkt->had_conn_close)
2951+
txp->want_conn_close = 0;
2952+
29492953
/*
29502954
* Decrement probe request counts if we have sent a packet that meets
29512955
* the requirement of a probe, namely being ACK-eliciting.

ssl/quic/quic_txpim.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ static void txpim_clear(QUIC_TXPIM_PKT_EX *ex)
115115
ex->public.had_max_streams_bidi_frame = 0;
116116
ex->public.had_max_streams_uni_frame = 0;
117117
ex->public.had_ack_frame = 0;
118+
ex->public.had_conn_close = 0;
118119
}
119120

120121
QUIC_TXPIM_PKT *ossl_quic_txpim_pkt_alloc(QUIC_TXPIM *txpim)

0 commit comments

Comments
 (0)