Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)
*/
QUIC_CHANNEL *ossl_quic_port_pop_incoming(QUIC_PORT *port);
+/*
+ * Delete any channels which are pending acceptance.
+ */
+void ossl_quic_port_drop_incoming(QUIC_PORT *port);
+
/*
* Queries and Accessors
* =====================
static void quic_free_listener(QCTX *ctx)
{
quic_unref_port_bios(ctx->ql->port);
+ ossl_quic_port_drop_incoming(ctx->ql->port);
ossl_quic_port_free(ctx->ql->port);
ossl_quic_engine_free(ctx->ql->engine);
ossl_crypto_mutex_free(&ctx->ql->mutex);
return ch;
}
+void ossl_quic_port_drop_incoming(QUIC_PORT *port)
+{
+ QUIC_CHANNEL *ch;
+ SSL *tls;
+
+ for (;;) {
+ ch = ossl_quic_port_pop_incoming(port);
+ if (ch == NULL)
+ break;
+
+ tls = ossl_quic_channel_get0_tls(ch);
+ ossl_quic_channel_free(ch);
+ SSL_free(tls);
+ }
+}
+
void ossl_quic_port_set_allow_incoming(QUIC_PORT *port, int allow_incoming)
{
port->allow_incoming = allow_incoming;