]> granicus.if.org Git - apache/commitdiff
mod_http2: fixing c->current_thread on slave connections, addresses PR 59542
authorStefan Eissing <icing@apache.org>
Tue, 17 May 2016 08:03:32 +0000 (08:03 +0000)
committerStefan Eissing <icing@apache.org>
Tue, 17 May 2016 08:03:32 +0000 (08:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1744203 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/http2/h2_ngn_shed.c
modules/http2/h2_task.c
modules/http2/h2_task.h
modules/http2/h2_worker.c

diff --git a/CHANGES b/CHANGES
index f69bdfb32640c41ec0d5ff529bf6b9c1104882d4..d2cf7279fd4bd3a53cba2803aa001bc93bec016d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_http2: tracking conn_rec->current_thread on slave connections, so
+     that mod_lua finds the correct one. Fixes PR 59542. [Stefan Eissing]
+     
   *) mod_proxy, mod_ssl: Handle SSLProxy* directives in <Proxy> sections,
      allowing per backend TLS configuration.  [Yann Ylavic]
 
index ed3459f0c8766129ee3282239562781ac484d245..805c7d97042a685b18e67807a9169bcecf883d60 100644 (file)
@@ -274,6 +274,12 @@ apr_status_t h2_ngn_shed_pull_task(h2_ngn_shed *shed,
         ngn->no_live++;
         *ptask = entry->task;
         entry->task->assigned = ngn;
+        /* task will now run in ngn's own thread. Modules like lua
+         * seem to require the correct thread set in the conn_rec.
+         * See PR 59542. */
+        if (entry->task->c && ngn->c) {
+            entry->task->c->current_thread = ngn->c->current_thread;
+        }
         return APR_SUCCESS;
     }
     
index 92029d894d6d15515664f11fa3bf66c3eb987994..36073f772cba4ab18556619665d83e0c9c51a7db 100644 (file)
@@ -625,7 +625,7 @@ void h2_task_set_io_blocking(h2_task *task, int blocking)
     task->blocking = blocking;
 }
 
-apr_status_t h2_task_do(h2_task *task)
+apr_status_t h2_task_do(h2_task *task, apr_thread_t *thread)
 {
     AP_DEBUG_ASSERT(task);
     
@@ -659,6 +659,7 @@ apr_status_t h2_task_do(h2_task *task)
     
     ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c,
                   "h2_task(%s): process connection", task->id);
+    task->c->current_thread = thread; 
     ap_run_process_connection(task->c);
     
     if (task->frozen) {
index 454bc376fe1bea7ccd9cf81dcdcecd5f384eb5a4..c9280388332404276cd42f92f04b8ff1a9d967e3 100644 (file)
@@ -101,7 +101,7 @@ h2_task *h2_task_create(conn_rec *c, const struct h2_request *req,
 
 void h2_task_destroy(h2_task *task);
 
-apr_status_t h2_task_do(h2_task *task);
+apr_status_t h2_task_do(h2_task *task, apr_thread_t *thread);
 
 void h2_task_set_response(h2_task *task, struct h2_response *response);
 
index e394298e7da05d8383199c48323835aacc7a4af8..44feac14ed5a6cd8d88b575ed096fe157d79e689 100644 (file)
@@ -43,7 +43,7 @@ static void* APR_THREAD_FUNC execute(apr_thread_t *thread, void *wctx)
         worker->get_next(worker, worker->ctx, &task, &sticky);
         while (task) {
         
-            h2_task_do(task);
+            h2_task_do(task, thread);
             /* report the task done and maybe get another one from the same
              * mplx (= master connection), if we can be sticky. 
              */