diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index 0c22b86ee7bebd..faa8972c0df22c 100644 --- a/ssl/quic/quic_channel.c +++ b/ssl/quic/quic_channel.c @@ -1870,12 +1870,12 @@ void ossl_quic_channel_subtick(QUIC_CHANNEL *ch, QUIC_TICK_RESULT *res, * - determine the time at which we should next be ticked. */ - /* Nothing to do yet if connection has not been started. */ - if (ch->state == QUIC_CHANNEL_STATE_IDLE) - return; - - /* If we are in the TERMINATED state, there is nothing to do. */ - if (ossl_quic_channel_is_terminated(ch)) { + /* + * If the connection has not yet started, or we are in the TERMINATED state, + * there is nothing to do. + */ + if (ch->state == QUIC_CHANNEL_STATE_IDLE + || ossl_quic_channel_is_terminated(ch)) { res->net_read_desired = 0; res->net_write_desired = 0; res->notify_other_threads = 0; diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 4c75d68617862f..3130704c51deb3 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -1301,14 +1301,7 @@ int ossl_quic_handle_events(SSL *s) return 0; qctx_lock(&ctx); - /* - * TODO(QUIC SERVER): We should always tick the engine, whether the current - * connection is started or not. When ticking the engine, we MUST avoid - * inadvertently starting connections that haven't started, the guards - * don't belong here. - */ - if (ctx.qc == NULL || ctx.qc->started) - ossl_quic_reactor_tick(ossl_quic_obj_get0_reactor(ctx.obj), 0); + ossl_quic_reactor_tick(ossl_quic_obj_get0_reactor(ctx.obj), 0); qctx_unlock(&ctx); return 1; } @@ -4782,6 +4775,9 @@ int ossl_quic_conn_poll_events(SSL *ssl, uint64_t events, int do_tick, qctx_lock(&ctx); + if (do_tick) + ossl_quic_reactor_tick(ossl_quic_channel_get_reactor(ctx.qc->ch), 0); + if (!ctx.qc->started) { /* We can only try to write on non-started connection. */ if ((events & SSL_POLL_EVENT_W) != 0) @@ -4789,9 +4785,6 @@ int ossl_quic_conn_poll_events(SSL *ssl, uint64_t events, int do_tick, goto end; } - if (do_tick) - ossl_quic_reactor_tick(ossl_quic_channel_get_reactor(ctx.qc->ch), 0); - if (ctx.xso != NULL) { /* SSL object has a stream component. */