From: Bradley Nicholes Date: Mon, 1 Dec 2008 18:11:48 +0000 (+0000) Subject: Move the variable declarations to the beginning of the code blocks to avoid compiler... X-Git-Tag: 2.3.0~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7157a639be6337b2cdb33752f284d3dfff88a13;p=thirdparty%2Fapache%2Fhttpd.git Move the variable declarations to the beginning of the code blocks to avoid compiler errors on netware. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722155 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cluster/mod_heartbeat.c b/modules/cluster/mod_heartbeat.c index 77f08be824e..8c59508a688 100644 --- a/modules/cluster/mod_heartbeat.c +++ b/modules/cluster/mod_heartbeat.c @@ -61,11 +61,13 @@ static int hb_monitor(hb_ctx_t *ctx, apr_pool_t *p) 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++; diff --git a/modules/cluster/mod_heartmonitor.c b/modules/cluster/mod_heartmonitor.c index 9d642b6c2fb..5e5b562b9ba 100644 --- a/modules/cluster/mod_heartmonitor.c +++ b/modules/cluster/mod_heartmonitor.c @@ -145,6 +145,8 @@ static apr_status_t hm_update_stats(hm_ctx_t *ctx, apr_pool_t *p) { 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 @@ static apr_status_t hm_update_stats(hm_ctx_t *ctx, apr_pool_t *p) 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 @@ static apr_status_t hm_recv(hm_ctx_t *ctx, apr_pool_t *p) { 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 @@ static apr_status_t hm_recv(hm_ctx_t *ctx, apr_pool_t *p) buf[len] = '\0'; - apr_table_t *tbl; - tbl = apr_table_make(p, 10); qs_to_table(buf, tbl, p); @@ -250,6 +252,7 @@ static apr_status_t hm_recv(hm_ctx_t *ctx, apr_pool_t *p) 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 @@ static apr_status_t hm_recv(hm_ctx_t *ctx, apr_pool_t *p) 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")); diff --git a/modules/filters/mod_ratelimit.c b/modules/filters/mod_ratelimit.c index e4cc15076d1..996797d2ce8 100644 --- a/modules/filters/mod_ratelimit.c +++ b/modules/filters/mod_ratelimit.c @@ -71,13 +71,15 @@ rate_limit_filter(ap_filter_t *f, apr_bucket_brigade *input_bb) 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);