Apache HTTPD
mod_proxy.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef MOD_PROXY_H
18#define MOD_PROXY_H
19
29#include "apr_hooks.h"
30#include "apr_optional.h"
31#include "apr.h"
32#include "apr_lib.h"
33#include "apr_strings.h"
34#include "apr_buckets.h"
35#include "apr_md5.h"
36#include "apr_network_io.h"
37#include "apr_pools.h"
38#include "apr_strings.h"
39#include "apr_uri.h"
40#include "apr_date.h"
41#include "apr_strmatch.h"
42#include "apr_fnmatch.h"
43#include "apr_reslist.h"
44#define APR_WANT_STRFUNC
45#include "apr_want.h"
46#include "apr_uuid.h"
47#include "util_mutex.h"
48#include "apr_global_mutex.h"
49#include "apr_thread_mutex.h"
50
51#include "httpd.h"
52#include "http_config.h"
53#include "ap_config.h"
54#include "http_core.h"
55#include "http_protocol.h"
56#include "http_request.h"
57#include "http_vhost.h"
58#include "http_main.h"
59#include "http_log.h"
60#include "http_connection.h"
61#include "http_ssl.h"
62#include "util_filter.h"
63#include "util_ebcdic.h"
64#include "ap_provider.h"
65#include "ap_slotmem.h"
66
67#if APR_HAVE_NETINET_IN_H
68#include <netinet/in.h>
69#endif
70#if APR_HAVE_ARPA_INET_H
71#include <arpa/inet.h>
72#endif
73
74/* for proxy_canonenc() */
78
79/* Flags for ap_proxy_canonenc_ex */
80#define PROXY_CANONENC_FORCEDEC 0x01
81#define PROXY_CANONENC_NOENCODEDSLASHENCODING 0x02
82
86
87typedef struct {
89 char *name;
92
93typedef struct {
94 unsigned int bit;
95 char flag;
96 const char *name;
98
99#define BALANCER_PREFIX "balancer://"
100
101#if APR_CHARSET_EBCDIC
102#define CRLF "\r\n"
103#else /*APR_CHARSET_EBCDIC*/
104#define CRLF "\015\012"
105#endif /*APR_CHARSET_EBCDIC*/
106
107/* default Max-Forwards header setting */
108/* Set this to -1, which complies with RFC2616 by not setting
109 * max-forwards if the client didn't send it to us.
110 */
111#define DEFAULT_MAX_FORWARDS -1
112
117
118/* static information about a remote proxy */
120 const char *scheme; /* the schemes handled by this proxy, or '*' */
121 const char *protocol; /* the scheme used to talk to this proxy */
122 const char *hostname; /* the hostname of this proxy */
123 ap_regex_t *regexp; /* compiled regex (if any) for the remote */
124 const char *creds; /* auth credentials (if any) for the proxy */
125 int use_regex; /* simple boolean. True if we have a regex pattern */
126 apr_port_t port; /* the port for this proxy */
127};
128
129#define PROXYPASS_NOCANON 0x01
130#define PROXYPASS_INTERPOLATE 0x02
131#define PROXYPASS_NOQUERY 0x04
132#define PROXYPASS_MAP_ENCODED 0x08
133#define PROXYPASS_MAP_SERVLET 0x18 /* + MAP_ENCODED */
135 const char *real;
136 const char *fake;
138 unsigned int flags;
139 proxy_balancer *balancer; /* only valid for reverse-proxys */
140};
141
148
150 const char *name;
152};
153
154typedef struct {
160 apr_array_header_t *workers; /* non-balancer workers, eg ProxyPass http://example.com */
161 apr_array_header_t *balancers; /* list of balancers @ config time */
162 proxy_worker *forward; /* forward proxy worker */
163 proxy_worker *reverse; /* reverse "module-driven" proxy worker */
164 const char *domain; /* domain name to use in absence of a domain name in the request */
165 const char *id;
166 apr_pool_t *pool; /* Pool used for allocating this struct's elements */
167 int req; /* true if proxy requests are enabled */
168 int max_balancers; /* maximum number of allowed balancers */
169 int bgrowth; /* number of post-config balancers can added */
170 enum {
174 via_full
175 } viaopt; /* how to deal with proxy Via: headers */
178 long maxfwd;
180 enum {
183 bad_body
184 } badopt; /* how to deal with bad headers */
185 enum {
188 status_full
189 } proxy_status; /* Status display options */
191 apr_global_mutex_t *mutex; /* global lock, for pool, etc */
192 ap_slotmem_instance_t *bslot; /* balancers shm data - runtime */
194
195 unsigned int req_set:1;
196 unsigned int viaopt_set:1;
197 unsigned int recv_buffer_size_set:1;
198 unsigned int io_buffer_size_set:1;
199 unsigned int maxfwd_set:1;
200 unsigned int timeout_set:1;
201 unsigned int badopt_set:1;
202 unsigned int proxy_status_set:1;
203 unsigned int source_address_set:1;
204 unsigned int bgrowth_set:1;
205 unsigned int bal_persist:1;
206 unsigned int inherit:1;
207 unsigned int inherit_set:1;
208 unsigned int ppinherit:1;
209 unsigned int ppinherit_set:1;
210 unsigned int map_encoded_one:1;
211 unsigned int map_encoded_all:1;
213
214typedef struct {
215 const char *p; /* The path */
216 ap_regex_t *r; /* Is this a regex? */
217
218/* FIXME
219 * ProxyPassReverse and friends are documented as working inside
220 * <Location>. But in fact they never have done in the case of
221 * more than one <Location>, because the server_conf can't see it.
222 * We need to move them to the per-dir config.
223 * Discussed in February 2005:
224 * http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=110726027118798&w=2
225 */
229 signed char p_is_fnmatch; /* Is the path an fnmatch candidate? */
230 signed char interpolate_env;
232
241 unsigned int error_override:1;
242 unsigned int preserve_host:1;
243 unsigned int preserve_host_set:1;
244 unsigned int error_override_set:1;
245 unsigned int alias_set:1;
246 unsigned int add_forwarded_headers:1;
248
251
252 unsigned int forward_100_continue:1;
254
257
258/* if we interpolate env vars per-request, we'll need a per-request
259 * copy of the reverse proxy config
260 */
266
267struct proxy_address; /* opaque TTL'ed and refcount'ed address */
268
269typedef struct {
271 request_rec *r; /* Request record of the backend request
272 * that is used over the backend connection. */
273 proxy_worker *worker; /* Connection pool this connection belongs to */
274 apr_pool_t *pool; /* Subpool for hostname and addr data */
275 const char *hostname;
276 apr_sockaddr_t *addr; /* Preparsed remote address info */
277 apr_pool_t *scpool; /* Subpool used for socket and connection data */
278 apr_socket_t *sock; /* Connection socket */
279 void *data; /* per scheme connection data */
280 void *forward; /* opaque forward proxy data */
281 apr_uint32_t flags; /* Connection flags */
283 unsigned int is_ssl:1;
284 unsigned int close:1; /* Close 'this' connection */
285 unsigned int need_flush:1; /* Flag to decide whether we need to flush the
286 * filter chain or not */
287 unsigned int inreslist:1; /* connection in apr_reslist? */
288 const char *uds_path; /* Unix domain socket path */
289 const char *ssl_hostname;/* Hostname (SNI) in use by SSL connection */
290 apr_bucket_brigade *tmp_bb;/* Temporary brigade created with the connection
291 * and its scpool/bucket_alloc (NULL before),
292 * must be left cleaned when used (locally).
293 */
294 apr_pool_t *uds_pool; /* Subpool for reusing UDS paths */
295 apr_pool_t *fwd_pool; /* Subpool for reusing ProxyRemote infos */
296 struct proxy_address *address; /* Current remote address */
298
299typedef struct {
300 float cache_completion; /* completion percentage */
301 int content_length; /* length of the content */
303
304/* Connection pool */
306 apr_pool_t *pool; /* The pool used in constructor and destructor calls */
307 apr_sockaddr_t *addr; /* Preparsed remote address info */
308 apr_reslist_t *res; /* Connection resource list */
309 proxy_conn_rec *conn; /* Single connection for prefork mpm */
310 apr_pool_t *dns_pool; /* The pool used for worker scoped DNS resolutions */
311};
312
313#define AP_VOLATILIZE_T(T, x) (*(T volatile *)&(x))
314
315/* worker status bits */
316/*
317 * NOTE: Keep up-to-date w/ proxy_wstat_tbl[]
318 * in mod_proxy.c !
319 */
320#define PROXY_WORKER_INITIALIZED 0x0001
321#define PROXY_WORKER_IGNORE_ERRORS 0x0002
322#define PROXY_WORKER_DRAIN 0x0004
323#define PROXY_WORKER_GENERIC 0x0008
324#define PROXY_WORKER_IN_SHUTDOWN 0x0010
325#define PROXY_WORKER_DISABLED 0x0020
326#define PROXY_WORKER_STOPPED 0x0040
327#define PROXY_WORKER_IN_ERROR 0x0080
328#define PROXY_WORKER_HOT_STANDBY 0x0100
329#define PROXY_WORKER_FREE 0x0200
330#define PROXY_WORKER_HC_FAIL 0x0400
331#define PROXY_WORKER_HOT_SPARE 0x0800
332
333/* worker status flags */
334#define PROXY_WORKER_INITIALIZED_FLAG 'O'
335#define PROXY_WORKER_IGNORE_ERRORS_FLAG 'I'
336#define PROXY_WORKER_DRAIN_FLAG 'N'
337#define PROXY_WORKER_GENERIC_FLAG 'G'
338#define PROXY_WORKER_IN_SHUTDOWN_FLAG 'U'
339#define PROXY_WORKER_DISABLED_FLAG 'D'
340#define PROXY_WORKER_STOPPED_FLAG 'S'
341#define PROXY_WORKER_IN_ERROR_FLAG 'E'
342#define PROXY_WORKER_HOT_STANDBY_FLAG 'H'
343#define PROXY_WORKER_FREE_FLAG 'F'
344#define PROXY_WORKER_HC_FAIL_FLAG 'C'
345#define PROXY_WORKER_HOT_SPARE_FLAG 'R'
346
347#define PROXY_WORKER_NOT_USABLE_BITMAP ( PROXY_WORKER_IN_SHUTDOWN | \
348PROXY_WORKER_DISABLED | PROXY_WORKER_STOPPED | PROXY_WORKER_IN_ERROR | \
349PROXY_WORKER_HC_FAIL )
350
351/* NOTE: these check the shared status */
352#define PROXY_WORKER_IS_INITIALIZED(f) ( (f)->s->status & PROXY_WORKER_INITIALIZED )
353
354#define PROXY_WORKER_IS_STANDBY(f) ( (f)->s->status & PROXY_WORKER_HOT_STANDBY )
355
356#define PROXY_WORKER_IS_SPARE(f) ( (f)->s->status & PROXY_WORKER_HOT_SPARE )
357
358#define PROXY_WORKER_IS_USABLE(f) ( ( !( (f)->s->status & PROXY_WORKER_NOT_USABLE_BITMAP) ) && \
359 PROXY_WORKER_IS_INITIALIZED(f) )
360
361#define PROXY_WORKER_IS_DRAINING(f) ( (f)->s->status & PROXY_WORKER_DRAIN )
362
363#define PROXY_WORKER_IS_GENERIC(f) ( (f)->s->status & PROXY_WORKER_GENERIC )
364
365#define PROXY_WORKER_IS_HCFAILED(f) ( (f)->s->status & PROXY_WORKER_HC_FAIL )
366
367#define PROXY_WORKER_IS_ERROR(f) ( (f)->s->status & PROXY_WORKER_IN_ERROR )
368
369#define PROXY_WORKER_IS(f, b) ( (f)->s->status & (b) )
370
371/* default worker retry timeout in seconds */
372#define PROXY_WORKER_DEFAULT_RETRY 60
373
374/* Some max char string sizes, for shm fields */
375#define PROXY_WORKER_MAX_SCHEME_SIZE 16
376#define PROXY_WORKER_MAX_ROUTE_SIZE 64
377#define PROXY_BALANCER_MAX_ROUTE_SIZE PROXY_WORKER_MAX_ROUTE_SIZE
378#define PROXY_WORKER_MAX_NAME_SIZE 96
379#define PROXY_BALANCER_MAX_NAME_SIZE PROXY_WORKER_MAX_NAME_SIZE
380#define PROXY_WORKER_MAX_HOSTNAME_SIZE 64
381#define PROXY_BALANCER_MAX_HOSTNAME_SIZE PROXY_WORKER_MAX_HOSTNAME_SIZE
382#define PROXY_BALANCER_MAX_STICKY_SIZE 64
383#define PROXY_WORKER_MAX_SECRET_SIZE 64
384
385#define PROXY_RFC1035_HOSTNAME_SIZE 256
386#define PROXY_WORKER_EXT_NAME_SIZE 384
387
388/* RFC-1035 mentions limits of 255 for host-names and 253 for domain-names,
389 * dotted together(?) this would fit the below size (+ trailing NUL).
390 */
391#define PROXY_WORKER_RFC1035_NAME_SIZE 512
392
393#define PROXY_MAX_PROVIDER_NAME_SIZE 16
394
395#define PROXY_STRNCPY(dst, src) ap_proxy_strncpy((dst), (src), (sizeof(dst)))
396
397#define PROXY_COPY_CONF_PARAMS(w, c) \
398do { \
399(w)->s->timeout = (c)->timeout; \
400(w)->s->timeout_set = (c)->timeout_set; \
401(w)->s->recv_buffer_size = (c)->recv_buffer_size; \
402(w)->s->recv_buffer_size_set = (c)->recv_buffer_size_set; \
403(w)->s->io_buffer_size = (c)->io_buffer_size; \
404(w)->s->io_buffer_size_set = (c)->io_buffer_size_set; \
405} while (0)
406
407#define PROXY_SHOULD_PING_100_CONTINUE(w, r) \
408 ((w)->s->ping_timeout_set \
409 && (PROXYREQ_REVERSE == (r)->proxyreq) \
410 && ap_request_has_body((r)))
411
412#define PROXY_DO_100_CONTINUE(w, r) \
413 (PROXY_SHOULD_PING_100_CONTINUE(w, r) \
414 && !apr_table_get((r)->subprocess_env, "force-proxy-request-1.0"))
415
416/* use 2 hashes */
417typedef struct {
418 unsigned int def;
419 unsigned int fnv;
420} proxy_hashes ;
421
422/* Runtime worker status information. Shared in scoreboard */
423/* The addition of member uds_path in 2.4.7 was an incompatible API change. */
424typedef struct {
426 char scheme[PROXY_WORKER_MAX_SCHEME_SIZE]; /* scheme to use ajp|http|https */
427 char hostname[PROXY_WORKER_MAX_HOSTNAME_SIZE]; /* remote backend address (deprecated, use hostname_ex below) */
428 char route[PROXY_WORKER_MAX_ROUTE_SIZE]; /* balancing route */
429 char redirect[PROXY_WORKER_MAX_ROUTE_SIZE]; /* temporary balancing redirection route */
430 char flusher[PROXY_WORKER_MAX_SCHEME_SIZE]; /* flush provider used by mod_proxy_fdpass */
431 char uds_path[PROXY_WORKER_MAX_NAME_SIZE]; /* path to worker's unix domain socket if applicable */
432 int lbset; /* load balancer cluster set */
433 int retries; /* number of retries on this worker */
434 int lbstatus; /* Current lbstatus */
435 int lbfactor; /* dynamic lbfactor */
436 int min; /* Desired minimum number of available connections */
437 int smax; /* Soft maximum on the total number of connections */
438 int hmax; /* Hard maximum on the total number of connections */
439 int flush_wait; /* poll wait time in microseconds if flush_auto */
440 int index; /* shm array index */
441 proxy_hashes hash; /* hash of worker name */
442 unsigned int status; /* worker status bitfield */
443 enum {
446 flush_auto
447 } flush_packets; /* control AJP flushing */
448 apr_time_t updated; /* timestamp of last update for dynamic workers, or queue-time of HC workers */
449 apr_time_t error_time; /* time of the last error */
450 apr_interval_time_t ttl; /* maximum amount of time in seconds a connection
451 * may be available while exceeding the soft limit */
452 apr_interval_time_t retry; /* retry interval */
453 apr_interval_time_t timeout; /* connection timeout */
454 apr_interval_time_t acquire; /* acquire timeout when the maximum number of connections is exceeded */
459 apr_size_t elected; /* Number of times the worker was elected */
460 apr_size_t busy; /* busyness factor */
462 apr_off_t transferred;/* Number of bytes transferred to remote */
463 apr_off_t read; /* Number of bytes read from remote */
464 void *context; /* general purpose storage */
465 unsigned int keepalive:1;
466 unsigned int disablereuse:1;
467 unsigned int is_address_reusable:1;
468 unsigned int retry_set:1;
469 unsigned int timeout_set:1;
470 unsigned int acquire_set:1;
471 unsigned int ping_timeout_set:1;
472 unsigned int conn_timeout_set:1;
473 unsigned int recv_buffer_size_set:1;
474 unsigned int io_buffer_size_set:1;
475 unsigned int keepalive_set:1;
476 unsigned int disablereuse_set:1;
477 unsigned int was_malloced:1;
478 unsigned int is_name_matchable:1;
479 char hcuri[PROXY_WORKER_MAX_ROUTE_SIZE]; /* health check uri */
480 char hcexpr[PROXY_WORKER_MAX_SCHEME_SIZE]; /* name of condition expr for health check */
481 int passes; /* number of successes for check to pass */
482 int pcount; /* current count of passes */
483 int fails; /* number of failures for check to fail */
484 int fcount; /* current count of failures */
485 hcmethod_t method; /* method to use for health check */
487 char upgrade[PROXY_WORKER_MAX_SCHEME_SIZE];/* upgrade protocol used by mod_proxy_wstunnel */
488 char hostname_ex[PROXY_RFC1035_HOSTNAME_SIZE]; /* RFC1035 compliant version of the remote backend address */
489 apr_size_t response_field_size; /* Size of proxy response buffer in bytes. */
491 char secret[PROXY_WORKER_MAX_SECRET_SIZE]; /* authentication secret (e.g. AJP13) */
492 char name_ex[PROXY_WORKER_EXT_NAME_SIZE]; /* Extended name (>96 chars for 2.4.x) */
493 unsigned int address_ttl_set:1;
494 apr_int32_t address_ttl; /* backend address' TTL (seconds) */
495 apr_uint32_t address_expiry; /* backend address' next expiry time */
497
498#define ALIGNED_PROXY_WORKER_SHARED_SIZE (APR_ALIGN_DEFAULT(sizeof(proxy_worker_shared)))
499
500/* Worker configuration */
502 proxy_hashes hash; /* hash of worker name */
503 unsigned int local_status; /* status of per-process worker */
504 proxy_conn_pool *cp; /* Connection pool to use */
505 proxy_worker_shared *s; /* Shared data */
506 proxy_balancer *balancer; /* which balancer am I in? */
507#if APR_HAS_THREADS
508 apr_thread_mutex_t *tmutex; /* Thread lock for updating address cache */
509#endif
510 void *context; /* general purpose storage */
511 ap_conf_vector_t *section_config; /* <Proxy>-section wherein defined */
512 struct proxy_address *volatile address; /* current worker address (if reusable) */
513};
514
515/* default to health check every 30 seconds */
516#define HCHECK_WATHCHDOG_DEFAULT_INTERVAL (30)
517/* The watchdog runs every 2 seconds, which is also the minimal check */
518#define HCHECK_WATHCHDOG_INTERVAL (2)
519
520/*
521 * Time to wait (in microseconds) to find out if more data is currently
522 * available at the backend.
523 */
524#define PROXY_FLUSH_WAIT 10000
525
526typedef struct {
527 char sticky_path[PROXY_BALANCER_MAX_STICKY_SIZE]; /* URL sticky session identifier */
528 char sticky[PROXY_BALANCER_MAX_STICKY_SIZE]; /* sticky session identifier */
529 char lbpname[PROXY_MAX_PROVIDER_NAME_SIZE]; /* lbmethod provider name */
535 apr_interval_time_t timeout; /* Timeout for waiting on free connection */
536 apr_time_t wupdated; /* timestamp of last change to workers list */
537 int max_attempts; /* Number of attempts before failing */
538 int index; /* shm array index */
540 unsigned int sticky_force:1; /* Disable failover for sticky sessions */
541 unsigned int scolonsep:1; /* true if ';' seps sticky session paths */
542 unsigned int max_attempts_set:1;
543 unsigned int was_malloced:1;
544 unsigned int need_reset:1;
545 unsigned int vhosted:1;
546 unsigned int inactive:1;
547 unsigned int forcerecovery:1;
548 char sticky_separator; /* separator for sessionid/route */
549 unsigned int forcerecovery_set:1;
550 unsigned int scolonsep_set:1;
551 unsigned int sticky_force_set:1;
552 unsigned int nonce_set:1;
553 unsigned int sticky_separator_set:1;
555
556#define ALIGNED_PROXY_BALANCER_SHARED_SIZE (APR_ALIGN_DEFAULT(sizeof(proxy_balancer_shared)))
557
559 apr_array_header_t *workers; /* initially configured workers */
560 apr_array_header_t *errstatuses; /* statuses to force members into error */
561 ap_slotmem_instance_t *wslot; /* worker shm data - runtime */
563 int growth; /* number of post-config workers can added */
564 int max_workers; /* maximum number of allowed workers */
566 apr_time_t wupdated; /* timestamp of last change to workers list */
568 apr_global_mutex_t *gmutex; /* global lock for updating list of workers */
569#if APR_HAS_THREADS
570 apr_thread_mutex_t *tmutex; /* Thread lock for updating shm */
571#endif
573 void *context; /* general purpose storage */
574 proxy_balancer_shared *s; /* Shared data */
575 int failontimeout; /* Whether to mark a member in Err if IO timeout occurs */
576 unsigned int failontimeout_set:1;
577 unsigned int growth_set:1;
578 unsigned int lbmethod_set:1;
579 ap_conf_vector_t *section_config; /* <Proxy>-section wherein defined */
580};
581
583 const char *name; /* name of the load balancer method*/
584 proxy_worker *(*finder)(proxy_balancer *balancer,
585 request_rec *r);
586 void *context; /* general purpose storage */
590};
591
592#define PROXY_THREAD_LOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_lock((x)->tmutex) : APR_SUCCESS)
593#define PROXY_THREAD_UNLOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_unlock((x)->tmutex) : APR_SUCCESS)
594
595#define PROXY_GLOBAL_LOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_lock((x)->gmutex) : APR_SUCCESS)
596#define PROXY_GLOBAL_UNLOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_unlock((x)->gmutex) : APR_SUCCESS)
597
598/* hooks */
599
600/* Create a set of PROXY_DECLARE(type), PROXY_DECLARE_NONSTD(type) and
601 * PROXY_DECLARE_DATA with appropriate export and import tags for the platform
602 */
603#if !defined(WIN32)
604#define PROXY_DECLARE(type) type
605#define PROXY_DECLARE_NONSTD(type) type
606#define PROXY_DECLARE_DATA
607#elif defined(PROXY_DECLARE_STATIC)
608#define PROXY_DECLARE(type) type __stdcall
609#define PROXY_DECLARE_NONSTD(type) type
610#define PROXY_DECLARE_DATA
611#elif defined(PROXY_DECLARE_EXPORT)
612#define PROXY_DECLARE(type) __declspec(dllexport) type __stdcall
613#define PROXY_DECLARE_NONSTD(type) __declspec(dllexport) type
614#define PROXY_DECLARE_DATA __declspec(dllexport)
615#else
616#define PROXY_DECLARE(type) __declspec(dllimport) type __stdcall
617#define PROXY_DECLARE_NONSTD(type) __declspec(dllimport) type
618#define PROXY_DECLARE_DATA __declspec(dllimport)
619#endif
620
621/* Using PROXY_DECLARE_OPTIONAL_HOOK instead of
622 * APR_DECLARE_EXTERNAL_HOOK allows build/make_nw_export.awk
623 * to distinguish between hooks that implement
624 * proxy_hook_xx and proxy_hook_get_xx in mod_proxy.c and
625 * those which don't.
626 */
627#define PROXY_DECLARE_OPTIONAL_HOOK APR_DECLARE_EXTERNAL_HOOK
628
629/* These 2 are in mod_proxy.c */
632
633/* Following 4 from health check */
639 const char *, const char *, void *));
640
643 apr_pool_t *ptemp, server_rec *s,
644 ap_conf_vector_t *section_config))
645
647 (request_rec *r, proxy_worker *worker,
648 proxy_server_conf *conf, char *url,
651 (request_rec *r, const char *url))
653 (request_rec *r, char *url))
654
657
658
668 proxy_balancer **balancer,
669 request_rec *r,
670 proxy_server_conf *conf, char **url))
676 proxy_balancer *balancer, request_rec *r,
678
686
687/* proxy_util.c */
688
692PROXY_DECLARE(void) ap_proxy_c2hex(int ch, char *x);
694 int flags, int proxyreq);
696 int forcedec, int proxyreq);
698 char **passwordp, char **hostp, apr_port_t *port);
701
712
714/* DEPRECATED (will be replaced with ap_proxy_connect_backend */
716/* DEPRECATED (will be replaced with ap_proxy_check_connection */
718 request_rec *r);
722 ap_conf_vector_t *per_dir_config,
723 int enable);
726
727/* Header mapping functions, and a typedef of their signature */
730
731#if !defined(WIN32)
732typedef const char *(*ap_proxy_header_reverse_map_fn)(request_rec *,
733 proxy_dir_conf *, const char *);
734#elif defined(PROXY_DECLARE_STATIC)
736 proxy_dir_conf *, const char *);
737#elif defined(PROXY_DECLARE_EXPORT)
738typedef __declspec(dllexport) const char *
740 proxy_dir_conf *, const char *);
741#else
742typedef __declspec(dllimport) const char *
744 proxy_dir_conf *, const char *);
745#endif
746
747
748/* Connection pool API */
757 proxy_worker *worker);
758
768 const proxy_worker *worker,
769 const char *upgrade,
770 const char *dflt);
771
772/* Bitmask for ap_proxy_{define,get}_worker_ex(). */
773#define AP_PROXY_WORKER_IS_PREFIX (1u << 0)
774#define AP_PROXY_WORKER_IS_MATCH (1u << 1)
775#define AP_PROXY_WORKER_IS_MALLOCED (1u << 2)
776#define AP_PROXY_WORKER_NO_UDS (1u << 3)
777
789 proxy_balancer *balancer,
790 proxy_server_conf *conf,
791 const char *url,
792 unsigned int mask);
793
803 proxy_balancer *balancer,
804 proxy_server_conf *conf,
805 const char *url);
806
819 proxy_worker **worker,
820 proxy_balancer *balancer,
821 proxy_server_conf *conf,
822 const char *url,
823 unsigned int mask);
824
836 proxy_worker **worker,
837 proxy_balancer *balancer,
838 proxy_server_conf *conf,
839 const char *url,
840 int do_malloc);
841
855 proxy_worker **worker,
856 proxy_balancer *balancer,
857 proxy_server_conf *conf,
858 const char *url,
859 int do_malloc);
860
870 int i);
871
880 server_rec *s,
881 apr_pool_t *p);
882
890
891
901 proxy_server_conf *conf,
902 const char *url,
903 int careactive);
904
913 proxy_balancer *balancer,
914 const char *url);
915
927 proxy_balancer **balancer,
928 proxy_server_conf *conf,
929 const char *url,
930 const char *alias,
931 int do_malloc);
932
942 int i);
943
952 server_rec *s,
953 apr_pool_t *p);
954
956
968 request_rec *r,
970 void *baton);
971/*
972 * Needed by the lb modules.
973 */
975 (proxy_balancer *balancer,
976 request_rec *r,
978 void *baton));
979
990 proxy_worker *worker,
991 unsigned int *index);
992
1003 proxy_balancer *balancer,
1004 unsigned int *index);
1005
1006/*
1007 * Strip the UDS part of r->filename if any, and put the UDS path in
1008 * r->notes ("uds_path")
1009 * @param r current request
1010 * @return OK if fixed up, DECLINED if not UDS, or an HTTP_XXX error
1011 * @remark Deprecated (for internal use only)
1012 */
1014
1027 proxy_balancer **balancer,
1028 request_rec *r,
1029 proxy_server_conf *conf,
1030 char **url);
1042 proxy_balancer *balancer,
1043 request_rec *r,
1044 proxy_server_conf *conf);
1045
1046/* Bitmask for ap_proxy_determine_address() */
1047#define PROXY_DETERMINE_ADDRESS_CHECK (1u << 0)
1062 proxy_conn_rec *conn,
1063 const char *hostname,
1064 apr_port_t hostport,
1065 unsigned int flags,
1066 request_rec *r,
1067 server_rec *s);
1068
1086 proxy_server_conf *conf,
1087 proxy_worker *worker,
1088 proxy_conn_rec *conn,
1089 apr_uri_t *uri,
1090 char **url,
1091 const char *proxyname,
1093 char *server_portstr,
1095
1106 (const char *proxy_function, proxy_worker *worker, server_rec *s));
1107
1120 proxy_conn_rec **conn,
1121 proxy_worker *worker,
1122 server_rec *s);
1132 proxy_conn_rec *conn,
1133 server_rec *s);
1134
1135#define PROXY_CHECK_CONN_EMPTY (1 << 0)
1151 proxy_conn_rec *conn,
1153 unsigned max_blank_lines,
1154 int flags);
1155
1167 proxy_conn_rec *conn,
1168 proxy_worker *worker,
1169 server_rec *s);
1170
1179 const char *uds_path,
1180 apr_pool_t *p);
1192 proxy_conn_rec *conn,
1193 conn_rec *c, server_rec *s);
1194
1205 proxy_conn_rec *conn,
1206 request_rec *r);
1216
1226
1235
1236PROXY_DECLARE(unsigned int) ap_proxy_hashfunc(const char *str, proxy_hash_t method);
1237
1238
1247
1248
1256
1257
1266 server_rec *s,
1267 proxy_server_conf *conf);
1268
1279
1292 struct proxy_alias *ent,
1293 proxy_dir_conf *dconf);
1294
1311 apr_bucket_brigade *header_brigade,
1312 request_rec *r,
1313 proxy_conn_rec *p_conn,
1314 proxy_worker *worker,
1315 proxy_server_conf *conf,
1316 apr_uri_t *uri,
1317 char *url, char *server_portstr,
1318 char **old_cl_val,
1319 char **old_te_val);
1320
1335 proxy_conn_rec *backend,
1336 apr_bucket_brigade *input_brigade,
1340
1351 proxy_conn_rec *backend,
1352 apr_bucket_brigade *input_brigade,
1355
1366 proxy_conn_rec *backend,
1367 apr_bucket_brigade *input_brigade,
1369
1380 request_rec *r, proxy_conn_rec *p_conn,
1381 conn_rec *origin, apr_bucket_brigade *bb,
1382 int flush);
1383
1384struct proxy_tunnel_conn; /* opaque */
1397
1408 const char *scheme);
1409
1418
1428
1436
1437
1443
1444#define PROXY_LBMETHOD "proxylbmethod"
1445
1446/* The number of dynamic workers that can be added when reconfiguring.
1447 * If this limit is reached you must stop and restart the server.
1448 */
1449#define PROXY_DYNAMIC_BALANCER_LIMIT 16
1450
1455int ap_proxy_lb_workers(void);
1456
1465
1472
1479
1486PROXY_DECLARE(const char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url);
1487
1488/*
1489 * Transform buckets from one bucket allocator to another one by creating a
1490 * transient bucket for each data bucket and let it use the data read from
1491 * the old bucket. Metabuckets are transformed by just recreating them.
1492 * Attention: Currently only the following bucket types are handled:
1493 *
1494 * All data buckets
1495 * FLUSH
1496 * EOS
1497 *
1498 * If an other bucket type is found its type is logged as a debug message
1499 * and APR_EGENERAL is returned.
1500 *
1501 * @param r request_rec of the actual request. Used for logging purposes
1502 * @param from the bucket brigade to take the buckets from
1503 * @param to the bucket brigade to store the transformed buckets
1504 * @return apr_status_t of the operation. Either APR_SUCCESS or
1505 * APR_EGENERAL
1506 */
1508 apr_bucket_brigade *from,
1510
1511/*
1512 * The flags for ap_proxy_transfer_between_connections(), where for legacy and
1513 * compatibility reasons FLUSH_EACH and FLUSH_AFTER are boolean values.
1514 */
1515#define AP_PROXY_TRANSFER_FLUSH_EACH (0x00)
1516#define AP_PROXY_TRANSFER_FLUSH_AFTER (0x01)
1517#define AP_PROXY_TRANSFER_YIELD_PENDING (0x02)
1518#define AP_PROXY_TRANSFER_YIELD_MAX_READS (0x04)
1519
1520/*
1521 * Sends all data that can be read non blocking from the input filter chain of
1522 * c_i and send it down the output filter chain of c_o. For reading it uses
1523 * the bucket brigade bb_i which should be created from the bucket allocator
1524 * associated with c_i. For sending through the output filter chain it uses
1525 * the bucket brigade bb_o which should be created from the bucket allocator
1526 * associated with c_o. In order to get the buckets from bb_i to bb_o
1527 * ap_proxy_buckets_lifetime_transform is used.
1528 *
1529 * @param r request_rec of the actual request. Used for logging purposes
1530 * @param c_i inbound connection conn_rec
1531 * @param c_o outbound connection conn_rec
1532 * @param bb_i bucket brigade for pulling data from the inbound connection
1533 * @param bb_o bucket brigade for sending data through the outbound connection
1534 * @param name string for logging from where data was pulled
1535 * @param sent if not NULL will be set to 1 if data was sent through c_o
1536 * @param bsize maximum amount of data pulled in one iteration from c_i
1537 * @param flags AP_PROXY_TRANSFER_* bitmask
1538 * @return apr_status_t of the operation. Could be any error returned from
1539 * either the input filter chain of c_i or the output filter chain
1540 * of c_o, APR_EPIPE if the outgoing connection was aborted, or
1541 * APR_INCOMPLETE if AP_PROXY_TRANSFER_YIELD_PENDING was set and
1542 * the output stack gets full before the input stack is exhausted.
1543 */
1545 request_rec *r,
1546 conn_rec *c_i,
1547 conn_rec *c_o,
1550 const char *name,
1551 int *sent,
1553 int flags);
1554
1555extern module PROXY_DECLARE_DATA proxy_module;
1556
1557#endif /*MOD_PROXY_H*/
Symbol export macros and hook functions.
Apache Provider API.
const char apr_size_t len
Definition ap_regex.h:187
Memory Slot Extension Storage Module for Apache.
#define socket
APR-UTIL Buckets/Bucket Brigades.
APR-UTIL date routines.
APR FNMatch Functions.
APR Global Locking Routines.
Apache hook functions.
APR general purpose library routines.
APR MD5 Routines.
APR Network library.
APR-UTIL registration of functions exported by modules.
APR memory allocation.
APR-UTIL Resource List Routines.
APR Strings library.
APR-UTIL string matching routines.
APR Thread Mutex Routines.
APR-UTIL URI Routines.
APR UUID library.
APR Standard Headers Support.
struct ap_conf_vector_t ap_conf_vector_t
const char * hostname
request_rec * r
int flush
const char apr_port_t port
Definition http_vhost.h:125
ap_vhost_iterate_conn_cb void * baton
Definition http_vhost.h:87
#define APR_UUID_FORMATTED_LENGTH
Definition apr_uuid.h:46
apr_read_type_e
Definition apr_buckets.h:57
apr_pool_t const char * params
Definition apr_dbd.h:141
const char * mask
Definition apr_date.h:60
const char * src
Definition apr_encode.h:167
const char apr_ssize_t int flags
Definition apr_encode.h:168
const char * url
Definition apr_escape.h:120
#define APR_DECLARE_EXTERNAL_HOOK(ns, link, ret, name, args)
Definition apr_hooks.h:118
apr_memcache_server_t * server
#define APR_DECLARE_OPTIONAL_FN(ret, name, args)
const char * uri
Definition apr_uri.h:159
#define PROXY_DECLARE_DATA
Definition mod_proxy.h:606
int ap_proxy_ssl_engine(conn_rec *c, ap_conf_vector_t *per_dir_config, int enable)
Definition mod_proxy.c:3061
int ap_proxy_connect_backend(const char *proxy_function, proxy_conn_rec *conn, proxy_worker *worker, server_rec *s)
#define PROXY_WORKER_MAX_HOSTNAME_SIZE
Definition mod_proxy.h:380
#define PROXY_BALANCER_MAX_NAME_SIZE
Definition mod_proxy.h:379
apr_status_t ap_proxy_transfer_between_connections(request_rec *r, conn_rec *c_i, conn_rec *c_o, apr_bucket_brigade *bb_i, apr_bucket_brigade *bb_o, const char *name, int *sent, apr_off_t bsize, int flags)
int ap_proxy_ssl_disable(conn_rec *c)
Definition mod_proxy.c:3056
apr_status_t ap_proxy_set_wstatus(char c, int set, proxy_worker *w)
int ap_proxy_should_override(proxy_dir_conf *conf, int code)
#define PROXY_WORKER_MAX_ROUTE_SIZE
Definition mod_proxy.h:376
#define PROXY_DECLARE(type)
Definition mod_proxy.h:604
#define PROXY_BALANCER_MAX_ROUTE_SIZE
Definition mod_proxy.h:377
int ap_proxy_read_input(request_rec *r, proxy_conn_rec *backend, apr_bucket_brigade *input_brigade, apr_off_t max_read)
char * ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp, char **passwordp, char **hostp, apr_port_t *port)
Definition proxy_util.c:342
int ap_proxy_release_connection(const char *proxy_function, proxy_conn_rec *conn, server_rec *s)
int ap_proxy_tunnel_run(proxy_tunnel_rec *tunnel)
char * ap_proxy_define_match_worker(apr_pool_t *p, proxy_worker **worker, proxy_balancer *balancer, proxy_server_conf *conf, const char *url, int do_malloc)
int ap_proxy_acquire_connection(const char *proxy_function, proxy_conn_rec **conn, proxy_worker *worker, server_rec *s)
apr_status_t ap_proxy_determine_address(const char *proxy_function, proxy_conn_rec *conn, const char *hostname, apr_port_t hostport, unsigned int flags, request_rec *r, server_rec *s)
char * ap_proxy_define_balancer(apr_pool_t *p, proxy_balancer **balancer, proxy_server_conf *conf, const char *url, const char *alias, int do_malloc)
int ap_proxy_hex2c(const char *x)
Definition proxy_util.c:118
proxy_worker * ap_proxy_get_worker(apr_pool_t *p, proxy_balancer *balancer, proxy_server_conf *conf, const char *url)
enctype
Definition mod_proxy.h:75
char * ap_proxy_define_worker(apr_pool_t *p, proxy_worker **worker, proxy_balancer *balancer, proxy_server_conf *conf, const char *url, int do_malloc)
const char * ap_proxy_de_socketfy(apr_pool_t *p, const char *url)
Definition mod_proxy.c:1938
proxy_worker_shared * ap_proxy_find_workershm(ap_slotmem_provider_t *storage, ap_slotmem_instance_t *slot, proxy_worker *worker, unsigned int *index)
int ap_proxy_spool_input(request_rec *r, proxy_conn_rec *backend, apr_bucket_brigade *input_brigade, apr_off_t *bytes_spooled, apr_off_t max_mem_spool)
hcmethod_t
Definition mod_proxy.h:83
int ap_proxy_trans_match(request_rec *r, struct proxy_alias *ent, proxy_dir_conf *dconf)
Definition mod_proxy.c:825
char * ap_proxy_canonenc_ex(apr_pool_t *p, const char *x, int len, enum enctype t, int flags, int proxyreq)
Definition proxy_util.c:220
void ap_proxy_c2hex(int ch, char *x)
Definition proxy_util.c:173
void ap_proxy_backend_broke(request_rec *r, apr_bucket_brigade *brigade)
const char * ap_proxy_location_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *url)
Definition proxy_util.c:882
int() proxy_is_best_callback_fn_t(proxy_worker *current, proxy_worker *prev_best, void *baton)
Definition mod_proxy.h:955
apr_status_t ap_proxy_tunnel_create(proxy_tunnel_rec **tunnel, request_rec *r, conn_rec *c_o, const char *scheme)
apr_status_t ap_proxy_check_connection(const char *scheme, proxy_conn_rec *conn, server_rec *server, unsigned max_blank_lines, int flags)
#define PROXY_WORKER_MAX_SECRET_SIZE
Definition mod_proxy.h:383
char * ap_proxy_define_worker_ex(apr_pool_t *p, proxy_worker **worker, proxy_balancer *balancer, proxy_server_conf *conf, const char *url, unsigned int mask)
int ap_proxy_post_request(proxy_worker *worker, proxy_balancer *balancer, request_rec *r, proxy_server_conf *conf)
int ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, apr_sockaddr_t *uri_addr)
Definition proxy_util.c:816
int ap_proxy_checkproxyblock2(request_rec *r, proxy_server_conf *conf, const char *hostname, apr_sockaddr_t *addr)
Definition proxy_util.c:824
proxy_worker * ap_proxy_get_worker_ex(apr_pool_t *p, proxy_balancer *balancer, proxy_server_conf *conf, const char *url, unsigned int mask)
proxy_balancer * ap_proxy_get_balancer(apr_pool_t *p, proxy_server_conf *conf, const char *url, int careactive)
int ap_proxy_connection_reusable(proxy_conn_rec *conn)
#define PROXY_MAX_PROVIDER_NAME_SIZE
Definition mod_proxy.h:393
#define PROXY_WORKER_MAX_NAME_SIZE
Definition mod_proxy.h:378
int ap_proxy_valid_balancer_name(char *name, int i)
#define PROXY_WORKER_MAX_SCHEME_SIZE
Definition mod_proxy.h:375
int ap_proxy_pre_http_request(conn_rec *c, request_rec *r)
Definition proxy_util.c:876
int ap_proxy_conn_is_https(conn_rec *c)
Definition mod_proxy.c:3075
apr_status_t ap_proxy_strncpy(char *dst, const char *src, apr_size_t dlen)
Definition proxy_util.c:94
apr_status_t ap_proxy_share_worker(proxy_worker *worker, proxy_worker_shared *shm, int i)
int ap_proxy_worker_can_upgrade(apr_pool_t *p, const proxy_worker *worker, const char *upgrade, const char *dflt)
#define PROXY_BALANCER_MAX_HOSTNAME_SIZE
Definition mod_proxy.h:381
apr_status_t ap_proxy_buckets_lifetime_transform(request_rec *r, apr_bucket_brigade *from, apr_bucket_brigade *to)
#define PROXY_RFC1035_HOSTNAME_SIZE
Definition mod_proxy.h:385
const char *(* ap_proxy_header_reverse_map_fn)(request_rec *, proxy_dir_conf *, const char *)
Definition mod_proxy.h:732
proxy_wstat_t proxy_wstat_tbl[]
Definition mod_proxy.c:61
int ap_proxy_pre_request(proxy_worker **worker, proxy_balancer **balancer, request_rec *r, proxy_server_conf *conf, char **url)
apr_status_t ap_proxy_connect_uds(apr_socket_t *sock, const char *uds_path, apr_pool_t *p)
int ap_proxy_connect_to_backend(apr_socket_t **, const char *, apr_sockaddr_t *, const char *, proxy_server_conf *, request_rec *)
char * ap_proxy_parse_wstatus(apr_pool_t *p, proxy_worker *w)
apr_status_t ap_proxy_sync_balancer(proxy_balancer *b, server_rec *s, proxy_server_conf *conf)
proxy_balancer_shared * ap_proxy_find_balancershm(ap_slotmem_provider_t *storage, ap_slotmem_instance_t *slot, proxy_balancer *balancer, unsigned int *index)
int ap_proxy_connection_create_ex(const char *proxy_function, proxy_conn_rec *conn, request_rec *r)
apr_status_t ap_proxy_share_balancer(proxy_balancer *balancer, proxy_balancer_shared *shm, int i)
apr_status_t ap_proxy_ssl_connection_cleanup(proxy_conn_rec *conn, request_rec *r)
#define PROXY_BALANCER_MAX_STICKY_SIZE
Definition mod_proxy.h:382
unsigned int ap_proxy_hashfunc(const char *str, proxy_hash_t method)
const char * ap_proxy_show_hcmethod(hcmethod_t method)
int ap_proxy_fixup_uds_filename(request_rec *r)
int ap_proxy_lb_workers(void)
apr_status_t ap_proxy_initialize_worker(proxy_worker *worker, server_rec *s, apr_pool_t *p)
apr_port_t ap_proxy_port_of_scheme(const char *scheme)
int ap_proxy_create_hdrbrgd(apr_pool_t *p, apr_bucket_brigade *header_brigade, request_rec *r, proxy_conn_rec *p_conn, proxy_worker *worker, proxy_server_conf *conf, apr_uri_t *uri, char *url, char *server_portstr, char **old_cl_val, char **old_te_val)
int ap_proxyerror(request_rec *r, int statuscode, const char *message)
Definition proxy_util.c:432
int ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, proxy_server_conf *conf, proxy_worker *worker, proxy_conn_rec *conn, apr_uri_t *uri, char **url, const char *proxyname, apr_port_t proxyport, char *server_portstr, int server_portstr_size)
apr_status_t ap_proxy_initialize_balancer(proxy_balancer *balancer, server_rec *s, apr_pool_t *p)
proxy_worker * ap_proxy_balancer_get_best_worker(proxy_balancer *balancer, request_rec *r, proxy_is_best_callback_fn_t *is_best, void *baton)
proxy_hash_t
Definition mod_proxy.h:1234
const char * ap_proxy_cookie_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *str)
int ap_proxy_connection_create(const char *proxy_function, proxy_conn_rec *conn, conn_rec *c, server_rec *s)
int ap_proxy_ssl_enable(conn_rec *c)
Definition mod_proxy.c:3044
char * ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t, int forcedec, int proxyreq)
Definition proxy_util.c:321
proxy_hcmethods_t proxy_hcmethods[]
Definition mod_proxy.c:47
#define PROXY_WORKER_EXT_NAME_SIZE
Definition mod_proxy.h:386
char * ap_proxy_worker_name(apr_pool_t *p, proxy_worker *worker)
int ap_proxy_prefetch_input(request_rec *r, proxy_conn_rec *backend, apr_bucket_brigade *input_brigade, apr_read_type_e block, apr_off_t *bytes_read, apr_off_t max_read)
int ap_proxy_pass_brigade(apr_bucket_alloc_t *bucket_alloc, request_rec *r, proxy_conn_rec *p_conn, conn_rec *origin, apr_bucket_brigade *bb, int flush)
const char * ap_proxy_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var)
Definition mod_proxy.c:3080
char * ap_proxy_update_balancer(apr_pool_t *p, proxy_balancer *balancer, const char *url)
int ap_proxy_is_socket_connected(apr_socket_t *socket)
@ enc_user
Definition mod_proxy.h:76
@ enc_path
Definition mod_proxy.h:76
@ enc_fpath
Definition mod_proxy.h:76
@ enc_parm
Definition mod_proxy.h:76
@ enc_search
Definition mod_proxy.h:76
@ HEAD
Definition mod_proxy.h:84
@ HEAD11
Definition mod_proxy.h:84
@ GET
Definition mod_proxy.h:84
@ OPTIONS
Definition mod_proxy.h:84
@ PROVIDER
Definition mod_proxy.h:84
@ EOT
Definition mod_proxy.h:84
@ GET11
Definition mod_proxy.h:84
@ OPTIONS11
Definition mod_proxy.h:84
@ TCP
Definition mod_proxy.h:84
@ CPING
Definition mod_proxy.h:84
@ NONE
Definition mod_proxy.h:84
@ PROXY_HASHFUNC_DEFAULT
Definition mod_proxy.h:1234
@ PROXY_HASHFUNC_FNV
Definition mod_proxy.h:1234
@ PROXY_HASHFUNC_APR
Definition mod_proxy.h:1234
apr_size_t size
int apr_status_t
Definition apr_errno.h:44
void apr_size_t apr_size_t * bytes_read
apr_vformatter_buff_t * c
Definition apr_lib.h:175
apr_sockaddr_t * addr
apr_socket_t * sock
apr_interval_time_t t
apr_uint16_t apr_port_t
apr_uint32_t apr_pool_t apr_uint32_t apr_pollset_method_e method
Definition apr_poll.h:195
apr_pool_t * b
Definition apr_pools.h:529
apr_shm_t * shm
int to
const char * s
Definition apr_strings.h:95
int int status
apr_int64_t apr_interval_time_t
Definition apr_time.h:55
apr_int64_t apr_time_t
Definition apr_time.h:45
Apache Configuration.
Apache connection library.
CORE HTTP Daemon.
Apache Logging library.
Command line options.
HTTP protocol handling.
Apache Request library.
SSL protocol handling.
Virtual Host package.
HTTP Daemon routines.
apr_pool_t * p
Definition md_event.c:32
static unsigned char * secret
static const ap_slotmem_provider_t * storage
static apr_status_t balancer_manage(request_rec *r, apr_table_t *params)
static void hc_show_exprs(request_rec *r)
static int hc_valid_expr(request_rec *r, const char *expr)
static apr_OFN_ajp_handle_cping_cpong_t * ajp_handle_cping_cpong
static const char * set_worker_hc_param(apr_pool_t *p, server_rec *s, proxy_worker *worker, const char *key, const char *val, void *v)
static void hc_select_exprs(request_rec *r, const char *expr)
int i
Definition mod_so.c:347
static int ap_proxy_retry_worker(const char *proxy_function, proxy_worker *worker, server_rec *s)
static proxy_worker * proxy_balancer_get_best_worker(proxy_balancer *balancer, request_rec *r, proxy_is_best_callback_fn_t *is_best, void *baton)
static int ap_proxy_clear_connection(request_rec *r, apr_table_t *headers)
char * name
Structure to store things which are per connection.
Definition httpd.h:1152
Definition mod_proxy.h:142
int(* matcher)(struct dirconn_entry *This, request_rec *r)
Definition mod_proxy.h:146
struct in_addr addr mask
Definition mod_proxy.h:144
char * name
Definition mod_proxy.h:143
struct apr_sockaddr_t * hostaddr
Definition mod_proxy.h:145
Definition mod_proxy.h:149
const char * name
Definition mod_proxy.h:150
struct apr_sockaddr_t * addr
Definition mod_proxy.h:151
proxy_balancer * balancer
Definition mod_proxy.h:139
const char * real
Definition mod_proxy.h:135
unsigned int flags
Definition mod_proxy.h:138
const char * fake
Definition mod_proxy.h:136
ap_regex_t * regex
Definition mod_proxy.h:137
apr_status_t(* reset)(proxy_balancer *balancer, server_rec *s)
Definition mod_proxy.h:587
apr_status_t(* age)(proxy_balancer *balancer, server_rec *s)
Definition mod_proxy.h:588
apr_status_t(* updatelbstatus)(proxy_balancer *balancer, proxy_worker *elected, server_rec *s)
Definition mod_proxy.h:589
const char * name
Definition mod_proxy.h:583
unsigned int forcerecovery
Definition mod_proxy.h:547
unsigned int max_attempts_set
Definition mod_proxy.h:542
proxy_hashes hash
Definition mod_proxy.h:539
unsigned int sticky_separator_set
Definition mod_proxy.h:553
unsigned int scolonsep
Definition mod_proxy.h:541
unsigned int need_reset
Definition mod_proxy.h:544
unsigned int vhosted
Definition mod_proxy.h:545
unsigned int forcerecovery_set
Definition mod_proxy.h:549
unsigned int nonce_set
Definition mod_proxy.h:552
unsigned int inactive
Definition mod_proxy.h:546
unsigned int sticky_force
Definition mod_proxy.h:540
unsigned int was_malloced
Definition mod_proxy.h:543
apr_interval_time_t timeout
Definition mod_proxy.h:535
unsigned int sticky_force_set
Definition mod_proxy.h:551
unsigned int scolonsep_set
Definition mod_proxy.h:550
unsigned int failontimeout_set
Definition mod_proxy.h:576
ap_slotmem_instance_t * wslot
Definition mod_proxy.h:561
ap_conf_vector_t * section_config
Definition mod_proxy.h:579
proxy_balancer_shared * s
Definition mod_proxy.h:574
apr_time_t wupdated
Definition mod_proxy.h:566
ap_slotmem_provider_t * storage
Definition mod_proxy.h:562
unsigned int lbmethod_set
Definition mod_proxy.h:578
unsigned int growth_set
Definition mod_proxy.h:577
apr_array_header_t * errstatuses
Definition mod_proxy.h:560
proxy_server_conf * sconf
Definition mod_proxy.h:572
apr_global_mutex_t * gmutex
Definition mod_proxy.h:568
proxy_balancer_method * lbmethod
Definition mod_proxy.h:567
apr_array_header_t * workers
Definition mod_proxy.h:559
proxy_hashes hash
Definition mod_proxy.h:565
float cache_completion
Definition mod_proxy.h:300
apr_pool_t * dns_pool
Definition mod_proxy.h:310
proxy_conn_rec * conn
Definition mod_proxy.h:309
apr_pool_t * pool
Definition mod_proxy.h:306
apr_sockaddr_t * addr
Definition mod_proxy.h:307
apr_reslist_t * res
Definition mod_proxy.h:308
const char * uds_path
Definition mod_proxy.h:288
const char * hostname
Definition mod_proxy.h:275
apr_pool_t * pool
Definition mod_proxy.h:274
unsigned int inreslist
Definition mod_proxy.h:287
apr_bucket_brigade * tmp_bb
Definition mod_proxy.h:290
struct proxy_address * address
Definition mod_proxy.h:296
apr_pool_t * uds_pool
Definition mod_proxy.h:294
apr_pool_t * scpool
Definition mod_proxy.h:277
request_rec * r
Definition mod_proxy.h:271
apr_sockaddr_t * addr
Definition mod_proxy.h:276
apr_socket_t * sock
Definition mod_proxy.h:278
apr_uint32_t flags
Definition mod_proxy.h:281
unsigned int need_flush
Definition mod_proxy.h:285
apr_pool_t * fwd_pool
Definition mod_proxy.h:295
proxy_worker * worker
Definition mod_proxy.h:273
apr_port_t port
Definition mod_proxy.h:282
unsigned int is_ssl
Definition mod_proxy.h:283
const char * ssl_hostname
Definition mod_proxy.h:289
unsigned int close
Definition mod_proxy.h:284
conn_rec * connection
Definition mod_proxy.h:270
apr_array_header_t * cookie_domains
Definition mod_proxy.h:228
signed char interpolate_env
Definition mod_proxy.h:230
unsigned int add_forwarded_headers_set
Definition mod_proxy.h:247
apr_array_header_t * raliases
Definition mod_proxy.h:226
unsigned int error_override_set
Definition mod_proxy.h:244
unsigned int error_override
Definition mod_proxy.h:241
unsigned int alias_set
Definition mod_proxy.h:245
apr_array_header_t * refs
Definition mod_proxy.h:250
ap_regex_t * r
Definition mod_proxy.h:216
struct proxy_alias * alias
Definition mod_proxy.h:231
unsigned int forward_100_continue
Definition mod_proxy.h:252
unsigned int preserve_host_set
Definition mod_proxy.h:243
signed char p_is_fnmatch
Definition mod_proxy.h:229
unsigned int preserve_host
Definition mod_proxy.h:242
const char * p
Definition mod_proxy.h:215
apr_array_header_t * cookie_paths
Definition mod_proxy.h:227
unsigned int forward_100_continue_set
Definition mod_proxy.h:253
unsigned int add_forwarded_headers
Definition mod_proxy.h:246
apr_array_header_t * error_override_codes
Definition mod_proxy.h:255
unsigned int fnv
Definition mod_proxy.h:419
unsigned int def
Definition mod_proxy.h:418
hcmethod_t method
Definition mod_proxy.h:88
const char * hostname
Definition mod_proxy.h:122
const char * protocol
Definition mod_proxy.h:121
const char * creds
Definition mod_proxy.h:124
apr_port_t port
Definition mod_proxy.h:126
ap_regex_t * regexp
Definition mod_proxy.h:123
const char * scheme
Definition mod_proxy.h:120
apr_array_header_t * cookie_domains
Definition mod_proxy.h:264
apr_array_header_t * raliases
Definition mod_proxy.h:262
apr_array_header_t * cookie_paths
Definition mod_proxy.h:263
unsigned int req_set
Definition mod_proxy.h:195
unsigned int map_encoded_all
Definition mod_proxy.h:211
apr_size_t recv_buffer_size
Definition mod_proxy.h:176
unsigned int viaopt_set
Definition mod_proxy.h:196
unsigned int bgrowth_set
Definition mod_proxy.h:204
apr_array_header_t * workers
Definition mod_proxy.h:160
const char * id
Definition mod_proxy.h:165
apr_array_header_t * aliases
Definition mod_proxy.h:157
apr_array_header_t * proxies
Definition mod_proxy.h:155
unsigned int recv_buffer_size_set
Definition mod_proxy.h:197
proxy_worker * forward
Definition mod_proxy.h:162
apr_array_header_t * sec_proxy
Definition mod_proxy.h:156
unsigned int source_address_set
Definition mod_proxy.h:203
const char * domain
Definition mod_proxy.h:164
unsigned int timeout_set
Definition mod_proxy.h:200
apr_sockaddr_t * source_address
Definition mod_proxy.h:190
ap_slotmem_provider_t * storage
Definition mod_proxy.h:193
unsigned int maxfwd_set
Definition mod_proxy.h:199
unsigned int inherit
Definition mod_proxy.h:206
unsigned int proxy_status_set
Definition mod_proxy.h:202
unsigned int io_buffer_size_set
Definition mod_proxy.h:198
apr_pool_t * pool
Definition mod_proxy.h:166
apr_interval_time_t timeout
Definition mod_proxy.h:179
unsigned int badopt_set
Definition mod_proxy.h:201
apr_array_header_t * dirconn
Definition mod_proxy.h:159
apr_global_mutex_t * mutex
Definition mod_proxy.h:191
unsigned int map_encoded_one
Definition mod_proxy.h:210
unsigned int bal_persist
Definition mod_proxy.h:205
apr_size_t io_buffer_size
Definition mod_proxy.h:177
unsigned int inherit_set
Definition mod_proxy.h:207
unsigned int ppinherit
Definition mod_proxy.h:208
apr_array_header_t * balancers
Definition mod_proxy.h:161
ap_slotmem_instance_t * bslot
Definition mod_proxy.h:192
proxy_worker * reverse
Definition mod_proxy.h:163
apr_array_header_t * noproxies
Definition mod_proxy.h:158
unsigned int ppinherit_set
Definition mod_proxy.h:209
apr_interval_time_t timeout
Definition mod_proxy.h:1390
struct proxy_tunnel_conn * origin
Definition mod_proxy.h:1392
apr_size_t read_buf_size
Definition mod_proxy.h:1393
struct proxy_tunnel_conn * client
Definition mod_proxy.h:1391
request_rec * r
Definition mod_proxy.h:1386
apr_array_header_t * pfds
Definition mod_proxy.h:1389
unsigned int nohalfclose
Definition mod_proxy.h:1395
apr_pollset_t * pollset
Definition mod_proxy.h:1388
const char * scheme
Definition mod_proxy.h:1387
apr_interval_time_t ttl
Definition mod_proxy.h:450
unsigned int conn_timeout_set
Definition mod_proxy.h:472
unsigned int keepalive
Definition mod_proxy.h:465
unsigned int timeout_set
Definition mod_proxy.h:469
apr_size_t recv_buffer_size
Definition mod_proxy.h:457
apr_interval_time_t timeout
Definition mod_proxy.h:453
apr_time_t updated
Definition mod_proxy.h:448
hcmethod_t method
Definition mod_proxy.h:485
apr_off_t transferred
Definition mod_proxy.h:462
unsigned int is_name_matchable
Definition mod_proxy.h:478
apr_uint32_t address_expiry
Definition mod_proxy.h:495
apr_time_t error_time
Definition mod_proxy.h:449
apr_interval_time_t retry
Definition mod_proxy.h:452
unsigned int was_malloced
Definition mod_proxy.h:477
unsigned int ping_timeout_set
Definition mod_proxy.h:471
unsigned int disablereuse_set
Definition mod_proxy.h:476
apr_size_t response_field_size
Definition mod_proxy.h:489
unsigned int status
Definition mod_proxy.h:442
apr_size_t elected
Definition mod_proxy.h:459
unsigned int io_buffer_size_set
Definition mod_proxy.h:474
unsigned int keepalive_set
Definition mod_proxy.h:475
apr_size_t io_buffer_size
Definition mod_proxy.h:458
unsigned int address_ttl_set
Definition mod_proxy.h:493
apr_interval_time_t interval
Definition mod_proxy.h:486
apr_interval_time_t conn_timeout
Definition mod_proxy.h:456
proxy_hashes hash
Definition mod_proxy.h:441
unsigned int response_field_size_set
Definition mod_proxy.h:490
unsigned int retry_set
Definition mod_proxy.h:468
apr_int32_t address_ttl
Definition mod_proxy.h:494
apr_interval_time_t ping_timeout
Definition mod_proxy.h:455
unsigned int recv_buffer_size_set
Definition mod_proxy.h:473
unsigned int is_address_reusable
Definition mod_proxy.h:467
unsigned int disablereuse
Definition mod_proxy.h:466
apr_interval_time_t acquire
Definition mod_proxy.h:454
unsigned int acquire_set
Definition mod_proxy.h:470
unsigned int local_status
Definition mod_proxy.h:503
ap_conf_vector_t * section_config
Definition mod_proxy.h:511
proxy_balancer * balancer
Definition mod_proxy.h:506
struct proxy_address *volatile address
Definition mod_proxy.h:512
proxy_conn_pool * cp
Definition mod_proxy.h:504
proxy_worker_shared * s
Definition mod_proxy.h:505
void * context
Definition mod_proxy.h:510
proxy_hashes hash
Definition mod_proxy.h:502
unsigned int bit
Definition mod_proxy.h:94
const char * name
Definition mod_proxy.h:96
A structure that represents the current request.
Definition httpd.h:845
A structure to store information for each virtual server.
Definition httpd.h:1322
Utilities for EBCDIC conversion.
#define var
#define str
Apache filter library.
Apache Mutex support library.
IN ULONG IN INT timeout
typedef int(WSAAPI *apr_winapi_fpt_WSAPoll)(IN OUT LPWSAPOLLFD fdArray