httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r788718 - /httpd/httpd/trunk/modules/proxy/proxy_util.c
Date Fri, 26 Jun 2009 14:26:19 GMT
Author: jfclere
Date: Fri Jun 26 14:26:19 2009
New Revision: 788718

URL: http://svn.apache.org/viewvc?rev=788718&view=rev
Log:
Don't set worker->s if already set (for balancer using slotmem for examples).

Modified:
    httpd/httpd/trunk/modules/proxy/proxy_util.c

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=788718&r1=788717&r2=788718&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Fri Jun 26 14:26:19 2009
@@ -1785,38 +1785,40 @@
               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);
     }



Mime
View raw message