From a55d8b8b718226d078c20ea0a1d077dd69763f9d Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Tue, 9 Apr 2024 08:44:11 +0100 Subject: [PATCH] QUIC APL: Connection acceptance is an I/O operation Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/24037) --- doc/man3/SSL_new_listener.pod | 3 +++ ssl/quic/quic_impl.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/man3/SSL_new_listener.pod b/doc/man3/SSL_new_listener.pod index df869e0753..967b169cb0 100644 --- a/doc/man3/SSL_new_listener.pod +++ b/doc/man3/SSL_new_listener.pod @@ -139,6 +139,9 @@ L). It is expected that the listener interface, which provides an abstracted API for connection acceptance, will be expanded to support other protocols, such as TLS over TCP, plain TCP or DTLS in future. +SSL_listen() and SSL_accept_connection() are "I/O" functions, meaning that they +update the value returned by L if they fail. + =head1 CLIENT-ONLY USAGE It is also possible to use the listener interface without accepting any diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 0765418d7d..04c4b6fa4b 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -4210,7 +4210,7 @@ int ossl_quic_listen(SSL *ssl) if (!expect_quic_listener(ssl, &ctx)) return 0; - qctx_lock(&ctx); + qctx_lock_for_io(&ctx); ret = ql_listen(ctx.ql); @@ -4247,7 +4247,7 @@ SSL *ossl_quic_accept_connection(SSL *ssl, uint64_t flags) if (!expect_quic_listener(ssl, &ctx)) return NULL; - qctx_lock(&ctx); + qctx_lock_for_io(&ctx); if (!ql_listen(ctx.ql)) goto out;