create the worker that isn't by default added to the list of other workers.
This enalbles mixing forward and reverse proxy functionality on the same box.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105070
13f79535-47bb-0310-9956-
ffa450edef68
static const char *
set_proxy_req(cmd_parms *parms, void *dummy, int flag)
{
static const char *
set_proxy_req(cmd_parms *parms, void *dummy, int flag)
{
proxy_server_conf *psf =
ap_get_module_config(parms->server->module_config, &proxy_module);
psf->req = flag;
psf->req_set = 1;
proxy_server_conf *psf =
ap_get_module_config(parms->server->module_config, &proxy_module);
psf->req = flag;
psf->req_set = 1;
- if (flag) {
- /* Add default forward proxy worker */
- if ((err = ap_proxy_add_worker(&(psf->forward), parms->pool,
- psf, "*://*:0"))) {
- return apr_pstrcat(parms->temp_pool, "ProxyRequests ", err, NULL);
- }
+ if (flag && !psf->forward) {
+ psf->forward = ap_proxy_create_worker(parms->pool);
+ psf->forward->name = "proxy:forward";
+ psf->forward->hostname = "*";
+ psf->forward->scheme = "*";
/* Do not disable worker in case of errors */
psf->forward->status = PROXY_WORKER_IGNORE_ERRORS;
/* Do not disable worker in case of errors */
psf->forward->status = PROXY_WORKER_IGNORE_ERRORS;
ap_proxy_initialize_worker(worker, s);
worker++;
}
ap_proxy_initialize_worker(worker, s);
worker++;
}
-
- ap_proxy_initialize_worker(conf->forward, s);
+ if (conf->forward)
+ ap_proxy_initialize_worker(conf->forward, s);
proxy_server_conf *conf,
const char *url);
proxy_server_conf *conf,
const char *url);
+/**
+ * Create new worker
+ * @param p memory pool to allocate worker from
+ * @return new worker
+ */
+PROXY_DECLARE(proxy_worker *) ap_proxy_create_worker(apr_pool_t *p);
+
/**
* Initize the worker
* @param worker the new worker
/**
* Initize the worker
* @param worker the new worker
+PROXY_DECLARE(proxy_worker *) ap_proxy_create_worker(apr_pool_t *p)
+{
+
+ proxy_worker *worker;
+ worker = (proxy_worker *)apr_pcalloc(p, sizeof(proxy_worker));
+ init_conn_pool(p, worker);
+
+ return worker;
+}
+
PROXY_DECLARE(void)
ap_proxy_add_worker_to_balancer(apr_pool_t *pool, proxy_balancer *balancer, proxy_worker *worker)
{
PROXY_DECLARE(void)
ap_proxy_add_worker_to_balancer(apr_pool_t *pool, proxy_balancer *balancer, proxy_worker *worker)
{