From 19bad865793478a8e0e61001915c78af6c330b8d Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Wed, 22 Jan 2025 10:10:30 -0500 Subject: [PATCH] Remove vestigual accepted flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz Reviewed-by: Saša Nedvědický (Merged from https://github.com/openssl/openssl/pull/26361) --- ssl/quic/quic_impl.c | 5 +---- ssl/quic/quic_local.h | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index ec9c2452579..79bf0edc3c8 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -811,7 +811,7 @@ void ossl_quic_free(SSL *s) * Those don't hold a reference until they are accepted, so only drop * the count if the application has accepted them */ - if (ctx.qc->accepted == 1 && ctx.qc->listener != NULL) + if (ctx.qc->pending == 0 && ctx.qc->listener != NULL) SSL_free(&ctx.qc->listener->obj.ssl); if (ctx.qc->domain != NULL) SSL_free(&ctx.qc->domain->obj.ssl); @@ -4461,7 +4461,6 @@ SSL *ossl_quic_new_from_listener(SSL *ssl, uint64_t flags) qctx_unlock(&ctx); - qc->accepted = 1; return &qc->obj.ssl; err: @@ -4577,7 +4576,6 @@ SSL *ossl_quic_accept_connection(SSL *ssl, uint64_t flags) conn_ssl = ossl_quic_channel_get0_tls(new_ch); conn_ssl = SSL_CONNECTION_GET_USER_SSL(SSL_CONNECTION_FROM_SSL(conn_ssl)); qc = (QUIC_CONNECTION *)conn_ssl; - qc->accepted = 1; qc->listener = ctx.ql; qc->pending = 0; if (!SSL_up_ref(&ctx.ql->obj.ssl)) { @@ -4608,7 +4606,6 @@ static QUIC_CONNECTION *create_qc_from_incoming_conn(QUIC_LISTENER *ql, QUIC_CHA } ossl_quic_channel_get_peer_addr(ch, &qc->init_peer_addr); /* best effort */ - qc->accepted = 0; qc->listener = NULL; qc->pending = 1; qc->engine = ql->engine; diff --git a/ssl/quic/quic_local.h b/ssl/quic/quic_local.h index 14da9c4aa32..dd0c16b49f1 100644 --- a/ssl/quic/quic_local.h +++ b/ssl/quic/quic_local.h @@ -205,9 +205,6 @@ struct quic_conn_st { unsigned int addressed_mode_w : 1; unsigned int addressed_mode_r : 1; - /* Flag to indicate if this connection has been accepted */ - unsigned int accepted : 1; - /* Flag to indicate waiting on accept queue */ unsigned int pending : 1; -- 2.47.2