QUIC POLLING: Implement autotick

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23495)
This commit is contained in:
Hugo Landau 2024-02-02 12:30:41 +00:00
parent f945986a18
commit 9387bd4c25
3 changed files with 8 additions and 11 deletions

View File

@ -143,7 +143,8 @@ int ossl_quic_get_shutdown(const SSL *s);
int ossl_quic_set_diag_title(SSL_CTX *ctx, const char *title); int ossl_quic_set_diag_title(SSL_CTX *ctx, const char *title);
/* APIs used by the polling infrastructure */ /* APIs used by the polling infrastructure */
int ossl_quic_conn_poll_events(SSL *ssl, uint64_t events, uint64_t *revents); int ossl_quic_conn_poll_events(SSL *ssl, uint64_t events, int do_tick,
uint64_t *revents);
# endif # endif

View File

@ -3921,7 +3921,8 @@ static int test_poll_event_os(QUIC_CONNECTION *qc, int is_uni)
} }
QUIC_TAKES_LOCK QUIC_TAKES_LOCK
int ossl_quic_conn_poll_events(SSL *ssl, uint64_t events, uint64_t *p_revents) int ossl_quic_conn_poll_events(SSL *ssl, uint64_t events, int do_tick,
uint64_t *p_revents)
{ {
QCTX ctx; QCTX ctx;
uint64_t revents = 0; uint64_t revents = 0;
@ -3931,6 +3932,9 @@ int ossl_quic_conn_poll_events(SSL *ssl, uint64_t events, uint64_t *p_revents)
quic_lock(ctx.qc); quic_lock(ctx.qc);
if (do_tick)
ossl_quic_reactor_tick(ossl_quic_channel_get_reactor(ctx.qc->ch), 0);
if (ctx.xso != NULL) { if (ctx.xso != NULL) {
/* SSL object has a stream component. */ /* SSL object has a stream component. */

View File

@ -61,13 +61,6 @@ int SSL_poll(SSL_POLL_ITEM *items,
FAIL_FROM(0); FAIL_FROM(0);
} }
if (do_tick) {
ERR_raise_data(ERR_LIB_SSL, SSL_R_POLL_REQUEST_NOT_SUPPORTED,
"SSL_poll does not currently support implicit I/O "
"processing");
FAIL_FROM(0);
}
/* Trivial case. */ /* Trivial case. */
if (num_items == 0) if (num_items == 0)
goto out; goto out;
@ -88,7 +81,7 @@ int SSL_poll(SSL_POLL_ITEM *items,
switch (ssl->type) { switch (ssl->type) {
case SSL_TYPE_QUIC_CONNECTION: case SSL_TYPE_QUIC_CONNECTION:
case SSL_TYPE_QUIC_XSO: case SSL_TYPE_QUIC_XSO:
if (!ossl_quic_conn_poll_events(ssl, events, &revents)) if (!ossl_quic_conn_poll_events(ssl, events, do_tick, &revents))
/* above call raises ERR */ /* above call raises ERR */
FAIL_ITEM(i); FAIL_ITEM(i);
@ -121,7 +114,6 @@ int SSL_poll(SSL_POLL_ITEM *items,
/* TODO(QUIC POLLING): Blocking mode */ /* TODO(QUIC POLLING): Blocking mode */
/* TODO(QUIC POLLING): Support for polling FDs */ /* TODO(QUIC POLLING): Support for polling FDs */
/* TODO(QUIC POLLING): Support for autotick */
out: out:
if (p_result_count != NULL) if (p_result_count != NULL)