Hi all,
This patch was applied as a bugfix to v1.3.9 of Apache's mod_proxy, but
it was never included in mod_proxy v2.
This patch here is a stripped version of the patch that excludes the
caching functions, which are being ripped out anyway.
The CHANGES entry looks like this:
*) Fix problem with proxy configuration where globally set
configuration
options were overridden inside virtual hosts.
[Graham Leggett <[EMAIL PROTECTED]>]
*) Fix ProxyReceiveBufferSize where default value was left
uninitialised.
[Graham Leggett <[EMAIL PROTECTED]>]
Please double check for me that it works - I haven't tested it
thoroughly yet, although the original patch was included in v1.3.9 and
thus pretty well tested...
Regards,
Graham
--
-----------------------------------------
[EMAIL PROTECTED] "There's a moon
over Bourbon Street
tonight..."*** /home/minfrin/src/apache/pristine/httpd-proxy/module-2.0/mod_proxy.h
Mon Feb 12 10:20:03 2001
--- /home/minfrin/src/apache/sandbox/proxy/httpd-2.0/modules/proxy/mod_proxy.h
Sat Mar 10 19:47:34 2001
***************
*** 184,189 ****
--- 184,190 ----
apr_array_header_t *allowed_connect_ports;
const char *domain; /* domain name to use in absence of a
domain name in the request */
int req; /* true if proxy requests are enabled */
+ char req_set;
float cache_completion; /* Force cache completion after this point */
enum {
via_off,
***************
*** 191,197 ****
--- 192,200 ----
via_block,
via_full
} viaopt; /* how to deal with proxy Via: headers */
+ char viaopt_set;
size_t recv_buffer_size;
+ char recv_buffer_size_set;
ap_cache_handle_t *cache;
} proxy_server_conf;
*** /home/minfrin/src/apache/pristine/httpd-proxy/module-2.0/mod_proxy.c
Thu Feb 8 08:44:09 2001
--- /home/minfrin/src/apache/sandbox/proxy/httpd-2.0/modules/proxy/mod_proxy.c
Sat Mar 10 21:05:14 2001
***************
*** 421,432 ****
--- 421,458 ----
ps->cache_completion = DEFAULT_CACHE_COMPLETION;
ps->domain = NULL;
ps->viaopt = via_off; /* initially backward compatible with 1.3.1 */
+ ps->viaopt_set = 0; /* 0 means default */
ps->req = 0;
+ ps->req_set = 0;
+ ps->recv_buffer_size = 0; /* this default was left unset for some reason
*/
+ ps->recv_buffer_size_set = 0;
ap_cache_init(&ps->cache, "mod_proxy cache", s);
return ps;
}
+ static void * merge_proxy_config(apr_pool_t *p, void *basev, void *overridesv)
+ {
+ proxy_server_conf *ps = ap_pcalloc(p, sizeof(proxy_server_conf));
+ proxy_server_conf *base = (proxy_server_conf *) basev;
+ proxy_server_conf *overrides = (proxy_server_conf *) overridesv;
+
+ ps->proxies = ap_append_arrays(p, base->proxies, overrides->proxies);
+ ps->aliases = ap_append_arrays(p, base->aliases, overrides->aliases);
+ ps->raliases = ap_append_arrays(p, base->raliases, overrides->raliases);
+ ps->noproxies = ap_append_arrays(p, base->noproxies,
overrides->noproxies);
+ ps->dirconn = ap_append_arrays(p, base->dirconn, overrides->dirconn);
+ ps->nocaches = ap_append_arrays(p, base->nocaches, overrides->nocaches);
+ ps->allowed_connect_ports = ap_append_arrays(p,
base->allowed_connect_ports, overrides->allowed_connect_ports);
+
+ ps->domain = (overrides->domain == NULL) ? base->domain :
overrides->domain;
+ ps->viaopt = (overrides->viaopt_set == 0) ? base->viaopt :
overrides->viaopt;
+ ps->req = (overrides->req_set == 0) ? base->req : overrides->req;
+ ps->recv_buffer_size = (overrides->recv_buffer_size_set == 0) ?
base->recv_buffer_size : overrides->recv_buffer_size;
+
+ return ps;
+ }
+
static const char *
add_proxy(cmd_parms *cmd, void *dummy, const char *f1, const char *r1)
{
***************
*** 659,664 ****
--- 685,691 ----
ap_get_module_config(parms->server->module_config, &proxy_module);
psf->req = flag;
+ psf->req_set = 1;
return NULL;
}
***************
*** 673,678 ****
--- 700,706 ----
}
psf->recv_buffer_size = s;
+ psf->recv_buffer_size_set = 1;
return NULL;
}
***************
*** 695,700 ****
--- 723,729 ----
"off | on | full | block";
}
+ psf->viaopt_set = 1;
return NULL;
}
***************
*** 760,766 ****
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
create_proxy_config, /* create per-server config structure */
! NULL, /* merge per-server config structures */
proxy_cmds, /* command table */
register_hooks
};
--- 789,795 ----
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
create_proxy_config, /* create per-server config structure */
! merge_proxy_config, /* merge per-server config structures */
proxy_cmds, /* command table */
register_hooks
};