Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22674)
/* Gets the mutex used by the port. */
CRYPTO_MUTEX *ossl_quic_port_get0_mutex(QUIC_PORT *port);
+/* Gets the current time. */
+OSSL_TIME ossl_quic_port_get_time(QUIC_PORT *port);
+
# endif
#endif
CRYPTO_MUTEX *ossl_quic_channel_get_mutex(QUIC_CHANNEL *ch)
{
- return ch->port->mutex;
+ return ossl_quic_port_get0_mutex(ch->port);
}
int ossl_quic_channel_has_pending(const QUIC_CHANNEL *ch)
{
QUIC_CHANNEL *ch = arg;
- if (ch->port->now_cb == NULL)
- return ossl_time_now();
-
- return ch->port->now_cb(ch->port->now_cb_arg);
+ return ossl_quic_port_get_time(ch->port);
}
/* Used by QSM. */
return port->mutex;
}
-static OSSL_TIME get_time(void *arg)
+OSSL_TIME ossl_quic_port_get_time(QUIC_PORT *port)
{
- QUIC_PORT *port = arg;
-
if (port->now_cb == NULL)
return ossl_time_now();
return port->now_cb(port->now_cb_arg);
}
+static OSSL_TIME get_time(void *port)
+{
+ return ossl_quic_port_get_time(port);
+}
+
+
/*
* QUIC Port: Network BIO Configuration
* ====================================