mod_proxy.h revision 6fb984bb49f217c3b76cdbe864f105d2e74e52ed
2d2eda71267231c2526be701fe655db125852c1ffielding/* Licensed to the Apache Software Foundation (ASF) under one or more
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * contributor license agreements. See the NOTICE file distributed with
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * this work for additional information regarding copyright ownership.
b99dbaab171d91e1b664397cc40e039d0c087c65fielding * The ASF licenses this file to You under the Apache License, Version 2.0
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * (the "License"); you may not use this file except in compliance with
2d2eda71267231c2526be701fe655db125852c1ffielding * the License. You may obtain a copy of the License at
2d2eda71267231c2526be701fe655db125852c1ffielding * Unless required by applicable law or agreed to in writing, software
2d2eda71267231c2526be701fe655db125852c1ffielding * distributed under the License is distributed on an "AS IS" BASIS,
2d2eda71267231c2526be701fe655db125852c1ffielding * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2d2eda71267231c2526be701fe655db125852c1ffielding * See the License for the specific language governing permissions and
2d2eda71267231c2526be701fe655db125852c1ffielding * limitations under the License.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * @brief Proxy Extension Module for Apache
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * @defgroup MOD_PROXY mod_proxy
2d2eda71267231c2526be701fe655db125852c1ffielding * @ingroup APACHE_MODS
61fd0cab072a05b855cbef9c585702401ac5ae29rbb/* for proxy_canonenc() */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#else /*APR_CHARSET_EBCDIC*/
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#endif /*APR_CHARSET_EBCDIC*/
61fd0cab072a05b855cbef9c585702401ac5ae29rbb/* default Max-Forwards header setting */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Set this to -1, which complies with RFC2616 by not setting
2d2eda71267231c2526be701fe655db125852c1ffielding * max-forwards if the client didn't send it to us.
61fd0cab072a05b855cbef9c585702401ac5ae29rbbtypedef struct proxy_balancer_method proxy_balancer_method;
3d96ee83babeec32482c9082c9426340cee8c44dwrowe/* static information about a remote proxy */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb const char *scheme; /* the schemes handled by this proxy, or '*' */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb const char *protocol; /* the scheme used to talk to this proxy */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb ap_regex_t *regexp; /* compiled regex (if any) for the remote */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb int use_regex; /* simple boolean. True if we have a regex pattern */
2d2eda71267231c2526be701fe655db125852c1ffielding const char *real;
2d2eda71267231c2526be701fe655db125852c1ffielding const char *fake;
000b67449410515eac43e76ef6667915bfd4d2abgstein unsigned int flags;
2d2eda71267231c2526be701fe655db125852c1ffielding proxy_balancer *balancer; /* only valid for reverse-proxys */
7bdef86e15d47d16dcbe7a5611683191774bd5fbgstein int (*matcher) (struct dirconn_entry * This, request_rec *r);
61fd0cab072a05b855cbef9c585702401ac5ae29rbb const char *name;
61fd0cab072a05b855cbef9c585702401ac5ae29rbbtypedef struct {
61fd0cab072a05b855cbef9c585702401ac5ae29rbb apr_array_header_t *workers; /* non-balancer workers, eg ProxyPass http://example.com */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb apr_array_header_t *balancers; /* list of balancers @ config time */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb proxy_worker *reverse; /* reverse "module-driven" proxy worker */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb const char *domain; /* domain name to use in absence of a domain name in the request */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb const char *id;
3d96ee83babeec32482c9082c9426340cee8c44dwrowe apr_pool_t *pool; /* Pool used for allocating this struct */
c9a95767fbf0f5fb0976a06b97a256033925e433rbb int max_balancers; /* maximum number of allowed balancers */
c9a95767fbf0f5fb0976a06b97a256033925e433rbb int bgrowth; /* number of post-config balancers can added */
7bdef86e15d47d16dcbe7a5611683191774bd5fbgstein apr_global_mutex_t *mutex; /* global lock (needed??) */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb ap_slotmem_instance_t *bslot; /* balancers shm data - runtime */
61fd0cab072a05b855cbef9c585702401ac5ae29rbbtypedef struct {
61fd0cab072a05b855cbef9c585702401ac5ae29rbb const char *p; /* The path */
2d2eda71267231c2526be701fe655db125852c1ffielding * ProxyPassReverse and friends are documented as working inside
2d2eda71267231c2526be701fe655db125852c1ffielding * <Location>. But in fact they never have done in the case of
2d2eda71267231c2526be701fe655db125852c1ffielding * more than one <Location>, because the server_conf can't see it.
2d2eda71267231c2526be701fe655db125852c1ffielding * We need to move them to the per-dir config.
2d2eda71267231c2526be701fe655db125852c1ffielding * Discussed in February 2005:
2d2eda71267231c2526be701fe655db125852c1ffielding * http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=110726027118798&w=2
2d2eda71267231c2526be701fe655db125852c1ffielding signed char p_is_fnmatch; /* Is the path an fnmatch candidate? */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * the following setting masks the error page
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * returned from the 'proxied server' and just
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * forwards the status code upwards.
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * This allows the main server (us) to generate
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * the error page, (so it will look like a error
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * returned from the rest of the system
61fd0cab072a05b855cbef9c585702401ac5ae29rbb/* if we interpolate env vars per-request, we'll need a per-request
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * copy of the reverse proxy config
61fd0cab072a05b855cbef9c585702401ac5ae29rbbtypedef struct {
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coartypedef struct {
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar request_rec *r; /* Request record of the backend request
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar * that is used over the backend connection. */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar proxy_worker *worker; /* Connection pool this connection belongs to */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar apr_pool_t *pool; /* Subpool for hostname and addr data */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar const char *hostname;
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar apr_sockaddr_t *addr; /* Preparsed remote address info */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar apr_pool_t *scpool; /* Subpool used for socket and connection data */
3d96ee83babeec32482c9082c9426340cee8c44dwrowe unsigned int need_flush:1; /* Flag to decide whether we need to flush the
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar * filter chain or not */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar unsigned int inreslist:1; /* connection in apr_reslist? */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coartypedef struct {
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar/* Connection pool */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar apr_pool_t *pool; /* The pool used in constructor and destructor calls */
3d96ee83babeec32482c9082c9426340cee8c44dwrowe apr_sockaddr_t *addr; /* Preparsed remote address info */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar proxy_conn_rec *conn; /* Single connection for prefork mpm */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar/* Keep below in sync with proxy_util.c! */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar/* worker status bits */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar/* worker status flags */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar#define PROXY_WORKER_NOT_USABLE_BITMAP ( PROXY_WORKER_IN_SHUTDOWN | \
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coarPROXY_WORKER_DISABLED | PROXY_WORKER_STOPPED | PROXY_WORKER_IN_ERROR )
3d96ee83babeec32482c9082c9426340cee8c44dwrowe/* NOTE: these check the shared status */
91f0d8da77152d24e4bbb31ce199282b3fd6e3b2coar#define PROXY_WORKER_IS_INITIALIZED(f) ( (f)->s->status & PROXY_WORKER_INITIALIZED )
2d2eda71267231c2526be701fe655db125852c1ffielding#define PROXY_WORKER_IS_STANDBY(f) ( (f)->s->status & PROXY_WORKER_HOT_STANDBY )
2d2eda71267231c2526be701fe655db125852c1ffielding#define PROXY_WORKER_IS_USABLE(f) ( ( !( (f)->s->status & PROXY_WORKER_NOT_USABLE_BITMAP) ) && \
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_WORKER_IS_DRAINING(f) ( (f)->s->status & PROXY_WORKER_DRAIN )
61fd0cab072a05b855cbef9c585702401ac5ae29rbb/* default worker retry timeout in seconds */
3d96ee83babeec32482c9082c9426340cee8c44dwrowe/* Some max char string sizes, for shm fields */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_BALANCER_MAX_ROUTE_SIZE PROXY_WORKER_MAX_ROUTE_SIZE
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_BALANCER_MAX_NAME_SIZE PROXY_WORKER_MAX_NAME_SIZE
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_BALANCER_MAX_HOSTNAME_SIZE PROXY_WORKER_MAX_HOSTNAME_SIZE
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_STRNCPY(dst, src) ap_proxy_strncpy((dst), (src), (sizeof(dst)))
3d96ee83babeec32482c9082c9426340cee8c44dwrowe(w)->s->recv_buffer_size_set = (c)->recv_buffer_size_set; \
61fd0cab072a05b855cbef9c585702401ac5ae29rbb} while (0)
61fd0cab072a05b855cbef9c585702401ac5ae29rbb/* use 2 hashes */
61fd0cab072a05b855cbef9c585702401ac5ae29rbbtypedef struct {
61fd0cab072a05b855cbef9c585702401ac5ae29rbb unsigned int def;
61fd0cab072a05b855cbef9c585702401ac5ae29rbb unsigned int fnv;
61fd0cab072a05b855cbef9c585702401ac5ae29rbb/* Runtime worker status informations. Shared in scoreboard */
61fd0cab072a05b855cbef9c585702401ac5ae29rbbtypedef struct {
61fd0cab072a05b855cbef9c585702401ac5ae29rbb char scheme[PROXY_WORKER_MAX_SCHEME_SIZE]; /* scheme to use ajp|http|https */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb char hostname[PROXY_WORKER_MAX_HOSTNAME_SIZE]; /* remote backend address */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb char route[PROXY_WORKER_MAX_ROUTE_SIZE]; /* balancing route */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb char redirect[PROXY_WORKER_MAX_ROUTE_SIZE]; /* temporary balancing redirection route */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb char flusher[PROXY_WORKER_MAX_SCHEME_SIZE]; /* flush provider used by mod_proxy_fdpass */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb int min; /* Desired minimum number of available connections */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb int smax; /* Soft maximum on the total number of connections */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb int hmax; /* Hard maximum on the total number of connections */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb int flush_wait; /* poll wait time in microseconds if flush_auto */
3d96ee83babeec32482c9082c9426340cee8c44dwrowe apr_interval_time_t ttl; /* maximum amount of time in seconds a connection
2d2eda71267231c2526be701fe655db125852c1ffielding * may be available while exceeding the soft limit */
2d2eda71267231c2526be701fe655db125852c1ffielding apr_interval_time_t timeout; /* connection timeout */
2d2eda71267231c2526be701fe655db125852c1ffielding apr_interval_time_t acquire; /* acquire timeout when the maximum number of connections is exceeded */
3d96ee83babeec32482c9082c9426340cee8c44dwrowe apr_size_t elected; /* Number of times the worker was elected */
d839a9822ee53ce00da24c15f2d9fe054233d342gstein apr_off_t transferred;/* Number of bytes transferred to remote */
d839a9822ee53ce00da24c15f2d9fe054233d342gstein apr_off_t read; /* Number of bytes read from remote */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define ALIGNED_PROXY_WORKER_SHARED_SIZE (APR_ALIGN_DEFAULT(sizeof(proxy_worker_shared)))
61fd0cab072a05b855cbef9c585702401ac5ae29rbb/* Worker configuration */
3d96ee83babeec32482c9082c9426340cee8c44dwrowe unsigned int local_status; /* status of per-process worker */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb apr_thread_mutex_t *tmutex; /* Thread lock for updating address cache */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * Time to wait (in microseconds) to find out if more data is currently
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * available at the backend.
61fd0cab072a05b855cbef9c585702401ac5ae29rbbtypedef struct {
61fd0cab072a05b855cbef9c585702401ac5ae29rbb char sticky_path[PROXY_BALANCER_MAX_STICKY_SIZE]; /* URL sticky session identifier */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb char sticky[PROXY_BALANCER_MAX_STICKY_SIZE]; /* sticky session identifier */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb char lbpname[PROXY_MAX_PROVIDER_NAME_SIZE]; /* lbmethod provider name */
3d96ee83babeec32482c9082c9426340cee8c44dwrowe apr_interval_time_t timeout; /* Timeout for waiting on free connection */
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein apr_time_t wupdated; /* timestamp of last change to workers list */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb int max_attempts; /* Number of attempts before failing */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb unsigned int sticky_force:1; /* Disable failover for sticky sessions */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb unsigned int scolonsep:1; /* true if ';' seps sticky session paths */
3d96ee83babeec32482c9082c9426340cee8c44dwrowe char sticky_separator; /* separator for sessionid/route */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define ALIGNED_PROXY_BALANCER_SHARED_SIZE (APR_ALIGN_DEFAULT(sizeof(proxy_balancer_shared)))
61fd0cab072a05b855cbef9c585702401ac5ae29rbb apr_array_header_t *workers; /* initially configured workers */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb apr_array_header_t *errstatuses; /* statuses to force members into error */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb ap_slotmem_instance_t *wslot; /* worker shm data - runtime */
3d96ee83babeec32482c9082c9426340cee8c44dwrowe int growth; /* number of post-config workers can added */
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein int max_workers; /* maximum number of allowed workers */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb apr_time_t wupdated; /* timestamp of last change to workers list */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb apr_global_mutex_t *gmutex; /* global lock for updating list of workers */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb apr_thread_mutex_t *tmutex; /* Thread lock for updating shm */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb apr_status_t (*reset)(proxy_balancer *balancer, server_rec *s);
3d96ee83babeec32482c9082c9426340cee8c44dwrowe apr_status_t (*age)(proxy_balancer *balancer, server_rec *s);
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein apr_status_t (*updatelbstatus)(proxy_balancer *balancer, proxy_worker *elected, server_rec *s);
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_THREAD_LOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_lock((x)->tmutex) : APR_SUCCESS)
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_THREAD_UNLOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_unlock((x)->tmutex) : APR_SUCCESS)
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_GLOBAL_LOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_lock((x)->gmutex) : APR_SUCCESS)
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_GLOBAL_UNLOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_unlock((x)->gmutex) : APR_SUCCESS)
61fd0cab072a05b855cbef9c585702401ac5ae29rbb/* hooks */
61fd0cab072a05b855cbef9c585702401ac5ae29rbb/* Create a set of PROXY_DECLARE(type), PROXY_DECLARE_NONSTD(type) and
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * PROXY_DECLARE_DATA with appropriate export and import tags for the platform
3d96ee83babeec32482c9082c9426340cee8c44dwrowe#if !defined(WIN32)
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_DECLARE(type) __declspec(dllexport) type __stdcall
61fd0cab072a05b855cbef9c585702401ac5ae29rbb#define PROXY_DECLARE_NONSTD(type) __declspec(dllexport) type
3d96ee83babeec32482c9082c9426340cee8c44dwrowe#define PROXY_DECLARE(type) __declspec(dllimport) type __stdcall
2d2eda71267231c2526be701fe655db125852c1ffielding#define PROXY_DECLARE_NONSTD(type) __declspec(dllimport) type
61fd0cab072a05b855cbef9c585702401ac5ae29rbbAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, scheme_handler, (request_rec *r,
2d2eda71267231c2526be701fe655db125852c1ffielding proxy_worker *worker, proxy_server_conf *conf, char *url,
61fd0cab072a05b855cbef9c585702401ac5ae29rbbAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, canon_handler, (request_rec *r,
3d96ee83babeec32482c9082c9426340cee8c44dwroweAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, create_req, (request_rec *r, request_rec *pr))
2d2eda71267231c2526be701fe655db125852c1ffieldingAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, fixups, (request_rec *r))
344f3bc38dfccf6261d5bb8d689794cde113b3d6coar * pre request hook.
344f3bc38dfccf6261d5bb8d689794cde113b3d6coar * It will return the most suitable worker at the moment
344f3bc38dfccf6261d5bb8d689794cde113b3d6coar * and coresponding balancer.
344f3bc38dfccf6261d5bb8d689794cde113b3d6coar * The url is rewritten from balancer://cluster/uri to scheme://host:port/uri
344f3bc38dfccf6261d5bb8d689794cde113b3d6coar * and then the scheme_handler is called.
d5df46b7972c0c4a5ca0ba5068e238f6053c2e6ftrawickAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, pre_request, (proxy_worker **worker,
fd0edaa8e3d4dd67d0604ccef2e96b071db96643fielding * post request hook.
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * It is called after request for updating runtime balancer status.
61fd0cab072a05b855cbef9c585702401ac5ae29rbbAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, post_request, (proxy_worker *worker,
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * request status hook
42ce672c516baf6e4eaed18ccc1647de2d456d8edougm * It is called after all proxy processing has been done. This gives other
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein * modules a chance to create default content on failure, for example
61fd0cab072a05b855cbef9c585702401ac5ae29rbbAPR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, request_status,
61fd0cab072a05b855cbef9c585702401ac5ae29rbbPROXY_DECLARE(apr_status_t) ap_proxy_strncpy(char *dst, const char *src,
61fd0cab072a05b855cbef9c585702401ac5ae29rbbPROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t,
61fd0cab072a05b855cbef9c585702401ac5ae29rbbPROXY_DECLARE(char *)ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
61fd0cab072a05b855cbef9c585702401ac5ae29rbbPROXY_DECLARE(int) ap_proxyerror(request_rec *r, int statuscode, const char *message);
42ce672c516baf6e4eaed18ccc1647de2d456d8edougm/** Test whether the hostname/address of the request are blocked by the ProxyBlock
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein * configuration.
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * @param r request
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * @param conf server configuration
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * @param hostname hostname from request URI
61fd0cab072a05b855cbef9c585702401ac5ae29rbb * @param addr resolved address of hostname, or NULL if not known
dad234382d8424e1c5a30af2838e172aec9d6d1bdreid * @return OK on success, or else an errro
42ce672c516baf6e4eaed18ccc1647de2d456d8edougmPROXY_DECLARE(int) ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf,
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbbPROXY_DECLARE(int) ap_proxy_pre_http_request(conn_rec *c, request_rec *r);
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb/* DEPRECATED (will be replaced with ap_proxy_connect_backend */
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbbPROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **, const char *, apr_sockaddr_t *, const char *, proxy_server_conf *, request_rec *);
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbbPROXY_DECLARE(apr_status_t) ap_proxy_ssl_connection_cleanup(proxy_conn_rec *conn,
8b7047e519340545e6807c9749576a40a76b6d3frbbPROXY_DECLARE(const char *) ap_proxy_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var);
8b7047e519340545e6807c9749576a40a76b6d3frbb/* Header mapping functions, and a typedef of their signature */
8b7047e519340545e6807c9749576a40a76b6d3frbbPROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *url);
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbbPROXY_DECLARE(const char *) ap_proxy_cookie_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *str);
9484ae61c7cc5fa8d8d9a836efdbdb1e88d3036dwrowe#if !defined(WIN32)
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbbtypedef const char *(*ap_proxy_header_reverse_map_fn)(request_rec *,
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb proxy_dir_conf *, const char *);
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbbtypedef const char *(__stdcall *ap_proxy_header_reverse_map_fn)(request_rec *,
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb proxy_dir_conf *, const char *);
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb (__stdcall *ap_proxy_header_reverse_map_fn)(request_rec *,
561e5f16a2f9fb397aac4c283aaa87a752520a4ddougm proxy_dir_conf *, const char *);
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb (__stdcall *ap_proxy_header_reverse_map_fn)(request_rec *,
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb proxy_dir_conf *, const char *);
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb/* Connection pool API */
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb * Get the worker from proxy configuration
561e5f16a2f9fb397aac4c283aaa87a752520a4ddougm * @param p memory pool used for finding worker
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb * @param balancer the balancer that the worker belongs to
561e5f16a2f9fb397aac4c283aaa87a752520a4ddougm * @param conf current proxy server configuration
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb * @param url url to find the worker from
fcc25eda7b150e226d3c1cdaea66a943d3fdee4erbb * @return proxy_worker or NULL if not found
c9a95767fbf0f5fb0976a06b97a256033925e433rbbPROXY_DECLARE(proxy_worker *) ap_proxy_get_worker(apr_pool_t *p,
c9a95767fbf0f5fb0976a06b97a256033925e433rbb const char *url);
c9a95767fbf0f5fb0976a06b97a256033925e433rbb * Define and Allocate space for the worker to proxy configuration
c9a95767fbf0f5fb0976a06b97a256033925e433rbb * @param p memory pool to allocate worker from
c9a95767fbf0f5fb0976a06b97a256033925e433rbb * @param worker the new worker
c9a95767fbf0f5fb0976a06b97a256033925e433rbb * @param balancer the balancer that the worker belongs to
c9a95767fbf0f5fb0976a06b97a256033925e433rbb * @param conf current proxy server configuration
c9a95767fbf0f5fb0976a06b97a256033925e433rbb * @param url url containing worker name
c9a95767fbf0f5fb0976a06b97a256033925e433rbb * @param do_malloc true if shared struct should be malloced
2d2eda71267231c2526be701fe655db125852c1ffielding * @return error message or NULL if successful (*worker is new worker)
2d2eda71267231c2526be701fe655db125852c1ffieldingPROXY_DECLARE(char *) ap_proxy_define_worker(apr_pool_t *p,
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,
int ap_proxy_lb_workers(void);