summaryrefslogtreecommitdiff
path: root/modules/proxy/proxy_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/proxy/proxy_util.c')
-rw-r--r--modules/proxy/proxy_util.c58
1 files changed, 30 insertions, 28 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c
index 81eb944ab5..64e0cfd7ea 100644
--- a/modules/proxy/proxy_util.c
+++ b/modules/proxy/proxy_util.c
@@ -1785,38 +1785,40 @@ PROXY_DECLARE(void) ap_proxy_initialize_worker_share(proxy_server_conf *conf,
worker->name);
return;
}
- /* Get scoreboard slot */
- if (ap_scoreboard_image) {
- score = (proxy_worker_stat *) ap_get_scoreboard_lb(worker->id);
+ if (!worker->s) {
+ /* Get scoreboard slot */
+ if (ap_scoreboard_image) {
+ score = (proxy_worker_stat *) ap_get_scoreboard_lb(worker->id);
+ if (!score) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
+ "proxy: ap_get_scoreboard_lb(%d) failed in child %" APR_PID_T_FMT " for worker %s",
+ worker->id, getpid(), worker->name);
+ }
+ else {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ "proxy: grabbed scoreboard slot %d in child %" APR_PID_T_FMT " for worker %s",
+ worker->id, getpid(), worker->name);
+ }
+ }
if (!score) {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
- "proxy: ap_get_scoreboard_lb(%d) failed in child %" APR_PID_T_FMT " for worker %s",
- worker->id, getpid(), worker->name);
+ score = (proxy_worker_stat *) apr_pcalloc(conf->pool, sizeof(proxy_worker_stat));
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ "proxy: initialized plain memory in child %" APR_PID_T_FMT " for worker %s",
+ getpid(), worker->name);
}
- else {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
- "proxy: grabbed scoreboard slot %d in child %" APR_PID_T_FMT " for worker %s",
- worker->id, getpid(), worker->name);
+ worker->s = score;
+ /*
+ * recheck to see if we've already been here. Possible
+ * if proxy is using scoreboard to hold shared stats
+ */
+ if (PROXY_WORKER_IS_INITIALIZED(worker)) {
+ /* The worker share is already initialized */
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+ "proxy: worker %s already initialized",
+ worker->name);
+ return;
}
}
- if (!score) {
- score = (proxy_worker_stat *) apr_pcalloc(conf->pool, sizeof(proxy_worker_stat));
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
- "proxy: initialized plain memory in child %" APR_PID_T_FMT " for worker %s",
- getpid(), worker->name);
- }
- worker->s = score;
- /*
- * recheck to see if we've already been here. Possible
- * if proxy is using scoreboard to hold shared stats
- */
- if (PROXY_WORKER_IS_INITIALIZED(worker)) {
- /* The worker share is already initialized */
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
- "proxy: worker %s already initialized",
- worker->name);
- return;
- }
if (worker->route) {
strcpy(worker->s->route, worker->route);
}