summaryrefslogtreecommitdiff
path: root/modules/http2
diff options
context:
space:
mode:
authorStefan Eissing <icing@apache.org>2022-04-21 11:21:50 +0000
committerStefan Eissing <icing@apache.org>2022-04-21 11:21:50 +0000
commitc66e6eb96866f319ccb398bbdc449099879cadea (patch)
tree31986c4a2830158b2cdfa4bcbb7a98a0b6afbe82 /modules/http2
parent1c1d4824722daefb62bc19cfce23b6ad81aeb3f4 (diff)
downloadhttpd-c66e6eb96866f319ccb398bbdc449099879cadea.tar.gz
*) mod_http2: clear the h2 worker slot connection early to avoid
any race in slot updates after the connection has been handled. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900104 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http2')
-rw-r--r--modules/http2/h2_workers.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/http2/h2_workers.c b/modules/http2/h2_workers.c
index ec0889d234..22c31f4f83 100644
--- a/modules/http2/h2_workers.c
+++ b/modules/http2/h2_workers.c
@@ -254,6 +254,7 @@ static void slot_done(h2_slot *slot)
static void* APR_THREAD_FUNC slot_run(apr_thread_t *thread, void *wctx)
{
h2_slot *slot = wctx;
+ conn_rec *c;
/* Get the next c2 from mplx to process. */
while (get_next(slot)) {
@@ -287,13 +288,14 @@ static void* APR_THREAD_FUNC slot_run(apr_thread_t *thread, void *wctx)
* configurations by mod_h2 alone.
*/
AP_DEBUG_ASSERT(slot->connection != NULL);
- slot->connection->id = (slot->connection->master->id << 8)^slot->id;
- slot->connection->current_thread = thread;
+ c = slot->connection;
+ slot->connection = NULL;
+ c->id = (c->master->id << 8)^slot->id;
+ c->current_thread = thread;
- ap_process_connection(slot->connection, ap_get_conn_socket(slot->connection));
+ ap_process_connection(c, ap_get_conn_socket(c));
- h2_mplx_worker_c2_done(slot->connection);
- slot->connection = NULL;
+ h2_mplx_worker_c2_done(c);
}
if (apr_atomic_read32(&slot->timed_out) == 0) {