aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2024-02-12 09:50:59 +0000
committerTomas Mraz <tomas@openssl.org>2024-02-19 10:15:46 +0100
commite825599213119b8ff56b4bb4df40b898dd68572e (patch)
tree8c09210fdc00ac7cfcf96ea3213e7950c269b99d
parent6f09c8071af8328b1dac1914bea4533cac182204 (diff)
downloadopenssl-e825599213119b8ff56b4bb4df40b898dd68572e.tar.gz
QUIC CHANNEL: Defer QLOG instantiation until first event
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23535)
-rw-r--r--ssl/quic/quic_channel.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c
index be36d74399..aa0a67bd35 100644
--- a/ssl/quic/quic_channel.c
+++ b/ssl/quic/quic_channel.c
@@ -138,6 +138,14 @@ static QLOG *ch_get_qlog(QUIC_CHANNEL *ch)
#endif
}
+QUIC_NEEDS_LOCK
+static QLOG *ch_get_qlog_cb(void *arg)
+{
+ QUIC_CHANNEL *ch = arg;
+
+ return ch_get_qlog(ch);
+}
+
/*
* QUIC Channel Initialization and Teardown
* ========================================
@@ -173,9 +181,10 @@ static int ch_init(QUIC_CHANNEL *ch)
goto err;
/* We plug in a network write BIO to the QTX later when we get one. */
- qtx_args.libctx = ch->port->engine->libctx;
- qtx_args.qlog = ch_get_qlog(ch);
- qtx_args.mdpl = QUIC_MIN_INITIAL_DGRAM_LEN;
+ qtx_args.libctx = ch->port->engine->libctx;
+ qtx_args.get_qlog_cb = ch_get_qlog_cb;
+ qtx_args.get_qlog_cb_arg = ch;
+ qtx_args.mdpl = QUIC_MIN_INITIAL_DGRAM_LEN;
ch->rx_max_udp_payload_size = qtx_args.mdpl;
ch->ping_deadline = ossl_time_infinite();
@@ -266,7 +275,8 @@ static int ch_init(QUIC_CHANNEL *ch)
txp_args.cc_data = ch->cc_data;
txp_args.now = get_time;
txp_args.now_arg = ch;
- txp_args.qlog = ch_get_qlog(ch);
+ txp_args.get_qlog_cb = ch_get_qlog_cb;
+ txp_args.get_qlog_cb_arg = ch;
for (pn_space = QUIC_PN_SPACE_INITIAL; pn_space < QUIC_PN_SPACE_NUM; ++pn_space) {
ch->crypto_send[pn_space] = ossl_quic_sstream_new(INIT_CRYPTO_SEND_BUF_LEN);
@@ -3350,8 +3360,8 @@ int ossl_quic_channel_on_new_conn(QUIC_CHANNEL *ch, const BIO_ADDR *peer,
return 0;
/* Setup QLOG, which did not happen earlier due to lacking an Initial ODCID. */
- ossl_qtx_set0_qlog(ch->qtx, ch_get_qlog(ch));
- ossl_quic_tx_packetiser_set0_qlog(ch->txp, ch_get_qlog(ch));
+ ossl_qtx_set_qlog_cb(ch->qtx, ch_get_qlog_cb, ch);
+ ossl_quic_tx_packetiser_set_qlog_cb(ch->txp, ch_get_qlog_cb, ch);
/* Plug in secrets for the Initial EL. */
if (!ossl_quic_provide_initial_secret(ch->port->engine->libctx,