diff --git a/modules/http3/h3_io.c b/modules/http3/h3_io.c index 78bcb4cefe8..f70781d6581 100644 --- a/modules/http3/h3_io.c +++ b/modules/http3/h3_io.c @@ -266,6 +266,9 @@ static apr_status_t spawn_serviced_session(h3_io_t* io, h3q_conn* conn) { apr_allocator_t* allocator = NULL; apr_pool_t* session_pool = NULL; + apr_thread_mutex_t* alloc_mutex = NULL; + h3_session* session = NULL; + conn_rec* c; if (apr_allocator_create(&allocator) != APR_SUCCESS || apr_pool_create_ex(&session_pool, io->pool, NULL, allocator) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, io->server, "failed to create session pool for new connection"); @@ -277,16 +280,7 @@ static apr_status_t spawn_serviced_session(h3_io_t* io, h3q_conn* conn) return APR_EGENERAL; } apr_allocator_owner_set(allocator, session_pool); - { - apr_thread_mutex_t* alloc_mutex; - if (apr_thread_mutex_create(&alloc_mutex, APR_THREAD_MUTEX_DEFAULT, session_pool) == APR_SUCCESS) - { - apr_allocator_mutex_set(allocator, alloc_mutex); - } - } apr_pool_tag(session_pool, "h3_session"); - /* Workers allocate from stream subpools while this thread makes its own: share the allocator safely. */ - apr_thread_mutex_t* alloc_mutex = NULL; if (apr_thread_mutex_create(&alloc_mutex, APR_THREAD_MUTEX_DEFAULT, session_pool) != APR_SUCCESS) { apr_pool_destroy(session_pool); @@ -295,7 +289,6 @@ static apr_status_t spawn_serviced_session(h3_io_t* io, h3q_conn* conn) } apr_allocator_mutex_set(allocator, alloc_mutex); - h3_session* session = NULL; if (h3_session_create(&session, io->server, conn, session_pool) != APR_SUCCESS) { h3q_conn_free(conn); @@ -312,7 +305,7 @@ static apr_status_t spawn_serviced_session(h3_io_t* io, h3q_conn* conn) h3_session_destroy(session); return APR_EGENERAL; } - conn_rec* c = h3_synth_conn(session); + c = h3_synth_conn(session); if (!c) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, io->server, "h3_synth_conn failed");