]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Fix a regression with 2.2.31 that caused inherited workers to
authorRuediger Pluem <rpluem@apache.org>
Tue, 1 Sep 2015 07:31:11 +0000 (07:31 +0000)
committerRuediger Pluem <rpluem@apache.org>
Tue, 1 Sep 2015 07:31:11 +0000 (07:31 +0000)
  use a different scoreboard slot then the original one.
  This has no trunk revision since this a 2.2.x issue only and trunk
  code is different.

PR: 58267
Reviewed by: rpluem, jkaluza, ylavic

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1700408 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
include/ap_mmn.h
modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index bd8b050ffe2ed5f19c540573635e0ed77b2f36e0..da18f97942f772f392ae1bcb10a1b8b65b0b0802 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.32
 
-
+  *) mod_proxy: Fix a regression with 2.2.31 that caused inherited workers to
+     use a different scoreboard slot then the original one.  PR 58267.
+     [Ruediger Pluem]
 
 Changes with Apache 2.2.31
 
diff --git a/STATUS b/STATUS
index 607e45343bf5c4ba2389c15ecb3c696f6be3e61a..167fcaf4ea51fe365022dd067bf82ecd2207da4d 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -112,15 +112,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.2.x patch: http://people.apache.org/~sf/SSL_CTX_use_certificate_clear_errors.diff
      +1: sf, rpluem, ylavic
 
-  *) mod_proxy: Fix a regression with 2.2.31 that caused inherited workers to
-     use a different scoreboard slot then the original one.
-     PR 58267
-     Trunk version of patch:
-        None, only 2.2.x specific
-     Backport version for 2.2.x of patch:
-        http://people.apache.org/~rpluem/patches/pr58267.diff
-     +1: rpluem, jkaluza, ylavic
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index d532d7e61fa4df4865ced89874338436a9e91db3..29227d53f4c63268965fdaf4153e00945bccabce 100644 (file)
  * 20051115.38 (2.2.30) Add ap_proxy_set_scoreboard_lb() in mod_proxy.h
  * 20051115.39 (2.2.30) Add ap_proxy_connection_reusable()
  * 20051115.40 (2.2.30) Add ap_map_http_request_error()
+ * 20051115.41 (2.2.32) Add s member to proxy_server_conf struct and server
+ *                      member to proxy_worker struct.
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503232UL /* "AP22" */
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20051115
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 40                    /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 41                    /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
index b5e7fee2cc8288df19234f3960321edc6a6de3fa..6a484902ce29a2e1c03325e64d17c8e61b12d5de 100644 (file)
@@ -1129,6 +1129,7 @@ static void * create_proxy_config(apr_pool_t *p, server_rec *s)
     ps->badopt = bad_error;
     ps->badopt_set = 0;
     ps->pool = p;
+    ps->s = s;
 
     return ps;
 }
@@ -1172,6 +1173,7 @@ static void * merge_proxy_config(apr_pool_t *p, void *basev, void *overridesv)
     ps->proxy_status = (overrides->proxy_status_set == 0) ? base->proxy_status : overrides->proxy_status;
     ps->proxy_status_set = overrides->proxy_status_set || base->proxy_status_set;
     ps->pool = p;
+    ps->s = overrides->s;
     return ps;
 }
 
index 84a6c1a8e9f783a0271a538bd28e2db6ba2ef836..0c5ff3700cae1ac21bb416e5ade05bd0c100f213 100644 (file)
@@ -193,6 +193,7 @@ typedef struct {
     } proxy_status;             /* Status display options */
     char proxy_status_set;
     apr_pool_t *pool;           /* Pool used for allocating this struct */
+    server_rec *s;              /* The server_rec where this configuration was created in */
 } proxy_server_conf;
 
 
@@ -369,6 +370,7 @@ struct proxy_worker {
     char            disablereuse_set;
     apr_interval_time_t conn_timeout;
     char            conn_timeout_set;
+    server_rec      *server;    /* The server_rec where this configuration was created in */
 };
 
 /*
index 584c21d69adfadd0e4ab2fde71c10ab50eb43c81..e4e6371b915eed60d52c80ab8c797959263cfbf0 100644 (file)
@@ -1460,6 +1460,7 @@ PROXY_DECLARE(const char *) ap_proxy_add_worker(proxy_worker **worker,
     (*worker)->flush_packets = flush_off;
     (*worker)->flush_wait = PROXY_FLUSH_WAIT;
     (*worker)->smax = -1;
+    (*worker)->server = conf->s;
     /* Increase the total worker count */
     proxy_lb_workers++;
     init_conn_pool(p, *worker);
@@ -1807,6 +1808,7 @@ PROXY_DECLARE(void*) ap_proxy_set_scoreboard_lb(proxy_worker *worker,
                                                 server_rec *server)
 {
     if (ap_scoreboard_image && !worker->s) {
+        server_rec *id_server;
         int i = 0;
         proxy_worker_stat *free_slot = NULL;
         proxy_worker_stat *s;
@@ -1824,14 +1826,20 @@ PROXY_DECLARE(void*) ap_proxy_set_scoreboard_lb(proxy_worker *worker,
             apr_md5_update(&ctx, (unsigned char *)balancer->name,
                            strlen(balancer->name));
         }
-        if (server) {
+        if (worker->server) {
+            id_server = worker->server;
+        }
+        else {
+            id_server = server;
+        }
+        if (id_server) {
             server_addr_rec *addr;
             /* Assumes the unique identifier of a vhost is its address(es)
              * plus the ServerName:Port. Should two or more vhosts have this
              * same identifier, the first one would always be elected to
              * handle the requests, so this shouldn't be an issue...
              */
-            for (addr = server->addrs; addr; addr = addr->next) {
+            for (addr = id_server->addrs; addr; addr = addr->next) {
                 char host_ip[64]; /* for any IPv[46] string */
                 apr_sockaddr_ip_getbuf(host_ip, sizeof host_ip,
                                        addr->host_addr);
@@ -1840,10 +1848,10 @@ PROXY_DECLARE(void*) ap_proxy_set_scoreboard_lb(proxy_worker *worker,
                 apr_md5_update(&ctx, (unsigned char *)&addr->host_port,
                                sizeof(addr->host_port));
             }
-            apr_md5_update(&ctx, (unsigned char *)server->server_hostname,
-                           strlen(server->server_hostname));
-            apr_md5_update(&ctx, (unsigned char *)&server->port,
-                           sizeof(server->port));
+            apr_md5_update(&ctx, (unsigned char *)id_server->server_hostname,
+                           strlen(id_server->server_hostname));
+            apr_md5_update(&ctx, (unsigned char *)&id_server->port,
+                           sizeof(id_server->port));
         }
         apr_md5_final(digest, &ctx);