Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 "util_filter.h"
62 #include "util_ebcdic.h"
63 #include "ap_provider.h"
64 #include "ap_slotmem.h"
65 
66 #if APR_HAVE_NETINET_IN_H
67 #include <netinet/in.h>
68 #endif
69 #if APR_HAVE_ARPA_INET_H
70 #include <arpa/inet.h>
71 #endif
72 
73 /* for proxy_canonenc() */
74 enum enctype {
76 };
77 
78 typedef enum {
80 } hcmethod_t;
81 
82 typedef struct {
84  char *name;
87 
88 typedef struct {
89  unsigned int bit;
90  char flag;
91  const char *name;
93 
94 #define BALANCER_PREFIX "balancer://"
95 
96 #if APR_CHARSET_EBCDIC
97 #define CRLF "\r\n"
98 #else /*APR_CHARSET_EBCDIC*/
99 #define CRLF "\015\012"
100 #endif /*APR_CHARSET_EBCDIC*/
101 
102 /* default Max-Forwards header setting */
103 /* Set this to -1, which complies with RFC2616 by not setting
104  * max-forwards if the client didn't send it to us.
105  */
106 #define DEFAULT_MAX_FORWARDS -1
107 
109 typedef struct proxy_worker proxy_worker;
112 
113 /* static information about a remote proxy */
114 struct proxy_remote {
115  const char *scheme; /* the schemes handled by this proxy, or '*' */
116  const char *protocol; /* the scheme used to talk to this proxy */
117  const char *hostname; /* the hostname of this proxy */
118  ap_regex_t *regexp; /* compiled regex (if any) for the remote */
119  int use_regex; /* simple boolean. True if we have a regex pattern */
120  apr_port_t port; /* the port for this proxy */
121 };
122 
123 #define PROXYPASS_NOCANON 0x01
124 #define PROXYPASS_INTERPOLATE 0x02
125 #define PROXYPASS_NOQUERY 0x04
126 struct proxy_alias {
127  const char *real;
128  const char *fake;
130  unsigned int flags;
131  proxy_balancer *balancer; /* only valid for reverse-proxys */
132 };
133 
135  char *name;
136  struct in_addr addr, mask;
138  int (*matcher) (struct dirconn_entry * This, request_rec *r);
139 };
140 
142  const char *name;
144 };
145 
146 typedef struct {
152  apr_array_header_t *workers; /* non-balancer workers, eg ProxyPass http://example.com */
153  apr_array_header_t *balancers; /* list of balancers @ config time */
154  proxy_worker *forward; /* forward proxy worker */
155  proxy_worker *reverse; /* reverse "module-driven" proxy worker */
156  const char *domain; /* domain name to use in absence of a domain name in the request */
157  const char *id;
158  apr_pool_t *pool; /* Pool used for allocating this struct's elements */
159  int req; /* true if proxy requests are enabled */
160  int max_balancers; /* maximum number of allowed balancers */
161  int bgrowth; /* number of post-config balancers can added */
162  enum {
166  via_full
167  } viaopt; /* how to deal with proxy Via: headers */
170  long maxfwd;
172  enum {
175  bad_body
176  } badopt; /* how to deal with bad headers */
177  enum {
180  status_full
181  } proxy_status; /* Status display options */
183  apr_global_mutex_t *mutex; /* global lock - not used */
184  ap_slotmem_instance_t *bslot; /* balancers shm data - runtime */
186 
187  unsigned int req_set:1;
188  unsigned int viaopt_set:1;
189  unsigned int recv_buffer_size_set:1;
190  unsigned int io_buffer_size_set:1;
191  unsigned int maxfwd_set:1;
192  unsigned int timeout_set:1;
193  unsigned int badopt_set:1;
194  unsigned int proxy_status_set:1;
195  unsigned int source_address_set:1;
196  unsigned int bgrowth_set:1;
197  unsigned int bal_persist:1;
198  unsigned int inherit:1;
199  unsigned int inherit_set:1;
200  unsigned int ppinherit:1;
201  unsigned int ppinherit_set:1;
203 
204 
205 typedef struct {
206  const char *p; /* The path */
207  ap_regex_t *r; /* Is this a regex? */
208 
209 /* FIXME
210  * ProxyPassReverse and friends are documented as working inside
211  * <Location>. But in fact they never have done in the case of
212  * more than one <Location>, because the server_conf can't see it.
213  * We need to move them to the per-dir config.
214  * Discussed in February 2005:
215  * http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=110726027118798&w=2
216  */
220  signed char p_is_fnmatch; /* Is the path an fnmatch candidate? */
221  signed char interpolate_env;
223 
232  unsigned int error_override:1;
233  unsigned int preserve_host:1;
234  unsigned int preserve_host_set:1;
235  unsigned int error_override_set:1;
236  unsigned int alias_set:1;
237  unsigned int add_forwarded_headers:1;
238 
241 
243 
244 /* if we interpolate env vars per-request, we'll need a per-request
245  * copy of the reverse proxy config
246  */
247 typedef struct {
252 
253 typedef struct {
255  request_rec *r; /* Request record of the backend request
256  * that is used over the backend connection. */
257  proxy_worker *worker; /* Connection pool this connection belongs to */
258  apr_pool_t *pool; /* Subpool for hostname and addr data */
259  const char *hostname;
260  apr_sockaddr_t *addr; /* Preparsed remote address info */
261  apr_pool_t *scpool; /* Subpool used for socket and connection data */
262  apr_socket_t *sock; /* Connection socket */
263  void *data; /* per scheme connection data */
264  void *forward; /* opaque forward proxy data */
265  apr_uint32_t flags; /* Connection flags */
267  unsigned int is_ssl:1;
268  unsigned int close:1; /* Close 'this' connection */
269  unsigned int need_flush:1; /* Flag to decide whether we need to flush the
270  * filter chain or not */
271  unsigned int inreslist:1; /* connection in apr_reslist? */
272  const char *uds_path; /* Unix domain socket path */
273  const char *ssl_hostname;/* Hostname (SNI) in use by SSL connection */
274  apr_bucket_brigade *tmp_bb;/* Temporary brigade created with the connection
275  * and its scpool/bucket_alloc (NULL before),
276  * must be left cleaned when used (locally).
277  */
279 
280 typedef struct {
281  float cache_completion; /* completion percentage */
282  int content_length; /* length of the content */
284 
285 /* Connection pool */
287  apr_pool_t *pool; /* The pool used in constructor and destructor calls */
288  apr_sockaddr_t *addr; /* Preparsed remote address info */
289  apr_reslist_t *res; /* Connection resource list */
290  proxy_conn_rec *conn; /* Single connection for prefork mpm */
291 };
292 
293 /* worker status bits */
294 /*
295  * NOTE: Keep up-to-date w/ proxy_wstat_tbl[]
296  * in mod_proxy.c !
297  */
298 #define PROXY_WORKER_INITIALIZED 0x0001
299 #define PROXY_WORKER_IGNORE_ERRORS 0x0002
300 #define PROXY_WORKER_DRAIN 0x0004
301 #define PROXY_WORKER_GENERIC 0x0008
302 #define PROXY_WORKER_IN_SHUTDOWN 0x0010
303 #define PROXY_WORKER_DISABLED 0x0020
304 #define PROXY_WORKER_STOPPED 0x0040
305 #define PROXY_WORKER_IN_ERROR 0x0080
306 #define PROXY_WORKER_HOT_STANDBY 0x0100
307 #define PROXY_WORKER_FREE 0x0200
308 #define PROXY_WORKER_HC_FAIL 0x0400
309 
310 /* worker status flags */
311 #define PROXY_WORKER_INITIALIZED_FLAG 'O'
312 #define PROXY_WORKER_IGNORE_ERRORS_FLAG 'I'
313 #define PROXY_WORKER_DRAIN_FLAG 'N'
314 #define PROXY_WORKER_GENERIC_FLAG 'G'
315 #define PROXY_WORKER_IN_SHUTDOWN_FLAG 'U'
316 #define PROXY_WORKER_DISABLED_FLAG 'D'
317 #define PROXY_WORKER_STOPPED_FLAG 'S'
318 #define PROXY_WORKER_IN_ERROR_FLAG 'E'
319 #define PROXY_WORKER_HOT_STANDBY_FLAG 'H'
320 #define PROXY_WORKER_FREE_FLAG 'F'
321 #define PROXY_WORKER_HC_FAIL_FLAG 'C'
322 
323 #define PROXY_WORKER_NOT_USABLE_BITMAP ( PROXY_WORKER_IN_SHUTDOWN | \
324 PROXY_WORKER_DISABLED | PROXY_WORKER_STOPPED | PROXY_WORKER_IN_ERROR | \
325 PROXY_WORKER_HC_FAIL )
326 
327 /* NOTE: these check the shared status */
328 #define PROXY_WORKER_IS_INITIALIZED(f) ( (f)->s->status & PROXY_WORKER_INITIALIZED )
329 
330 #define PROXY_WORKER_IS_STANDBY(f) ( (f)->s->status & PROXY_WORKER_HOT_STANDBY )
331 
332 #define PROXY_WORKER_IS_USABLE(f) ( ( !( (f)->s->status & PROXY_WORKER_NOT_USABLE_BITMAP) ) && \
333  PROXY_WORKER_IS_INITIALIZED(f) )
334 
335 #define PROXY_WORKER_IS_DRAINING(f) ( (f)->s->status & PROXY_WORKER_DRAIN )
336 
337 #define PROXY_WORKER_IS_GENERIC(f) ( (f)->s->status & PROXY_WORKER_GENERIC )
338 
339 #define PROXY_WORKER_IS_HCFAILED(f) ( (f)->s->status & PROXY_WORKER_HC_FAIL )
340 
341 #define PROXY_WORKER_IS(f, b) ( (f)->s->status & (b) )
342 
343 /* default worker retry timeout in seconds */
344 #define PROXY_WORKER_DEFAULT_RETRY 60
345 
346 /* Some max char string sizes, for shm fields */
347 #define PROXY_WORKER_MAX_SCHEME_SIZE 16
348 #define PROXY_WORKER_MAX_ROUTE_SIZE 96
349 #define PROXY_BALANCER_MAX_ROUTE_SIZE 64
350 #define PROXY_WORKER_MAX_NAME_SIZE 256
351 #define PROXY_BALANCER_MAX_NAME_SIZE 64
352 #define PROXY_WORKER_MAX_HOSTNAME_SIZE 96
353 #define PROXY_BALANCER_MAX_HOSTNAME_SIZE 64
354 #define PROXY_BALANCER_MAX_STICKY_SIZE 64
355 #define PROXY_WORKER_MAX_SECRET_SIZE 64
356 
357 /* RFC-1035 mentions limits of 255 for host-names and 253 for domain-names,
358  * dotted together(?) this would fit the below size (+ trailing NUL).
359  */
360 #define PROXY_WORKER_RFC1035_NAME_SIZE 512
361 
362 #define PROXY_MAX_PROVIDER_NAME_SIZE 16
363 
364 #define PROXY_STRNCPY(dst, src) ap_proxy_strncpy((dst), (src), (sizeof(dst)))
365 
366 #define PROXY_COPY_CONF_PARAMS(w, c) \
367 do { \
368 (w)->s->timeout = (c)->timeout; \
369 (w)->s->timeout_set = (c)->timeout_set; \
370 (w)->s->recv_buffer_size = (c)->recv_buffer_size; \
371 (w)->s->recv_buffer_size_set = (c)->recv_buffer_size_set; \
372 (w)->s->io_buffer_size = (c)->io_buffer_size; \
373 (w)->s->io_buffer_size_set = (c)->io_buffer_size_set; \
374 } while (0)
375 
376 #define PROXY_DO_100_CONTINUE(w, r) \
377 ((w)->s->ping_timeout_set \
378  && (PROXYREQ_REVERSE == (r)->proxyreq) \
379  && !(apr_table_get((r)->subprocess_env, "force-proxy-request-1.0")) \
380  && ap_request_has_body((r)))
381 
382 /* use 2 hashes */
383 typedef struct {
384  unsigned int def;
385  unsigned int fnv;
386 } proxy_hashes ;
387 
388 /* Runtime worker status information. Shared in scoreboard */
389 typedef struct {
391  char scheme[PROXY_WORKER_MAX_SCHEME_SIZE]; /* scheme to use ajp|http|https */
392  char hostname[PROXY_WORKER_MAX_HOSTNAME_SIZE]; /* remote backend address */
393  char route[PROXY_WORKER_MAX_ROUTE_SIZE]; /* balancing route */
394  char redirect[PROXY_WORKER_MAX_ROUTE_SIZE]; /* temporary balancing redirection route */
395  char flusher[PROXY_WORKER_MAX_SCHEME_SIZE]; /* flush provider used by mod_proxy_fdpass */
396  char uds_path[PROXY_WORKER_MAX_NAME_SIZE]; /* path to worker's unix domain socket if applicable */
397  char hcuri[PROXY_WORKER_MAX_ROUTE_SIZE]; /* health check uri */
398  char hcexpr[PROXY_WORKER_MAX_SCHEME_SIZE]; /* name of condition expr for health check */
399  int lbset; /* load balancer cluster set */
400  int retries; /* number of retries on this worker */
401  int lbstatus; /* Current lbstatus */
402  int lbfactor; /* dynamic lbfactor */
403  int min; /* Desired minimum number of available connections */
404  int smax; /* Soft maximum on the total number of connections */
405  int hmax; /* Hard maximum on the total number of connections */
406  int flush_wait; /* poll wait time in microseconds if flush_auto */
407  int index; /* shm array index */
408  int passes; /* number of successes for check to pass */
409  int pcount; /* current count of passes */
410  int fails; /* number of failures for check to fail */
411  int fcount; /* current count of failures */
412  proxy_hashes hash; /* hash of worker name */
413  unsigned int status; /* worker status bitfield */
414  enum {
417  flush_auto
418  } flush_packets; /* control AJP flushing */
419  hcmethod_t method; /* method to use for health check */
420  apr_time_t updated; /* timestamp of last update */
421  apr_time_t error_time; /* time of the last error */
422  apr_interval_time_t ttl; /* maximum amount of time in seconds a connection
423  * may be available while exceeding the soft limit */
424  apr_interval_time_t retry; /* retry interval */
425  apr_interval_time_t timeout; /* connection timeout */
426  apr_interval_time_t acquire; /* acquire timeout when the maximum number of connections is exceeded */
432  apr_size_t elected; /* Number of times the worker was elected */
433  apr_size_t busy; /* busyness factor */
435  apr_off_t transferred;/* Number of bytes transferred to remote */
436  apr_off_t read; /* Number of bytes read from remote */
437  void *context; /* general purpose storage */
438  unsigned int keepalive:1;
439  unsigned int disablereuse:1;
440  unsigned int is_address_reusable:1;
441  unsigned int retry_set:1;
442  unsigned int timeout_set:1;
443  unsigned int acquire_set:1;
444  unsigned int ping_timeout_set:1;
445  unsigned int conn_timeout_set:1;
446  unsigned int recv_buffer_size_set:1;
447  unsigned int io_buffer_size_set:1;
448  unsigned int keepalive_set:1;
449  unsigned int disablereuse_set:1;
450  unsigned int was_malloced:1;
451  unsigned int is_name_matchable:1;
452  char secret[PROXY_WORKER_MAX_SECRET_SIZE]; /* authentication secret (e.g. AJP13) */
454 
455 #define ALIGNED_PROXY_WORKER_SHARED_SIZE (APR_ALIGN_DEFAULT(sizeof(proxy_worker_shared)))
456 
457 /* Worker configuration */
458 struct proxy_worker {
459  proxy_hashes hash; /* hash of worker name */
460  unsigned int local_status; /* status of per-process worker */
461  proxy_conn_pool *cp; /* Connection pool to use */
462  proxy_worker_shared *s; /* Shared data */
463  proxy_balancer *balancer; /* which balancer am I in? */
464  apr_thread_mutex_t *tmutex; /* Thread lock for updating address cache */
465  void *context; /* general purpose storage */
466  ap_conf_vector_t *section_config; /* <Proxy>-section wherein defined */
467 };
468 
469 /* default to health check every 30 seconds */
470 #define HCHECK_WATHCHDOG_DEFAULT_INTERVAL (30)
471 /* The watchdog runs every 2 seconds, which is also the minimal check */
472 #define HCHECK_WATHCHDOG_INTERVAL (2)
473 
474 /*
475  * Time to wait (in microseconds) to find out if more data is currently
476  * available at the backend.
477  */
478 #define PROXY_FLUSH_WAIT 10000
479 
480 typedef struct {
481  char sticky_path[PROXY_BALANCER_MAX_STICKY_SIZE]; /* URL sticky session identifier */
482  char sticky[PROXY_BALANCER_MAX_STICKY_SIZE]; /* sticky session identifier */
483  char lbpname[PROXY_MAX_PROVIDER_NAME_SIZE]; /* lbmethod provider name */
484  char nonce[APR_UUID_FORMATTED_LENGTH + 1];
489  apr_interval_time_t timeout; /* Timeout for waiting on free connection */
490  apr_time_t wupdated; /* timestamp of last change to workers list */
491  int max_attempts; /* Number of attempts before failing */
492  int index; /* shm array index */
494  unsigned int sticky_force:1; /* Disable failover for sticky sessions */
495  unsigned int scolonsep:1; /* true if ';' seps sticky session paths */
496  unsigned int max_attempts_set:1;
497  unsigned int was_malloced:1;
498  unsigned int need_reset:1;
499  unsigned int vhosted:1;
500  unsigned int inactive:1;
501  unsigned int forcerecovery:1;
502  char sticky_separator; /* separator for sessionid/route */
503  unsigned int forcerecovery_set:1;
504  unsigned int scolonsep_set:1;
505  unsigned int sticky_force_set:1;
506  unsigned int nonce_set:1;
507  unsigned int sticky_separator_set:1;
509 
510 #define ALIGNED_PROXY_BALANCER_SHARED_SIZE (APR_ALIGN_DEFAULT(sizeof(proxy_balancer_shared)))
511 
513  apr_array_header_t *workers; /* initially configured workers */
514  apr_array_header_t *errstatuses; /* statuses to force members into error */
515  ap_slotmem_instance_t *wslot; /* worker shm data - runtime */
517  int growth; /* number of post-config workers can added */
518  int max_workers; /* maximum number of allowed workers */
520  apr_time_t wupdated; /* timestamp of last change to workers list */
522  apr_global_mutex_t *gmutex; /* global lock for updating list of workers */
523  apr_thread_mutex_t *tmutex; /* Thread lock for updating shm */
525  void *context; /* general purpose storage */
526  proxy_balancer_shared *s; /* Shared data */
527  int failontimeout; /* Whether to mark a member in Err if IO timeout occurs */
528  unsigned int failontimeout_set:1;
529  unsigned int growth_set:1;
530  unsigned int lbmethod_set:1;
531  ap_conf_vector_t *section_config; /* <Proxy>-section wherein defined */
532 };
533 
535  const char *name; /* name of the load balancer method*/
536  proxy_worker *(*finder)(proxy_balancer *balancer,
537  request_rec *r);
538  void *context; /* general purpose storage */
542 };
543 
544 #define PROXY_THREAD_LOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_lock((x)->tmutex) : APR_SUCCESS)
545 #define PROXY_THREAD_UNLOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_unlock((x)->tmutex) : APR_SUCCESS)
546 
547 #define PROXY_GLOBAL_LOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_lock((x)->gmutex) : APR_SUCCESS)
548 #define PROXY_GLOBAL_UNLOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_unlock((x)->gmutex) : APR_SUCCESS)
549 
550 /* hooks */
551 
552 /* Create a set of PROXY_DECLARE(type), PROXY_DECLARE_NONSTD(type) and
553  * PROXY_DECLARE_DATA with appropriate export and import tags for the platform
554  */
555 #if !defined(WIN32)
556 #define PROXY_DECLARE(type) type
557 #define PROXY_DECLARE_NONSTD(type) type
558 #define PROXY_DECLARE_DATA
559 #elif defined(PROXY_DECLARE_STATIC)
560 #define PROXY_DECLARE(type) type __stdcall
561 #define PROXY_DECLARE_NONSTD(type) type
562 #define PROXY_DECLARE_DATA
563 #elif defined(PROXY_DECLARE_EXPORT)
564 #define PROXY_DECLARE(type) __declspec(dllexport) type __stdcall
565 #define PROXY_DECLARE_NONSTD(type) __declspec(dllexport) type
566 #define PROXY_DECLARE_DATA __declspec(dllexport)
567 #else
568 #define PROXY_DECLARE(type) __declspec(dllimport) type __stdcall
569 #define PROXY_DECLARE_NONSTD(type) __declspec(dllimport) type
570 #define PROXY_DECLARE_DATA __declspec(dllimport)
571 #endif
572 
573 /* Using PROXY_DECLARE_OPTIONAL_HOOK instead of
574  * APR_DECLARE_EXTERNAL_HOOK allows build/make_nw_export.awk
575  * to distinguish between hooks that implement
576  * proxy_hook_xx and proxy_hook_get_xx in mod_proxy.c and
577  * those which don't.
578  */
579 #define PROXY_DECLARE_OPTIONAL_HOOK APR_DECLARE_EXTERNAL_HOOK
580 
581 
582 /* These 2 are in mod_proxy.c */
585 
586 /* Following 4 from health check */
588 APR_DECLARE_OPTIONAL_FN(void, hc_select_exprs, (request_rec *, const char *));
589 APR_DECLARE_OPTIONAL_FN(int, hc_valid_expr, (request_rec *, const char *));
592  const char *, const char *, void *));
593 
594 PROXY_DECLARE_OPTIONAL_HOOK(proxy, PROXY, int, section_post_config,
595  (apr_pool_t *p, apr_pool_t *plog,
596  apr_pool_t *ptemp, server_rec *s,
597  ap_conf_vector_t *section_config))
598 
599 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, scheme_handler,
601  proxy_server_conf *conf, char *url,
603 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, canon_handler,
604  (request_rec *r, char *url))
605 
606 PROXY_DECLARE_OPTIONAL_HOOK(proxy, PROXY, int, create_req,
607  (request_rec *r, request_rec *pr))
609 
610 
611 
618  (request_rec *r, proxy_conn_rec *backend))
619 
628 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, pre_request,
629  (proxy_worker **worker, proxy_balancer **balancer,
630  request_rec *r, proxy_server_conf *conf, char **url))
635 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, post_request,
636  (proxy_worker *worker, proxy_balancer *balancer,
637  request_rec *r, proxy_server_conf *conf))
638 
644 PROXY_DECLARE_OPTIONAL_HOOK(proxy, PROXY, int, request_status,
645  (int *status, request_rec *r))
646 
647 /* proxy_util.c */
648 
649 PROXY_DECLARE(apr_status_t) ap_proxy_strncpy(char *dst, const char *src,
650  apr_size_t dlen);
651 PROXY_DECLARE(int) ap_proxy_hex2c(const char *x);
652 PROXY_DECLARE(void) ap_proxy_c2hex(int ch, char *x);
653 PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t,
654  int forcedec, int proxyreq);
655 PROXY_DECLARE(char *)ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
656  char **passwordp, char **hostp, apr_port_t *port);
657 PROXY_DECLARE(int) ap_proxyerror(request_rec *r, int statuscode, const char *message);
658 
668  const char *hostname, apr_sockaddr_t *addr);
669 
670 
672 /* DEPRECATED (will be replaced with ap_proxy_connect_backend */
674 /* DEPRECATED (will be replaced with ap_proxy_check_connection */
676  request_rec *r);
680  ap_conf_vector_t *per_dir_config,
681  int enable);
683 PROXY_DECLARE(const char *) ap_proxy_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var);
684 
685 /* Header mapping functions, and a typedef of their signature */
686 PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *url);
687 PROXY_DECLARE(const char *) ap_proxy_cookie_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *str);
688 
689 #if !defined(WIN32)
690 typedef const char *(*ap_proxy_header_reverse_map_fn)(request_rec *,
691  proxy_dir_conf *, const char *);
692 #elif defined(PROXY_DECLARE_STATIC)
693 typedef const char *(__stdcall *ap_proxy_header_reverse_map_fn)(request_rec *,
694  proxy_dir_conf *, const char *);
695 #elif defined(PROXY_DECLARE_EXPORT)
696 typedef __declspec(dllexport) const char *
697  (__stdcall *ap_proxy_header_reverse_map_fn)(request_rec *,
698  proxy_dir_conf *, const char *);
699 #else
700 typedef __declspec(dllimport) const char *
701  (__stdcall *ap_proxy_header_reverse_map_fn)(request_rec *,
702  proxy_dir_conf *, const char *);
703 #endif
704 
705 
706 /* Connection pool API */
715  proxy_worker *worker);
716 
726  proxy_balancer *balancer,
727  proxy_server_conf *conf,
728  const char *url);
740  proxy_worker **worker,
741  proxy_balancer *balancer,
742  proxy_server_conf *conf,
743  const char *url,
744  int do_malloc);
745 
758  proxy_worker **worker,
759  proxy_balancer *balancer,
760  proxy_server_conf *conf,
761  const char *url,
762  int do_malloc);
763 
772  proxy_worker_shared *shm,
773  int i);
774 
783  server_rec *s,
784  apr_pool_t *p);
785 
793 
794 
804  proxy_server_conf *conf,
805  const char *url,
806  int careactive);
807 
816  proxy_balancer *balancer,
817  const char *url);
818 
830  proxy_balancer **balancer,
831  proxy_server_conf *conf,
832  const char *url,
833  const char *alias,
834  int do_malloc);
835 
845  int i);
846 
855  server_rec *s,
856  apr_pool_t *p);
857 
867  ap_slotmem_instance_t *slot,
868  proxy_worker *worker,
869  unsigned int *index);
870 
880  ap_slotmem_instance_t *slot,
881  proxy_balancer *balancer,
882  unsigned int *index);
883 
896  proxy_balancer **balancer,
897  request_rec *r,
898  proxy_server_conf *conf,
899  char **url);
911  proxy_balancer *balancer,
912  request_rec *r,
913  proxy_server_conf *conf);
914 
932  proxy_server_conf *conf,
933  proxy_worker *worker,
934  proxy_conn_rec *conn,
935  apr_uri_t *uri,
936  char **url,
937  const char *proxyname,
939  char *server_portstr,
940  int server_portstr_size);
941 
952  (const char *proxy_function, proxy_worker *worker, server_rec *s));
953 
965 PROXY_DECLARE(int) ap_proxy_acquire_connection(const char *proxy_function,
966  proxy_conn_rec **conn,
967  proxy_worker *worker,
968  server_rec *s);
977 PROXY_DECLARE(int) ap_proxy_release_connection(const char *proxy_function,
978  proxy_conn_rec *conn,
979  server_rec *s);
980 
981 #define PROXY_CHECK_CONN_EMPTY (1 << 0)
982 
997  proxy_conn_rec *conn,
998  server_rec *server,
999  unsigned max_blank_lines,
1000  int flags);
1001 
1012 PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
1013  proxy_conn_rec *conn,
1014  proxy_worker *worker,
1015  server_rec *s);
1016 
1024 PROXY_DECLARE(apr_status_t) ap_proxy_connect_uds(apr_socket_t *sock,
1025  const char *uds_path,
1026  apr_pool_t *p);
1037 PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function,
1038  proxy_conn_rec *conn,
1039  conn_rec *c, server_rec *s);
1040 
1050 PROXY_DECLARE(int) ap_proxy_connection_create_ex(const char *proxy_function,
1051  proxy_conn_rec *conn,
1052  request_rec *r);
1062 
1071 PROXY_DECLARE(void) ap_proxy_backend_broke(request_rec *r,
1072  apr_bucket_brigade *brigade);
1073 
1082 
1083 PROXY_DECLARE(unsigned int) ap_proxy_hashfunc(const char *str, proxy_hash_t method);
1084 
1085 
1094 
1095 
1103 
1104 
1113  server_rec *s,
1114  proxy_server_conf *conf);
1115 
1116 
1124 PROXY_DECLARE(int) ap_proxy_trans_match(request_rec *r,
1125  struct proxy_alias *ent,
1126  proxy_dir_conf *dconf);
1127 
1144  apr_bucket_brigade *header_brigade,
1145  request_rec *r,
1146  proxy_conn_rec *p_conn,
1147  proxy_worker *worker,
1148  proxy_server_conf *conf,
1149  apr_uri_t *uri,
1150  char *url, char *server_portstr,
1151  char **old_cl_val,
1152  char **old_te_val);
1153 
1164  request_rec *r, proxy_conn_rec *p_conn,
1165  conn_rec *origin, apr_bucket_brigade *bb,
1166  int flush);
1167 
1176  (request_rec *r, apr_table_t *headers));
1177 
1178 
1184 
1185 #define PROXY_LBMETHOD "proxylbmethod"
1186 
1187 /* The number of dynamic workers that can be added when reconfiguring.
1188  * If this limit is reached you must stop and restart the server.
1189  */
1190 #define PROXY_DYNAMIC_BALANCER_LIMIT 16
1191 
1196 int ap_proxy_lb_workers(void);
1197 
1203 PROXY_DECLARE(apr_port_t) ap_proxy_port_of_scheme(const char *scheme);
1204 
1210 PROXY_DECLARE (const char *) ap_proxy_show_hcmethod(hcmethod_t method);
1211 
1218 PROXY_DECLARE(const char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url);
1219 
1220 /*
1221  * Transform buckets from one bucket allocator to another one by creating a
1222  * transient bucket for each data bucket and let it use the data read from
1223  * the old bucket. Metabuckets are transformed by just recreating them.
1224  * Attention: Currently only the following bucket types are handled:
1225  *
1226  * All data buckets
1227  * FLUSH
1228  * EOS
1229  *
1230  * If an other bucket type is found its type is logged as a debug message
1231  * and APR_EGENERAL is returned.
1232  *
1233  * @param r request_rec of the actual request. Used for logging purposes
1234  * @param from the bucket brigade to take the buckets from
1235  * @param to the bucket brigade to store the transformed buckets
1236  * @return apr_status_t of the operation. Either APR_SUCCESS or
1237  * APR_EGENERAL
1238  */
1240  apr_bucket_brigade *from,
1241  apr_bucket_brigade *to);
1242 
1243 /*
1244  * Sends all data that can be read non blocking from the input filter chain of
1245  * c_i and send it down the output filter chain of c_o. For reading it uses
1246  * the bucket brigade bb_i which should be created from the bucket allocator
1247  * associated with c_i. For sending through the output filter chain it uses
1248  * the bucket brigade bb_o which should be created from the bucket allocator
1249  * associated with c_o. In order to get the buckets from bb_i to bb_o
1250  * ap_proxy_buckets_lifetime_transform is used.
1251  *
1252  * @param r request_rec of the actual request. Used for logging purposes
1253  * @param c_i inbound connection conn_rec
1254  * @param c_o outbound connection conn_rec
1255  * @param bb_i bucket brigade for pulling data from the inbound connection
1256  * @param bb_o bucket brigade for sending data through the outbound connection
1257  * @param name string for logging from where data was pulled
1258  * @param sent if not NULL will be set to 1 if data was sent through c_o
1259  * @param bsize maximum amount of data pulled in one iteration from c_i
1260  * @param after if set flush data on c_o only once after the loop
1261  * @return apr_status_t of the operation. Could be any error returned from
1262  * either the input filter chain of c_i or the output filter chain
1263  * of c_o. APR_EPIPE if the outgoing connection was aborted.
1264  */
1266  request_rec *r,
1267  conn_rec *c_i,
1268  conn_rec *c_o,
1269  apr_bucket_brigade *bb_i,
1270  apr_bucket_brigade *bb_o,
1271  const char *name,
1272  int *sent,
1273  apr_off_t bsize,
1274  int after);
1275 
1277 
1278 #endif /*MOD_PROXY_H*/
1279 
#define socket
Definition: apr_arch_os2calls.h:41
int ap_proxy_trans_match(request_rec *r, struct proxy_alias *ent, proxy_dir_conf *dconf)
int ap_proxy_connect_to_backend(apr_socket_t **, const char *, apr_sockaddr_t *, const char *, proxy_server_conf *, request_rec *)
proxy_worker_shared * s
Definition: mod_proxy.h:462
unsigned int fnv
Definition: mod_proxy.h:385
size_t apr_size_t
Definition: apr.h:375
int ap_proxy_retry_worker(const char *proxy_function, proxy_worker *worker, server_rec *s)
apr_pool_t * pool
Definition: mod_proxy.h:258
proxy_balancer * ap_proxy_get_balancer(apr_pool_t *p, proxy_server_conf *conf, const char *url, int careactive)
int min
Definition: mod_proxy.h:403
proxy_worker proxy_server_conf char const char apr_port_t proxyport
Definition: mod_proxy.h:602
unsigned int growth_set
Definition: mod_proxy.h:529
int hmax
Definition: mod_proxy.h:405
apr_sockaddr_t * addr
Definition: mod_proxy.h:260
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)
int ap_proxy_ssl_enable(conn_rec *c)
void hc_show_exprs(request_rec *)
APR Network library.
APR UUID library.
apr_size_t recv_buffer_size
Definition: mod_proxy.h:168
struct ap_slotmem_instance_t ap_slotmem_instance_t
Definition: ap_slotmem.h:75
void hc_select_exprs(request_rec *, const char *)
Apache Configuration.
ap_regex_t * regex
Definition: mod_proxy.h:129
int ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, const char *hostname, apr_sockaddr_t *addr)
ap_regex_t * regexp
Definition: mod_proxy.h:118
char * ap_proxy_worker_name(apr_pool_t *p, proxy_worker *worker)
Definition: apr_arch_thread_mutex.h:28
apr_port_t ap_proxy_port_of_scheme(const char *scheme)
const char * protocol
Definition: mod_proxy.h:116
Definition: apr_tables.h:62
const char * name
Definition: mod_proxy.h:142
Definition: mod_proxy.h:79
Definition: mod_proxy.h:178
proxy_worker * worker
Definition: mod_proxy.h:257
int lbfactor
Definition: mod_proxy.h:402
Definition: mod_proxy.h:82
char flag
Definition: mod_proxy.h:90
apr_port_t port
Definition: mod_proxy.h:266
struct apr_reslist_t apr_reslist_t
Definition: apr_reslist.h:42
ap_conf_vector_t * section_config
Definition: mod_proxy.h:531
int ap_proxy_connection_create(const char *proxy_function, proxy_conn_rec *conn, conn_rec *c, server_rec *s)
Definition: mod_proxy.h:280
Definition: mod_proxy.h:141
apr_time_t wupdated
Definition: mod_proxy.h:490
float cache_completion
Definition: mod_proxy.h:281
int bgrowth
Definition: mod_proxy.h:161
proxy_balancer_shared * ap_proxy_find_balancershm(ap_slotmem_provider_t *storage, ap_slotmem_instance_t *slot, proxy_balancer *balancer, unsigned int *index)
struct apr_bucket_alloc_t apr_bucket_alloc_t
Definition: apr_buckets.h:123
request_rec * r
Definition: mod_proxy.h:617
proxy_conn_pool * cp
Definition: mod_proxy.h:461
const char * ssl_hostname
Definition: mod_proxy.h:273
const char * name
Definition: mod_proxy.h:535
struct apr_sockaddr_t * hostaddr
Definition: mod_proxy.h:137
Apache Provider API.
apr_interval_time_t interval
Definition: mod_proxy.h:429
const char * uds_path
Definition: mod_proxy.h:272
proxy_hashes hash
Definition: mod_proxy.h:412
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 after)
Definition: mod_proxy.h:75
proxy_balancer * balancer
Definition: mod_proxy.h:131
ap_slotmem_provider_t * storage
Definition: mod_proxy.h:185
apr_array_header_t * cookie_domains
Definition: mod_proxy.h:250
proxy_server_conf * sconf
Definition: mod_proxy.h:524
int ap_proxy_post_request(proxy_worker *worker, proxy_balancer *balancer, request_rec *r, proxy_server_conf *conf)
apr_sockaddr_t * addr
Definition: mod_proxy.h:288
int index
Definition: mod_proxy.h:492
Definition: mod_proxy.h:480
unsigned int ap_proxy_hashfunc(const char *str, proxy_hash_t method)
proxy_worker * reverse
Definition: mod_proxy.h:155
apr_array_header_t * cookie_paths
Definition: mod_proxy.h:249
const char * domain
Definition: mod_proxy.h:156
apr_uint32_t flags
Definition: mod_proxy.h:265
Definition: mod_proxy.h:247
apr_status_t ap_proxy_initialize_worker(proxy_worker *worker, server_rec *s, apr_pool_t *p)
proxy_hash_t
Definition: mod_proxy.h:1081
int ap_proxy_connect_backend(const char *proxy_function, proxy_conn_rec *conn, proxy_worker *worker, server_rec *s)
Definition: mod_proxy.h:383
Definition: mod_proxy.h:164
const char * real
Definition: mod_proxy.h:127
APR Standard Headers Support.
apr_status_t ap_proxy_connect_uds(apr_socket_t *sock, const char *uds_path, apr_pool_t *p)
apr_size_t busy
Definition: mod_proxy.h:433
void * context
Definition: mod_proxy.h:437
apr_interval_time_t timeout
Definition: mod_proxy.h:489
apr_size_t io_buffer_size
Definition: mod_proxy.h:431
CORE HTTP Daemon.
int fails
Definition: mod_proxy.h:410
apr_array_header_t * errstatuses
Definition: mod_proxy.h:514
Definition: mod_proxy.h:179
char * name
Definition: mod_proxy.h:135
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_is_socket_connected(apr_socket_t *socket)
Apache connection library.
int ap_proxy_connection_create_ex(const char *proxy_function, proxy_conn_rec *conn, request_rec *r)
Utilities for EBCDIC conversion.
int ap_proxy_ssl_disable(conn_rec *c)
proxy_balancer_method * lbmethod
Definition: mod_proxy.h:521
PROXY_DECLARE_DATA proxy_hcmethods_t proxy_hcmethods[]
int use_regex
Definition: mod_proxy.h:119
char * ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t, int forcedec, int proxyreq)
const char const char * uri
Definition: mod_dav.h:618
detach_backend
Definition: mod_proxy.h:617
#define PROXY_WORKER_MAX_ROUTE_SIZE
Definition: mod_proxy.h:348
Definition: apr_buckets.h:258
const char apr_size_t dlen
Definition: mod_proxy.h:649
APR Thread Mutex Routines.
void * context
Definition: mod_proxy.h:538
Definition: mod_proxy.h:114
Definition: mod_proxy.h:79
module PROXY_DECLARE_DATA proxy_module
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
apr_time_t updated
Definition: mod_proxy.h:420
Definition: mod_proxy.h:75
Structure to store things which are per connection.
Definition: httpd.h:1110
int flush_wait
Definition: mod_proxy.h:406
APR-UTIL Resource List Routines.
#define APR_UUID_FORMATTED_LENGTH
Definition: apr_uuid.h:46
apr_status_t(* updatelbstatus)(proxy_balancer *balancer, proxy_worker *elected, server_rec *s)
Definition: mod_proxy.h:541
Virtual Host package.
APR-UTIL registration of functions exported by modules.
int fixups(request_rec *r)
Symbol export macros and hook functions.
#define PROXY_MAX_PROVIDER_NAME_SIZE
Definition: mod_proxy.h:362
apr_status_t(* reset)(proxy_balancer *balancer, server_rec *s)
Definition: mod_proxy.h:539
#define PROXY_DECLARE_OPTIONAL_HOOK
Definition: mod_proxy.h:579
char * ap_proxy_parse_wstatus(apr_pool_t *p, proxy_worker *w)
apr_array_header_t * cookie_domains
Definition: mod_proxy.h:219
apr_interval_time_t timeout
Definition: mod_proxy.h:171
const char * set_worker_hc_param(apr_pool_t *, server_rec *, proxy_worker *, const char *, const char *, void *)
Definition: mod_proxy.h:146
apr_array_header_t * aliases
Definition: mod_proxy.h:149
#define PROXY_DECLARE_DATA
Definition: mod_proxy.h:558
apr_pool_t * pool
Definition: mod_proxy.h:158
Definition: mod_proxy.h:75
Definition: apr_arch_global_mutex.h:23
signed char interpolate_env
Definition: mod_proxy.h:221
int ap_proxy_conn_is_https(conn_rec *c)
apr_time_t wupdated
Definition: mod_proxy.h:520
const char *(* ap_proxy_header_reverse_map_fn)(request_rec *, proxy_dir_conf *, const char *)
Definition: mod_proxy.h:690
int req
Definition: mod_proxy.h:159
Apache Logging library.
apr_array_header_t * sec_proxy
Definition: mod_proxy.h:148
unsigned int local_status
Definition: mod_proxy.h:460
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)
const char * hostname
Definition: mod_proxy.h:117
unsigned int status
Definition: mod_proxy.h:413
apr_int64_t apr_time_t
Definition: apr_time.h:45
void * forward
Definition: mod_proxy.h:264
Command line options.
APR-UTIL date routines.
int ap_proxy_lb_workers(void)
Definition: ap_slotmem.h:86
APR memory allocation.
APR Global Locking Routines.
int ap_proxy_pre_http_request(conn_rec *c, request_rec *r)
apr_bucket_brigade * bb
Definition: mod_dav.h:556
apr_size_t io_buffer_size
Definition: mod_proxy.h:169
const char * ap_proxy_show_hcmethod(hcmethod_t method)
Definition: mod_proxy.h:134
HTTP Daemon routines.
int ap_proxy_acquire_connection(const char *proxy_function, proxy_conn_rec **conn, proxy_worker *worker, server_rec *s)
proxy_hashes hash
Definition: mod_proxy.h:459
Apache hook functions.
Definition: mod_proxy.h:1081
#define PROXY_BALANCER_MAX_ROUTE_SIZE
Definition: mod_proxy.h:349
unsigned int flags
Definition: mod_proxy.h:130
A structure to store information for each virtual server.
Definition: httpd.h:1302
void * context
Definition: mod_proxy.h:465
apr_global_mutex_t * mutex
Definition: mod_proxy.h:183
apr_time_t error_time
Definition: mod_proxy.h:421
Definition: mod_proxy.h:75
const char * p
Definition: mod_proxy.h:206
int growth
Definition: mod_proxy.h:517
int
Definition: mod_proxy.h:617
int smax
Definition: mod_proxy.h:404
apr_array_header_t * raliases
Definition: mod_proxy.h:248
Definition: mod_proxy.h:253
Definition: mod_proxy.h:389
int max_attempts
Definition: mod_proxy.h:491
apr_off_t read
Definition: mod_proxy.h:436
#define APR_DECLARE_EXTERNAL_HOOK(ns, link, ret, name, args)
Definition: apr_hooks.h:118
Definition: apr_arch_networkio.h:37
int ap_proxy_clear_connection(request_rec *r, apr_table_t *headers)
int hc_valid_expr(request_rec *, const char *)
int max_balancers
Definition: mod_proxy.h:160
const char * ap_proxy_de_socketfy(apr_pool_t *p, const char *url)
struct in_addr addr mask
Definition: mod_proxy.h:136
Definition: mod_proxy.h:416
apr_interval_time_t ttl
Definition: mod_proxy.h:422
proxy_balancer_shared * s
Definition: mod_proxy.h:526
#define PROXY_WORKER_MAX_NAME_SIZE
Definition: mod_proxy.h:350
Definition: mod_proxy.h:512
Definition: mod_proxy.h:173
const char * ap_proxy_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var)
Definition: ap_regex.h:97
apr_socket_t * sock
Definition: mod_proxy.h:262
apr_reslist_t * res
Definition: mod_proxy.h:289
request_rec * r
Definition: mod_proxy.h:255
const char * name
Definition: mod_proxy.h:91
APR-UTIL Buckets/Bucket Brigades.
long maxfwd
Definition: mod_proxy.h:170
Definition: mod_proxy.h:174
Definition: mod_proxy.h:126
proxy_worker proxy_server_conf char * url
Definition: mod_proxy.h:602
APR FNMatch Functions.
proxy_worker_shared * ap_proxy_find_workershm(ap_slotmem_provider_t *storage, ap_slotmem_instance_t *slot, proxy_worker *worker, unsigned int *index)
#define PROXY_WORKER_MAX_SECRET_SIZE
Definition: mod_proxy.h:355
unsigned int apr_uint32_t
Definition: apr.h:334
hcmethod_t
Definition: mod_proxy.h:78
APR Platform Definitions.
apr_array_header_t * cookie_paths
Definition: mod_proxy.h:218
apr_port_t port
Definition: mod_proxy.h:434
APR MD5 Routines.
APR general purpose library routines.
#define PROXY_WORKER_MAX_HOSTNAME_SIZE
Definition: mod_proxy.h:352
APR-UTIL string matching routines.
#define PROXY_BALANCER_MAX_STICKY_SIZE
Definition: mod_proxy.h:354
int ap_proxyerror(request_rec *r, int statuscode, const char *message)
void * context
Definition: mod_proxy.h:525
const char * ap_proxy_location_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *url)
apr_status_t ap_proxy_buckets_lifetime_transform(request_rec *r, apr_bucket_brigade *from, apr_bucket_brigade *to)
struct apr_sockaddr_t * addr
Definition: mod_proxy.h:143
int ap_proxy_release_connection(const char *proxy_function, proxy_conn_rec *conn, server_rec *s)
void ap_proxy_backend_broke(request_rec *r, apr_bucket_brigade *brigade)
apr_interval_time_t timeout
Definition: mod_proxy.h:425
Definition: mod_proxy.h:75
void ap_proxy_c2hex(int ch, char *x)
HTTP protocol handling.
int pcount
Definition: mod_proxy.h:409
Definition: apr_uri.h:85
apr_array_header_t * workers
Definition: mod_proxy.h:152
apr_pool_t * p
#define PROXY_BALANCER_MAX_NAME_SIZE
Definition: mod_proxy.h:351
ap_slotmem_provider_t * storage
Definition: mod_proxy.h:516
proxy_conn_rec * conn
Definition: mod_proxy.h:290
int ap_proxy_ssl_engine(conn_rec *c, ap_conf_vector_t *per_dir_config, int enable)
Apache Mutex support library.
char * ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp, char **passwordp, char **hostp, apr_port_t *port)
int content_length
Definition: mod_proxy.h:282
apr_array_header_t * workers
Definition: mod_proxy.h:513
int implemented
Definition: mod_proxy.h:85
apr_interval_time_t acquire
Definition: mod_proxy.h:426
apr_global_mutex_t * gmutex
Definition: mod_proxy.h:522
apr_off_t transferred
Definition: mod_proxy.h:435
Definition: mod_proxy.h:1081
apr_sockaddr_t * source_address
Definition: mod_proxy.h:182
apr_pool_t * scpool
Definition: mod_proxy.h:261
struct proxy_alias * alias
Definition: mod_proxy.h:222
Apache Request library.
apr_status_t ap_proxy_sync_balancer(proxy_balancer *b, server_rec *s, proxy_server_conf *conf)
A structure that represents the current request.
Definition: httpd.h:805
int retries
Definition: mod_proxy.h:400
int fcount
Definition: mod_proxy.h:411
Apache filter library.
const char * hostname
Definition: mod_proxy.h:259
APR Strings library.
proxy_worker * forward
Definition: mod_proxy.h:154
enctype
Definition: mod_proxy.h:74
apr_port_t port
Definition: mod_proxy.h:120
int passes
Definition: mod_proxy.h:408
int lbset
Definition: mod_proxy.h:399
dav_buffer const char * str
Definition: mod_dav.h:465
Definition: mod_proxy.h:165
apr_interval_time_t retry
Definition: mod_proxy.h:424
const char * id
Definition: mod_proxy.h:157
int status
Definition: mod_dav.h:141
#define PROXY_DECLARE(type)
Definition: mod_proxy.h:556
int ap_proxy_connection_reusable(proxy_conn_rec *conn)
char * name
Definition: mod_proxy.h:84
apr_interval_time_t ping_timeout
Definition: mod_proxy.h:427
struct apr_table_t apr_table_t
Definition: apr_tables.h:56
unsigned int bit
Definition: mod_proxy.h:89
#define PROXY_BALANCER_MAX_HOSTNAME_SIZE
Definition: mod_proxy.h:353
int(* matcher)(struct dirconn_entry *This, request_rec *r)
Definition: mod_proxy.h:138
const char * name
Definition: mod_dav.h:730
int ap_proxy_hex2c(const char *x)
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)
const char * scheme
Definition: mod_proxy.h:115
apr_thread_mutex_t * tmutex
Definition: mod_proxy.h:523
Definition: mod_proxy.h:286
apr_status_t(* age)(proxy_balancer *balancer, server_rec *s)
Definition: mod_proxy.h:540
ap_slotmem_instance_t * bslot
Definition: mod_proxy.h:184
int index
Definition: mod_proxy.h:407
apr_bucket_brigade * tmp_bb
Definition: mod_proxy.h:274
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
Definition: mod_proxy.h:79
conn_rec * connection
Definition: mod_proxy.h:254
int ap_proxy_pre_request(proxy_worker **worker, proxy_balancer **balancer, request_rec *r, proxy_server_conf *conf, char **url)
unsigned int lbmethod_set
Definition: mod_proxy.h:530
Definition: http_config.h:349
const char * ap_proxy_cookie_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *str)
hcmethod_t method
Definition: mod_proxy.h:83
int apr_status_t
Definition: apr_errno.h:44
Definition: mod_proxy.h:79
#define APR_DECLARE_OPTIONAL_FN(ret, name, args)
Definition: apr_optional.h:50
proxy_hashes hash
Definition: mod_proxy.h:493
Definition: mod_proxy.h:79
Definition: mod_proxy.h:458
apr_status_t ap_proxy_initialize_balancer(proxy_balancer *balancer, server_rec *s, apr_pool_t *p)
int failontimeout
Definition: mod_proxy.h:527
apr_pool_t * pool
Definition: mod_proxy.h:287
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)
#define PROXY_WORKER_MAX_SCHEME_SIZE
Definition: mod_proxy.h:347
const char * fake
Definition: mod_proxy.h:128
APR-UTIL URI Routines.
apr_uint16_t apr_port_t
Definition: apr_network_io.h:257
ap_conf_vector_t * section_config
Definition: mod_proxy.h:466
Definition: mod_proxy.h:88
void * data
Definition: mod_proxy.h:263
apr_thread_mutex_t * tmutex
Definition: mod_proxy.h:464
int lbstatus
Definition: mod_proxy.h:401
apr_array_header_t * balancers
Definition: mod_proxy.h:153
Definition: mod_proxy.h:163
Definition: mod_proxy.h:79
proxy_worker proxy_server_conf * conf
Definition: mod_proxy.h:602
apr_size_t recv_buffer_size
Definition: mod_proxy.h:430
Definition: mod_proxy.h:79
Definition: mod_proxy.h:205
unsigned int def
Definition: mod_proxy.h:384
struct ap_conf_vector_t ap_conf_vector_t
Definition: http_config.h:510
hcmethod_t method
Definition: mod_proxy.h:419
apr_interval_time_t conn_timeout
Definition: mod_proxy.h:428
proxy_worker * worker
Definition: mod_proxy.h:602
apr_status_t ap_proxy_ssl_connection_cleanup(proxy_conn_rec *conn, request_rec *r)
apr_array_header_t * raliases
Definition: mod_proxy.h:217
apr_array_header_t * proxies
Definition: mod_proxy.h:147
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1350
apr_array_header_t * refs
Definition: mod_proxy.h:240
proxy_balancer * balancer
Definition: mod_proxy.h:463
char * ap_proxy_update_balancer(apr_pool_t *p, proxy_balancer *balancer, const char *url)
ap_regex_t * r
Definition: mod_proxy.h:207
int max_workers
Definition: mod_proxy.h:518
Definition: mod_proxy.h:1081
apr_status_t ap_proxy_share_worker(proxy_worker *worker, proxy_worker_shared *shm, int i)
PROXY
Definition: mod_proxy.h:617
apr_status_t ap_proxy_set_wstatus(char c, int set, proxy_worker *w)
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)
apr_status_t ap_proxy_share_balancer(proxy_balancer *balancer, proxy_balancer_shared *shm, int i)
int ap_proxy_valid_balancer_name(char *name, int i)
Definition: mod_proxy.h:534
unsigned int failontimeout_set
Definition: mod_proxy.h:528
apr_array_header_t * noproxies
Definition: mod_proxy.h:150
off_t apr_off_t
Definition: apr.h:377
Memory Slot Extension Storage Module for Apache.
proxy_hashes hash
Definition: mod_proxy.h:519
proxy_worker * ap_proxy_get_worker(apr_pool_t *p, proxy_balancer *balancer, proxy_server_conf *conf, const char *url)
ap_slotmem_instance_t * wslot
Definition: mod_proxy.h:515
proxy_worker proxy_server_conf char const char * proxyhost
Definition: mod_proxy.h:602
Definition: apr_network_io.h:266
apr_array_header_t * dirconn
Definition: mod_proxy.h:151
signed char p_is_fnmatch
Definition: mod_proxy.h:220
Definition: mod_proxy.h:79
Definition: mod_proxy.h:415
char sticky_separator
Definition: mod_proxy.h:502
PROXY_DECLARE_DATA proxy_wstat_t proxy_wstat_tbl[]
apr_status_t ap_proxy_check_connection(const char *scheme, proxy_conn_rec *conn, server_rec *server, unsigned max_blank_lines, int flags)
const char * src
Definition: mod_proxy.h:649
apr_size_t elected
Definition: mod_proxy.h:432