mod_proxy.c revision 7af19efc4667363f74d332a8d010b49e88d56fd5
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder/* Licensed to the Apache Software Foundation (ASF) under one or more
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * contributor license agreements. See the NOTICE file distributed with
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * this work for additional information regarding copyright ownership.
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder * The ASF licenses this file to You under the Apache License, Version 2.0
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * (the "License"); you may not use this file except in compliance with
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * the License. You may obtain a copy of the License at
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * http://www.apache.org/licenses/LICENSE-2.0
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder * Unless required by applicable law or agreed to in writing, software
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder * distributed under the License is distributed on an "AS IS" BASIS,
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder * See the License for the specific language governing permissions and
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder * limitations under the License.
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian MaederAPR_DECLARE_OPTIONAL_FN(int, ssl_proxy_enable, (conn_rec *));
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian MaederAPR_DECLARE_OPTIONAL_FN(int, ssl_engine_disable, (conn_rec *));
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian MaederAPR_DECLARE_OPTIONAL_FN(int, ssl_is_https, (conn_rec *));
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian MaederAPR_DECLARE_OPTIONAL_FN(char *, ssl_var_lookup,
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder#define MAX(x,y) ((x) >= (y) ? (x) : (y))
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * A Web proxy module. Stages:
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * translate_name: set filename to proxy:<URL>
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * map_to_storage: run proxy_walk (rather than directory_walk/file_walk)
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * can't trust directory_walk/file_walk since these are
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * not in our filesystem. Prevents mod_http from serving
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * the TRACE request we will set aside to handle later.
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * type_checker: set type to PROXY_MAGIC_TYPE if filename begins proxy:
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * fix_ups: convert the URL stored in the filename to the
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * canonical form.
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * handler: handle proxy requests
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder/* -------------------------------------------------------------- */
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder/* Translate the URL into a 'filename' */
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maederstatic const char *set_worker_param(apr_pool_t *p,
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder /* Normalized load factor. Used with BalancerMamber,
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * it is a number between 1 and 100.
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder if (worker->s->lbfactor < 1 || worker->s->lbfactor > 100)
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder return "LoadFactor must be a number between 1..100";
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder /* If set it will give the retry timeout for the worker
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * The default value is 60 seconds, meaning that if
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * in error state, it will be retried after that timeout.
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "Retry must be a positive value";
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder worker->s->retry = apr_time_from_sec(ival);
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder /* Time in seconds that will destroy all the connections
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * that exceed the smax
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "TTL must be at least one second";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Initial number of connections to remote
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "Min must be a positive number";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Maximum number of connections to remote
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "Max must be a positive number";
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder /* XXX: More inteligent naming needed */
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder /* Maximum number of connections to remote that
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder * will not be destroyed
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder return "Smax must be a positive number";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Acquire timeout in given unit (default is milliseconds).
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * If set this will be the maximum time to
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * wait for a free connection.
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder if (ap_timeout_parameter_parse(val, &timeout, "ms") != APR_SUCCESS)
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder return "Acquire timeout has wrong format";
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder return "Acquire must be at least one millisecond";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Connection timeout in seconds.
adda0e6252b14215228e4071b347c49b808894f8Christian Maeder * Defaults to server timeout.
adda0e6252b14215228e4071b347c49b808894f8Christian Maeder return "Timeout must be at least one second";
adda0e6252b14215228e4071b347c49b808894f8Christian Maeder worker->s->timeout = apr_time_from_sec(ival);
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder else if (!strcasecmp(key, "iobuffersize")) {
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder if (s < 512 && s) {
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "IOBufferSize must be >= 512 bytes, or 0 for system default.";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder worker->s->io_buffer_size = (s ? s : AP_IOBUFSIZE);
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder else if (!strcasecmp(key, "receivebuffersize")) {
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "ReceiveBufferSize must be >= 512 bytes, or 0 for system default.";
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder return "KeepAlive must be On|Off";
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder else if (!strcasecmp(key, "disablereuse")) {
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder return "DisableReuse must be On|Off";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Worker route.
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder if (strlen(val) >= PROXY_WORKER_MAX_ROUTE_SIZE)
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder return "Route length must be < 64 characters";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Worker redirection route.
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder if (strlen(val) >= PROXY_WORKER_MAX_ROUTE_SIZE)
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder return "Redirect length must be < 64 characters";
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder const char *v;
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder /* Worker status.
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder for (v = val; *v; v++) {
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder if (*v == '+') {
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder else if (*v == '-') {
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder rv = ap_proxy_set_wstatus(*v, mode, worker);
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder return "Unknown status parameter option";
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder else if (!strcasecmp(key, "flushpackets")) {
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder return "flushpackets must be on|off|auto";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "flushwait must be <= 1000, or 0 for system default of 10 millseconds.";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder worker->s->flush_wait = ival * 1000; /* change to microseconds */
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Ping/Pong timeout in given unit (default is second).
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder if (ap_timeout_parameter_parse(val, &timeout, "s") != APR_SUCCESS)
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "Ping/Pong timeout has wrong format";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "Ping/Pong timeout must be at least one millisecond";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "lbset must be between 0 and 99";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder else if (!strcasecmp(key, "connectiontimeout")) {
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Request timeout in given unit (default is second).
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * Defaults to connection timeout
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder if (ap_timeout_parameter_parse(val, &timeout, "s") != APR_SUCCESS)
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "Connectiontimeout has wrong format";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "Connectiontimeout must be at least one millisecond.";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder if (strlen(val) >= PROXY_WORKER_MAX_SCHEME_SIZE)
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "flusher name length must be < 16 characters";
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "unknown Worker parameter";
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maederstatic const char *set_balancer_param(proxy_server_conf *conf,
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder /* Balancer sticky session name.
1fac054baed931dc57f0e41dd0ade39adac28c49Christian Maeder * Set to something like JSESSIONID or
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * PHPSESSIONID, etc..,
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder if (strlen(val) > (PROXY_BALANCER_MAX_STICKY_SIZE-1))
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder return "stickysession length must be < 64 characters";
1fac054baed931dc57f0e41dd0ade39adac28c49Christian Maeder PROXY_STRNCPY(balancer->s->sticky_path, val);
1fac054baed931dc57f0e41dd0ade39adac28c49Christian Maeder if ((path = strchr((char *)balancer->s->sticky, '|'))) {
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder PROXY_STRNCPY(balancer->s->sticky_path, path);
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder /* If set to 'on' the session will break
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * if the worker is in error state or
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder return "failover must be On|Off";
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder /* Balancer timeout in seconds.
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder * If set this will be the maximum time to
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * wait for a free worker.
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder * Default is not to wait.
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder return "timeout must be at least one second";
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder balancer->s->timeout = apr_time_from_sec(ival);
e2ca90217abd35b3d5f98bfe73ecffb34badd837Christian Maeder else if (!strcasecmp(key, "maxattempts")) {
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Maximum number of failover attempts before
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder return "maximum number of attempts must be a positive number";
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder if (strlen(val) > (sizeof(balancer->s->lbpname)-1))
1fac054baed931dc57f0e41dd0ade39adac28c49Christian Maeder return "unknown lbmethod";
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder provider = ap_lookup_provider(PROXY_LBMETHOD, val, "0");
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "unknown lbmethod";
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder else if (!strcasecmp(key, "scolonpathdelim")) {
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder /* If set to 'on' then ';' will also be
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * used as a session path separator/delim (ala
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder return "scolonpathdelim must be On|Off";
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder else if (!strcasecmp(key, "failonstatus")) {
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder balancer->errstatuses = apr_array_make(p, 1, sizeof(int));
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder status = apr_strtok(val_split, ", ", &tok_state);
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder *(int *)apr_array_push(balancer->errstatuses) = ival;
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder return "failonstatus must be one or more HTTP response codes";
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder status = apr_strtok(NULL, ", ", &tok_state);
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder if (strlen(val) > sizeof(balancer->s->nonce)-1) {
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder return "Provided nonce is too large";
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder if (ival < 1 || ival > 100) /* arbitrary limit here */
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder return "growth must be between 1 and 100";
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder return "unknown Balancer parameter";
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maederstatic int alias_match(const char *uri, const char *alias_fakename)
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder const char *end_fakename = alias_fakename + strlen(alias_fakename);
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder const char *aliasp = alias_fakename, *urip = uri;
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder while (aliasp < end_fakename && urip < end_uri) {
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder /* any number of '/' in the alias matches any number in
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder * the supplied URI, but there must be at least one...
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder /* Other characters are compared literally */
45ad02e03fb913ba373d8fdcfe50244be3df31eaChristian Maeder /* fixup badly encoded stuff (e.g. % as last character) */
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder /* We reach the end of the uri before the end of "alias_fakename"
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder * for example uri is "/" and alias_fakename "/examples"
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder if (urip == end_uri && aliasp != end_fakename) {
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Check last alias path component matched all the way */
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder if (aliasp[-1] != '/' && *urip != '\0' && *urip != '/')
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder /* Return number of characters from URI which matched (may be
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder * greater than length of alias, since we may have matched
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder * doubled slashes)
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder/* Detect if an absoluteURI should be proxied or not. Note that we
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * have to do this during this phase because later phases are
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder * "short-circuiting"... i.e. translate_names will end when the first
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder * module returns OK. So for example, if the request is something like:
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder * GET http://othervhost/cgi-bin/printenv HTTP/1.0
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder * mod_alias will notice the /cgi-bin part and ScriptAlias it and
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * short-circuit the proxy... just because of the ordering in the
ee31a8a5f5d786472f2b5dfb271b38e6d401fa35Christian Maeder * configuration file.
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module);
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder /* Ick... msvc (perhaps others) promotes ternary short results to int */
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder /* but it might be something vhosted */
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder && !strcasecmp(r->parsed_uri.scheme, ap_http_scheme(r))
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder && ap_matches_request_vhost(r, r->parsed_uri.hostname,
7bffb8b0e6cae4bb7ecb59b99327add6106c06b9Christian Maeder (apr_port_t)(r->parsed_uri.port_str ? r->parsed_uri.port
return DECLINED;
const char *start;
const char *end;
const char *var;
const char *val;
const char *firstpart;
return str;
return str;
sizeof (struct proxy_alias));
return ret;
int len;
const char *fake;
const char *real;
int mismatch = 0;
return DECLINED;
if (len != 0) {
return DECLINED;
if (mismatch) {
if (found) {
return OK;
return DONE;
if (r->proxyreq) {
return OK;
return rv;
return rv;
return DECLINED;
&proxy_module);
for (j = 0; j < num_sec; ++j)
if (entry_proxy->r
return OK;
int access_status;
return DECLINED;
return access_status;
return OK;
char *url, *p;
int access_status;
&proxy_module);
return DECLINED;
return access_status;
return HTTP_BAD_REQUEST;
char *nuri;
const char *ref;
return DECLINED;
&r->parsed_uri,
return HTTP_MOVED_PERMANENTLY;
const char *p2;
int direct_connect = 0;
const char *str;
long maxfwd;
return DECLINED;
switch (r->method_number) {
case M_TRACE: {
int access_status;
return OK;
case M_OPTIONS: {
int access_status;
return OK;
if (maxfwd >= 0) {
return HTTP_METHOD_NOT_ALLOWED;
return HTTP_REQUEST_ENTITY_TOO_LARGE;
if (p == NULL) {
return HTTP_BAD_REQUEST;
return HTTP_MOVED_PERMANENTLY;
!direct_connect; i++) {
#if DEBUGGING
r->uri);
return access_status;
if (!worker)
goto cleanup;
if (balancer) {
if (!direct_connect) {
const char *cl_a;
char *end;
goto cleanup;
if (cl_a) {
if (cl > 0) {
goto cleanup;
goto cleanup;
if (balancer) {
if (balancer) {
goto cleanup;
return access_status;
unsigned int id;
id = ap_proxy_hashfunc(apr_psprintf(p, "%pp-%" APR_TIME_T_FMT, ps, apr_time_now()), PROXY_HASHFUNC_DEFAULT);
return ps;
ps->recv_buffer_size = (overrides->recv_buffer_size_set == 0) ? base->recv_buffer_size : overrides->recv_buffer_size;
ps->io_buffer_size = (overrides->io_buffer_size_set == 0) ? base->io_buffer_size : overrides->io_buffer_size;
ps->proxy_status = (overrides->proxy_status_set == 0) ? base->proxy_status : overrides->proxy_status;
ps->source_address = (overrides->source_address_set == 0) ? base->source_address : overrides->source_address;
return ps;
const char *arg)
return NULL;
return (void *) new;
return new;
char *r, *f, *scheme;
int port;
if (regex)
scheme[p-r] = 0;
if (q != NULL) {
if (regex)
if (regex) {
if (!reg)
return NULL;
char *r = NULL;
char *word;
unsigned int flags = 0;
const char *err;
if (err) {
return err;
while (*arg) {
if (is_regex) {
f = word;
r = word;
if (!val) {
if (r == NULL) {
if (apr_fnmatch_test(f)) {
if (use_regex) {
return NULL;
if (!balancer) {
if (err)
if (err)
int reuse = 0;
if (!worker) {
if (err)
if (reuse) {
if (err)
return NULL;
const char *fake;
const char *real;
const char *interp;
const char *err;
if (err) {
return err;
fake = f;
real = r;
interp = i;
real = f;
interp = r;
return NULL;
const char *r, const char *interp)
return NULL;
const char *r, const char *interp)
return NULL;
int found = 0;
if (!found) {
return NULL;
int found = 0;
if (!found) {
#if DEBUGGING
#if DEBUGGING
#if DEBUGGING
#if DEBUGGING
return NULL;
return NULL;
return NULL;
return NULL;
return NULL;
return NULL;
return NULL;
return NULL;
return NULL;
int timeout;
return NULL;
return NULL;
return NULL;
return NULL;
char *word;
int reuse = 0;
const char *err;
while (*arg) {
char *val;
if (!val) {
if (!path)
else if (!name)
if (!path)
if (!name)
if (!balancer) {
if (err)
if (!worker) {
if (reuse) {
if (err)
return NULL;
const char *err;
int in_proxy_section = 0;
if (!balancer) {
if (in_proxy_section) {
if (err)
if (!worker) {
if (in_proxy_section) {
if (err)
while (*arg) {
if (!val) {
if (worker)
if (err)
return NULL;
&proxy_module);
const char *errmsg;
return err;
if (!arg) {
return errmsg;
conf->r = r;
NULL);
NULL);
if (!balancer) {
if (err)
conf->p);
if (!worker) {
if (err)
NULL);
while (*arg) {
if (!val) {
if (worker)
if (err)
return NULL;
{NULL}
if (proxy_ssl_enable) {
if (proxy_ssl_disable) {
return proxy_ssl_disable(c);
if (proxy_is_https) {
return proxy_is_https(c);
const char *var)
if (proxy_ssl_val) {
return NULL;
return OK;
return OK;
++worker;
++balancer;
return OK;
if (!reverse) {
s = s->next;
proxy_lb_workers = 0;
return OK;
request_rec *r,
request_rec *r,
(request_rec *r), (r),
(status, r),