You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by bn...@apache.org on 2008/12/01 19:11:49 UTC

svn commit: r722155 - in /httpd/httpd/trunk/modules: cluster/mod_heartbeat.c cluster/mod_heartmonitor.c filters/mod_ratelimit.c

Author: bnicholes
Date: Mon Dec  1 10:11:48 2008
New Revision: 722155

URL: http://svn.apache.org/viewvc?rev=722155&view=rev
Log:
Move the variable declarations to the beginning of the code blocks to avoid compiler errors on netware.

Modified:
    httpd/httpd/trunk/modules/cluster/mod_heartbeat.c
    httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c
    httpd/httpd/trunk/modules/filters/mod_ratelimit.c

Modified: httpd/httpd/trunk/modules/cluster/mod_heartbeat.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cluster/mod_heartbeat.c?rev=722155&r1=722154&r2=722155&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cluster/mod_heartbeat.c (original)
+++ httpd/httpd/trunk/modules/cluster/mod_heartbeat.c Mon Dec  1 10:11:48 2008
@@ -61,11 +61,13 @@
         ps = ap_get_scoreboard_process(i);
 
         for (j = 0; j < ctx->thread_limit; j++) {
+            int res;
+
             worker_score *ws = NULL;
 
             ws = &ap_scoreboard_image->servers[i][j];
 
-            int res = ws->status;
+            res = ws->status;
 
             if (res == SERVER_READY && ps->generation == ap_my_generation) {
                 ready++;

Modified: httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c?rev=722155&r1=722154&r2=722155&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c (original)
+++ httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c Mon Dec  1 10:11:48 2008
@@ -145,6 +145,8 @@
 {
     apr_status_t rv;
     apr_file_t *fp;
+    apr_hash_index_t *hi;
+    apr_time_t now;
     char *path = apr_pstrcat(p, ctx->storage_path, ".tmp.XXXXXX", NULL);
     /* TODO: Update stats file (!) */
     rv = apr_file_mktemp(&fp, path, APR_CREATE | APR_WRITE, p);
@@ -155,13 +157,13 @@
         return rv;
     }
 
-    apr_hash_index_t *hi;
-    apr_time_t now = apr_time_now();
+    now = apr_time_now();
     for (hi = apr_hash_first(p, ctx->servers);
          hi != NULL; hi = apr_hash_next(hi)) {
         hm_server_t *s = NULL;
+        apr_uint32_t seen;
         apr_hash_this(hi, NULL, NULL, (void **) &s);
-        apr_uint32_t seen = apr_time_sec(now - s->seen);
+        seen = apr_time_sec(now - s->seen);
         if (seen > SEEN_TIMEOUT) {
             /*
              * Skip this entry from the heartbeat file -- when it comes back,
@@ -221,9 +223,11 @@
 {
     char buf[MAX_MSG_LEN + 1];
     apr_sockaddr_t from;
-    from.pool = p;
     apr_size_t len = MAX_MSG_LEN;
     apr_status_t rv;
+    apr_table_t *tbl;
+
+    from.pool = p;
 
     rv = apr_socket_recvfrom(&from, ctx->sock, 0, buf, &len);
 
@@ -240,8 +244,6 @@
 
     buf[len] = '\0';
 
-    apr_table_t *tbl;
-
     tbl = apr_table_make(p, 10);
 
     qs_to_table(buf, tbl, p);
@@ -250,6 +252,7 @@
         apr_table_get(tbl, "busy") != NULL &&
         apr_table_get(tbl, "ready") != NULL) {
         char *ip;
+        hm_server_t *s;
         /* TODO: REMOVE ME BEFORE PRODUCTION (????) */
         ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, NULL,
                      "Heartmonitor: %pI busy=%s ready=%s", &from,
@@ -257,7 +260,7 @@
 
         apr_sockaddr_ip_get(&ip, &from);
 
-        hm_server_t *s = hm_get_server(ctx, ip);
+        s = hm_get_server(ctx, ip);
 
         s->busy = atoi(apr_table_get(tbl, "busy"));
         s->ready = atoi(apr_table_get(tbl, "ready"));

Modified: httpd/httpd/trunk/modules/filters/mod_ratelimit.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_ratelimit.c?rev=722155&r1=722154&r2=722155&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_ratelimit.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_ratelimit.c Mon Dec  1 10:11:48 2008
@@ -71,13 +71,15 @@
 
     if (ctx == NULL) {
 
+        const char *rl = NULL;
+
         /* no subrequests. */
         if (f->r->main != NULL) {
             ap_remove_output_filter(f);
             return ap_pass_brigade(f->next, bb);
         }
 
-        const char *rl = apr_table_get(f->r->subprocess_env, "rate-limit");
+        rl = apr_table_get(f->r->subprocess_env, "rate-limit");
 
         if (rl == NULL) {
             ap_remove_output_filter(f);