Commit a366db60 authored by Mladen Turk's avatar Mladen Turk
Browse files

Add server_rec to initialize_worker_share so that it get's

correctly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105345 13f79535-47bb-0310-9956-ffa450edef68
parent 21a2aa06
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -420,17 +420,18 @@ PROXY_DECLARE(proxy_worker *) ap_proxy_create_worker(apr_pool_t *p);
/**
 * Initize the worker's shared data
 * @param conf   current proxy server configuration
 * @param worker worker to initialize
 * @param s      current server record
 * @param worker worker to initialize
 */
PROXY_DECLARE(void) ap_proxy_initialize_worker_share(proxy_server_conf *conf,
                                                     proxy_worker *worker);
                                                     proxy_worker *worker,
                                                     server_rec *s);


/**
 * Initize the worker
 * @param worker worker to initialize
 * @param p      memory pool to allocate worker from 
 * @param s      current server record
 * @return       APR_SUCCESS or error code
 */
+19 −8
Original line number Diff line number Diff line
@@ -1364,7 +1364,8 @@ static apr_status_t connection_destructor(void *resource, void *params,
}

PROXY_DECLARE(void) ap_proxy_initialize_worker_share(proxy_server_conf *conf,
                                                     proxy_worker *worker)
                                                     proxy_worker *worker,
                                                     server_rec *s)
{
#if PROXY_HAS_SCOREBOARD
    lb_score *score = NULL;
@@ -1376,13 +1377,22 @@ PROXY_DECLARE(void) ap_proxy_initialize_worker_share(proxy_server_conf *conf,
    if (ap_scoreboard_image) {
        score = ap_get_scoreboard_lb(worker->id);
    if (!score)
        ap_log_perror(APLOG_MARK, APLOG_ERR, 0, conf->pool,
        ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
              "proxy: ap_get_scoreboard_lb(%d) failed for worker %s",
              worker->id, worker->name);
    }
    else {
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
              "proxy: initialized scoreboard slot %d for worker %s",
              worker->id, worker->name);
    }
#endif
    if (!score)
    if (!score) {
        score = apr_pcalloc(conf->pool, sizeof(proxy_worker_stat));
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
              "proxy: initialized plain memory for worker %s",
              worker->name);
    }
    worker->s = (proxy_worker_stat *)score;
    if (worker->route)
        strcpy(worker->s->route, worker->route);
@@ -1392,6 +1402,10 @@ PROXY_DECLARE(void) ap_proxy_initialize_worker_share(proxy_server_conf *conf,
        strcpy(worker->s->redirect, worker->redirect);
    else
        *worker->s->redirect = '\0';
    /* Set default parameters */
    if (!worker->retry)
        worker->retry = apr_time_from_sec(PROXY_WORKER_DEFAULT_RETRY);

}

PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, server_rec *s)
@@ -1448,9 +1462,6 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser
    }
    if (rv == APR_SUCCESS)
        worker->s->status |= PROXY_WORKER_INITIALIZED;
    /* Set default parameters */
    if (!worker->retry)
        worker->retry = apr_time_from_sec(PROXY_WORKER_DEFAULT_RETRY);
    return rv;
}