From 7023fb05866cf3205d784024523f7d6bf0bddb23 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Thu, 17 Jan 2019 17:53:03 +0100 Subject: [PATCH 1/2] Fix for MODCLUSTER-690. Make sure the SIZEOFSCORE is bigger than sizeof(proxy_worker_shared). --- native/include/node.h | 6 +----- native/mod_proxy_cluster/mod_proxy_cluster.c | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/native/include/node.h b/native/include/node.h index 013118606..d527d161b 100644 --- a/native/include/node.h +++ b/native/include/node.h @@ -76,11 +76,7 @@ struct nodemess { }; typedef struct nodemess nodemess_t; -#if AP_MODULE_MAGIC_AT_LEAST(20101223,1) -#define SIZEOFSCORE 800 /* size of the proxy_worker_stat structure */ -#else -#define SIZEOFSCORE 200 /* size of the proxy_worker_stat structure */ -#endif +#define SIZEOFSCORE 1600 /* at least size of the proxy_worker_stat structure */ /* status of the node as read/store in httpd. */ struct nodeinfo { diff --git a/native/mod_proxy_cluster/mod_proxy_cluster.c b/native/mod_proxy_cluster/mod_proxy_cluster.c index 132484bbe..a7cdcbdce 100644 --- a/native/mod_proxy_cluster/mod_proxy_cluster.c +++ b/native/mod_proxy_cluster/mod_proxy_cluster.c @@ -2895,6 +2895,12 @@ static int proxy_cluster_post_config(apr_pool_t *p, apr_pool_t *plog, } #endif } + if (SIZEOFSCORE <= sizeof(proxy_worker_shared)) { + ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, + "SIZEOFSCORE too small for mod_proxy shared stat structure %d <= %d", + SIZEOFSCORE, sizeof(proxy_worker_shared)); + return HTTP_INTERNAL_SERVER_ERROR; + } /* Check that the mod_proxy_balancer.c is not loaded */ if (ap_find_linked_module("mod_proxy_balancer.c") != NULL) { From 3851d8d90a259593ffa34669bacb9d058d5ea04a Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Wed, 17 Apr 2019 09:06:04 +0200 Subject: [PATCH 2/2] Fix for MODCLUSTER-690. The other place where 1.3.x cores in httpd-trunk. --- native/mod_proxy_cluster/mod_proxy_cluster.c | 1 + 1 file changed, 1 insertion(+) diff --git a/native/mod_proxy_cluster/mod_proxy_cluster.c b/native/mod_proxy_cluster/mod_proxy_cluster.c index a7cdcbdce..37b919704 100644 --- a/native/mod_proxy_cluster/mod_proxy_cluster.c +++ b/native/mod_proxy_cluster/mod_proxy_cluster.c @@ -1645,6 +1645,7 @@ static void update_workers_lbstatus(proxy_server_conf *conf, apr_pool_t *pool, s #if AP_MODULE_MAGIC_AT_LEAST(20101223,1) rnew->connection->log_id = "-"; rnew->log_id = "-"; + rnew->connection->conn_config = ap_create_conn_config(rrp); rnew->useragent_addr = apr_pcalloc(rrp, sizeof(apr_sockaddr_t)); #endif rnew->per_dir_config = server->lookup_defaults;