mod_proxy.h revision 345d7aac2f2b8a58744624cc5dff2d44c84cfa14
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna/* Licensed to the Apache Software Foundation (ASF) under one or more
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * contributor license agreements. See the NOTICE file distributed with
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * this work for additional information regarding copyright ownership.
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * The ASF licenses this file to You under the Apache License, Version 2.0
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * (the "License"); you may not use this file except in compliance with
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * the License. You may obtain a copy of the License at
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * Unless required by applicable law or agreed to in writing, software
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * distributed under the License is distributed on an "AS IS" BASIS,
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * See the License for the specific language governing permissions and
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * limitations under the License.
52a5101047d0148d33df1f9f4f77b24bce7fdf70pquerna * @brief Proxy Extension Module for Apache
52a5101047d0148d33df1f9f4f77b24bce7fdf70pquerna * @defgroup MOD_PROXY mod_proxy
f997d134bcee6bfa4cd87b69acee96e80c5a358bpquerna * @ingroup APACHE_MODS
#include "apr_optional.h"
#include "apr.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_buckets.h"
#include "apr_md5.h"
#include "apr_network_io.h"
#include "apr_pools.h"
#include "apr_strings.h"
#include "apr_uri.h"
#include "apr_date.h"
#include "apr_strmatch.h"
#include "apr_fnmatch.h"
#include "apr_reslist.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
#include "apr_uuid.h"
#include "util_mutex.h"
#include "apr_global_mutex.h"
#include "apr_thread_mutex.h"
#include "httpd.h"
#include "http_config.h"
#include "ap_config.h"
#include "http_core.h"
#include "http_protocol.h"
#include "http_request.h"
#include "http_vhost.h"
#include "http_main.h"
#include "http_log.h"
#include "http_connection.h"
#include "util_filter.h"
#include "util_ebcdic.h"
#include "ap_provider.h"
#include "ap_slotmem.h"
enum enctype {
struct proxy_remote {
struct proxy_alias {
const char *real;
const char *fake;
unsigned int flags;
struct dirconn_entry {
char *name;
struct noproxy_entry {
const char *name;
const char *id;
long maxfwd;
signed char interpolate_env;
const char *hostname;
struct proxy_conn_pool {
/* Keep below in sync with proxy_util.c! */
#define PROXY_COPY_CONF_PARAMS(w, c) \
unsigned int def;
unsigned int fnv;
} proxy_hashes ;
apr_interval_time_t acquire; /* acquire timeout when the maximum number of connections is exceeded */
struct proxy_worker {
struct proxy_balancer {
struct proxy_balancer_method {
request_rec *r);
#define PROXY_THREAD_LOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_lock((x)->tmutex) : APR_SUCCESS)
#define PROXY_THREAD_UNLOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_unlock((x)->tmutex) : APR_SUCCESS)
#define PROXY_GLOBAL_LOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_lock((x)->gmutex) : APR_SUCCESS)
#define PROXY_GLOBAL_UNLOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_unlock((x)->gmutex) : APR_SUCCESS)
#if !defined(WIN32)
#define PROXY_DECLARE_DATA
#define PROXY_DECLARE_DATA
char *url))
request_rec *r,
/* proxy_util.c */
PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **, const char *, apr_sockaddr_t *, const char *, proxy_server_conf *, request_rec *);
request_rec *r);
PROXY_DECLARE(const char *) ap_proxy_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var);
PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *url);
PROXY_DECLARE(const char *) ap_proxy_cookie_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *str);
#if !defined(WIN32)
proxy_dir_conf *, const char *);
proxy_dir_conf *, const char *);
proxy_dir_conf *, const char *);
proxy_dir_conf *, const char *);
const char *url);
const char *url,
int do_malloc);
server_rec *s,
apr_pool_t *p);
const char *url,
int careactive);
const char *url);
const char *url,
const char *alias,
int do_malloc);
server_rec *s,
apr_pool_t *p);
unsigned int *index);
unsigned int *index);
* The balancer then rewrites the url to particular worker, like http://host:port
request_rec *r,
char **url);
request_rec *r,
char **url,
const char *proxyname,
char *server_portstr,
int server_portstr_size);
server_rec *s);
server_rec *s);
server_rec *s);
server_rec *s,
request_rec *r,
char **old_cl_val,
char **old_te_val);
int flush);
int ap_proxy_lb_workers(void);