Commit e6df536c authored by Bradley Nicholes's avatar Bradley Nicholes
Browse files

Move the variable declarations to the beginning of the code blocks to avoid...

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
parent 6860c770
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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++;
+10 −7
Original line number Diff line number Diff line
@@ -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"));
+3 −1
Original line number Diff line number Diff line
@@ -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);