Apache2
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() */
75 enum enctype {
77 };
78 
79 typedef enum {
81 } hcmethod_t;
82 
83 typedef struct {
85  char *name;
88 
89 typedef struct {
90  unsigned int bit;
91  char flag;
92  const char *name;
94 
95 #define BALANCER_PREFIX "balancer://"
96 
97 #if APR_CHARSET_EBCDIC
98 #define CRLF "\r\n"
99 #else /*APR_CHARSET_EBCDIC*/
100 #define CRLF "\015\012"
101 #endif /*APR_CHARSET_EBCDIC*/
102 
103 /* default Max-Forwards header setting */
104 /* Set this to -1, which complies with RFC2616 by not setting
105  * max-forwards if the client didn't send it to us.
106  */
107 #define DEFAULT_MAX_FORWARDS -1
108 
110 typedef struct proxy_worker proxy_worker;
113 
114 /* static information about a remote proxy */
115 struct proxy_remote {
116  const char *scheme; /* the schemes handled by this proxy, or '*' */
117  const char *protocol; /* the scheme used to talk to this proxy */
118  const char *hostname; /* the hostname of this proxy */
119  ap_regex_t *regexp; /* compiled regex (if any) for the remote */
120  const char *creds; /* auth credentials (if any) for the proxy */
121  int use_regex; /* simple boolean. True if we have a regex pattern */
122  apr_port_t port; /* the port for this proxy */
123 };
124 
125 #define PROXYPASS_NOCANON 0x01
126 #define PROXYPASS_INTERPOLATE 0x02
127 #define PROXYPASS_NOQUERY 0x04
128 #define PROXYPASS_MAP_ENCODED 0x08
129 #define PROXYPASS_MAP_SERVLET 0x18 /* + MAP_ENCODED */
130 struct proxy_alias {
131  const char *real;
132  const char *fake;
134  unsigned int flags;
135  proxy_balancer *balancer; /* only valid for reverse-proxys */
136 };
137 
139  char *name;
140  struct in_addr addr, mask;
142  int (*matcher) (struct dirconn_entry * This, request_rec *r);
143 };
144 
146  const char *name;
148 };
149 
150 typedef struct {
156  apr_array_header_t *workers; /* non-balancer workers, eg ProxyPass http://example.com */
157  apr_array_header_t *balancers; /* list of balancers @ config time */
158  proxy_worker *forward; /* forward proxy worker */
159  proxy_worker *reverse; /* reverse "module-driven" proxy worker */
160  const char *domain; /* domain name to use in absence of a domain name in the request */
161  const char *id;
162  apr_pool_t *pool; /* Pool used for allocating this struct's elements */
163  int req; /* true if proxy requests are enabled */
164  int max_balancers; /* maximum number of allowed balancers */
165  int bgrowth; /* number of post-config balancers can added */
166  enum {
170  via_full
171  } viaopt; /* how to deal with proxy Via: headers */
174  long maxfwd;
176  enum {
179  bad_body
180  } badopt; /* how to deal with bad headers */
181  enum {
184  status_full
185  } proxy_status; /* Status display options */
187  apr_global_mutex_t *mutex; /* global lock - not used */
188  ap_slotmem_instance_t *bslot; /* balancers shm data - runtime */
190 
191  unsigned int req_set:1;
192  unsigned int viaopt_set:1;
193  unsigned int recv_buffer_size_set:1;
194  unsigned int io_buffer_size_set:1;
195  unsigned int maxfwd_set:1;
196  unsigned int timeout_set:1;
197  unsigned int badopt_set:1;
198  unsigned int proxy_status_set:1;
199  unsigned int source_address_set:1;
200  unsigned int bgrowth_set:1;
201  unsigned int bal_persist:1;
202  unsigned int inherit:1;
203  unsigned int inherit_set:1;
204  unsigned int ppinherit:1;
205  unsigned int ppinherit_set:1;
206  unsigned int map_encoded_one:1;
207  unsigned int map_encoded_all:1;
209 
210 typedef struct {
211  const char *p; /* The path */
212  ap_regex_t *r; /* Is this a regex? */
213 
214 /* FIXME
215  * ProxyPassReverse and friends are documented as working inside
216  * <Location>. But in fact they never have done in the case of
217  * more than one <Location>, because the server_conf can't see it.
218  * We need to move them to the per-dir config.
219  * Discussed in February 2005:
220  * http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=110726027118798&w=2
221  */
225  signed char p_is_fnmatch; /* Is the path an fnmatch candidate? */
226  signed char interpolate_env;
228 
237  unsigned int error_override:1;
238  unsigned int preserve_host:1;
239  unsigned int preserve_host_set:1;
240  unsigned int error_override_set:1;
241  unsigned int alias_set:1;
242  unsigned int add_forwarded_headers:1;
243  unsigned int add_forwarded_headers_set:1;
244 
247 
248  unsigned int forward_100_continue:1;
249  unsigned int forward_100_continue_set:1;
250 
252 
255  unsigned int async_delay_set:1;
256  unsigned int async_idle_timeout_set:1;
258 
259 /* if we interpolate env vars per-request, we'll need a per-request
260  * copy of the reverse proxy config
261  */
262 typedef struct {
267 
268 typedef struct {
270  request_rec *r; /* Request record of the backend request
271  * that is used over the backend connection. */
272  proxy_worker *worker; /* Connection pool this connection belongs to */
273  apr_pool_t *pool; /* Subpool for hostname and addr data */
274  const char *hostname;
275  apr_sockaddr_t *addr; /* Preparsed remote address info */
276  apr_pool_t *scpool; /* Subpool used for socket and connection data */
277  apr_socket_t *sock; /* Connection socket */
278  void *data; /* per scheme connection data */
279  void *forward; /* opaque forward proxy data */
280  apr_uint32_t flags; /* Connection flags */
282  unsigned int is_ssl:1;
283  unsigned int close:1; /* Close 'this' connection */
284  unsigned int need_flush:1; /* Flag to decide whether we need to flush the
285  * filter chain or not */
286  unsigned int inreslist:1; /* connection in apr_reslist? */
287  const char *uds_path; /* Unix domain socket path */
288  const char *ssl_hostname;/* Hostname (SNI) in use by SSL connection */
289  apr_bucket_brigade *tmp_bb;/* Temporary brigade created with the connection
290  * and its scpool/bucket_alloc (NULL before),
291  * must be left cleaned when used (locally).
292  */
294 
295 typedef struct {
296  float cache_completion; /* completion percentage */
297  int content_length; /* length of the content */
299 
300 /* Connection pool */
302  apr_pool_t *pool; /* The pool used in constructor and destructor calls */
303  apr_sockaddr_t *addr; /* Preparsed remote address info */
304  apr_reslist_t *res; /* Connection resource list */
305  proxy_conn_rec *conn; /* Single connection for prefork mpm */
306  apr_pool_t *dns_pool; /* The pool used for worker scoped DNS resolutions */
307 };
308 
309 #define AP_VOLATILIZE_T(T, x) (*(T volatile *)&(x))
310 
311 /* worker status bits */
312 /*
313  * NOTE: Keep up-to-date w/ proxy_wstat_tbl[]
314  * in mod_proxy.c !
315  */
316 #define PROXY_WORKER_INITIALIZED 0x0001
317 #define PROXY_WORKER_IGNORE_ERRORS 0x0002
318 #define PROXY_WORKER_DRAIN 0x0004
319 #define PROXY_WORKER_GENERIC 0x0008
320 #define PROXY_WORKER_IN_SHUTDOWN 0x0010
321 #define PROXY_WORKER_DISABLED 0x0020
322 #define PROXY_WORKER_STOPPED 0x0040
323 #define PROXY_WORKER_IN_ERROR 0x0080
324 #define PROXY_WORKER_HOT_STANDBY 0x0100
325 #define PROXY_WORKER_FREE 0x0200
326 #define PROXY_WORKER_HC_FAIL 0x0400
327 #define PROXY_WORKER_HOT_SPARE 0x0800
328 
329 /* worker status flags */
330 #define PROXY_WORKER_INITIALIZED_FLAG 'O'
331 #define PROXY_WORKER_IGNORE_ERRORS_FLAG 'I'
332 #define PROXY_WORKER_DRAIN_FLAG 'N'
333 #define PROXY_WORKER_GENERIC_FLAG 'G'
334 #define PROXY_WORKER_IN_SHUTDOWN_FLAG 'U'
335 #define PROXY_WORKER_DISABLED_FLAG 'D'
336 #define PROXY_WORKER_STOPPED_FLAG 'S'
337 #define PROXY_WORKER_IN_ERROR_FLAG 'E'
338 #define PROXY_WORKER_HOT_STANDBY_FLAG 'H'
339 #define PROXY_WORKER_FREE_FLAG 'F'
340 #define PROXY_WORKER_HC_FAIL_FLAG 'C'
341 #define PROXY_WORKER_HOT_SPARE_FLAG 'R'
342 
343 #define PROXY_WORKER_NOT_USABLE_BITMAP ( PROXY_WORKER_IN_SHUTDOWN | \
344 PROXY_WORKER_DISABLED | PROXY_WORKER_STOPPED | PROXY_WORKER_IN_ERROR | \
345 PROXY_WORKER_HC_FAIL )
346 
347 /* NOTE: these check the shared status */
348 #define PROXY_WORKER_IS_INITIALIZED(f) ( (f)->s->status & PROXY_WORKER_INITIALIZED )
349 
350 #define PROXY_WORKER_IS_STANDBY(f) ( (f)->s->status & PROXY_WORKER_HOT_STANDBY )
351 
352 #define PROXY_WORKER_IS_SPARE(f) ( (f)->s->status & PROXY_WORKER_HOT_SPARE )
353 
354 #define PROXY_WORKER_IS_USABLE(f) ( ( !( (f)->s->status & PROXY_WORKER_NOT_USABLE_BITMAP) ) && \
355  PROXY_WORKER_IS_INITIALIZED(f) )
356 
357 #define PROXY_WORKER_IS_DRAINING(f) ( (f)->s->status & PROXY_WORKER_DRAIN )
358 
359 #define PROXY_WORKER_IS_GENERIC(f) ( (f)->s->status & PROXY_WORKER_GENERIC )
360 
361 #define PROXY_WORKER_IS_HCFAILED(f) ( (f)->s->status & PROXY_WORKER_HC_FAIL )
362 
363 #define PROXY_WORKER_IS(f, b) ( (f)->s->status & (b) )
364 
365 /* default worker retry timeout in seconds */
366 #define PROXY_WORKER_DEFAULT_RETRY 60
367 
368 /* Some max char string sizes, for shm fields */
369 #define PROXY_WORKER_MAX_SCHEME_SIZE 16
370 #define PROXY_WORKER_MAX_ROUTE_SIZE 96
371 #define PROXY_BALANCER_MAX_ROUTE_SIZE 64
372 #define PROXY_WORKER_MAX_NAME_SIZE 256
373 #define PROXY_BALANCER_MAX_NAME_SIZE 64
374 #define PROXY_WORKER_MAX_HOSTNAME_SIZE 96
375 #define PROXY_BALANCER_MAX_HOSTNAME_SIZE 64
376 #define PROXY_BALANCER_MAX_STICKY_SIZE 64
377 #define PROXY_WORKER_MAX_SECRET_SIZE 64
378 
379 #define PROXY_RFC1035_HOSTNAME_SIZE 256
380 
381 /* RFC-1035 mentions limits of 255 for host-names and 253 for domain-names,
382  * dotted together(?) this would fit the below size (+ trailing NUL).
383  */
384 #define PROXY_WORKER_RFC1035_NAME_SIZE 512
385 
386 #define PROXY_MAX_PROVIDER_NAME_SIZE 16
387 
388 #define PROXY_STRNCPY(dst, src) ap_proxy_strncpy((dst), (src), (sizeof(dst)))
389 
390 #define PROXY_COPY_CONF_PARAMS(w, c) \
391 do { \
392 (w)->s->timeout = (c)->timeout; \
393 (w)->s->timeout_set = (c)->timeout_set; \
394 (w)->s->recv_buffer_size = (c)->recv_buffer_size; \
395 (w)->s->recv_buffer_size_set = (c)->recv_buffer_size_set; \
396 (w)->s->io_buffer_size = (c)->io_buffer_size; \
397 (w)->s->io_buffer_size_set = (c)->io_buffer_size_set; \
398 } while (0)
399 
400 #define PROXY_DO_100_CONTINUE(w, r) \
401 ((w)->s->ping_timeout_set \
402  && (PROXYREQ_REVERSE == (r)->proxyreq) \
403  && !(apr_table_get((r)->subprocess_env, "force-proxy-request-1.0")) \
404  && ap_request_has_body((r)))
405 
406 /* use 2 hashes */
407 typedef struct {
408  unsigned int def;
409  unsigned int fnv;
410 } proxy_hashes ;
411 
412 /* Runtime worker status information. Shared in scoreboard */
413 typedef struct {
415  char scheme[PROXY_WORKER_MAX_SCHEME_SIZE]; /* scheme to use ajp|http|https */
416  char hostname[PROXY_WORKER_MAX_HOSTNAME_SIZE]; /* remote backend address (deprecated, use hostname_ex below) */
417  char route[PROXY_WORKER_MAX_ROUTE_SIZE]; /* balancing route */
418  char redirect[PROXY_WORKER_MAX_ROUTE_SIZE]; /* temporary balancing redirection route */
419  char flusher[PROXY_WORKER_MAX_SCHEME_SIZE]; /* flush provider used by mod_proxy_fdpass */
420  char uds_path[PROXY_WORKER_MAX_NAME_SIZE]; /* path to worker's unix domain socket if applicable */
421  char hcuri[PROXY_WORKER_MAX_ROUTE_SIZE]; /* health check uri */
422  char hcexpr[PROXY_WORKER_MAX_SCHEME_SIZE]; /* name of condition expr for health check */
423  char secret[PROXY_WORKER_MAX_SECRET_SIZE]; /* authentication secret (e.g. AJP13) */
424  char upgrade[PROXY_WORKER_MAX_SCHEME_SIZE];/* upgrade protocol used by mod_proxy_wstunnel */
425  char hostname_ex[PROXY_RFC1035_HOSTNAME_SIZE]; /* RFC1035 compliant version of the remote backend address */
426  int lbset; /* load balancer cluster set */
427  int retries; /* number of retries on this worker */
428  int lbstatus; /* Current lbstatus */
429  int lbfactor; /* dynamic lbfactor */
430  int min; /* Desired minimum number of available connections */
431  int smax; /* Soft maximum on the total number of connections */
432  int hmax; /* Hard maximum on the total number of connections */
433  int flush_wait; /* poll wait time in microseconds if flush_auto */
434  int index; /* shm array index */
435  int passes; /* number of successes for check to pass */
436  int pcount; /* current count of passes */
437  int fails; /* number of failures for check to fail */
438  int fcount; /* current count of failures */
439  proxy_hashes hash; /* hash of worker name */
440  unsigned int status; /* worker status bitfield */
441  enum {
444  flush_auto
445  } flush_packets; /* control AJP flushing */
446  hcmethod_t method; /* method to use for health check */
447  apr_time_t updated; /* timestamp of last update for dynamic workers, or queue-time of HC workers */
448  apr_time_t error_time; /* time of the last error */
449  apr_interval_time_t ttl; /* maximum amount of time in seconds a connection
450  * may be available while exceeding the soft limit */
451  apr_interval_time_t retry; /* retry interval */
452  apr_interval_time_t timeout; /* connection timeout */
453  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 */
461  apr_size_t response_field_size; /* Size of proxy response buffer in bytes. */
463  apr_off_t transferred;/* Number of bytes transferred to remote */
464  apr_off_t read; /* Number of bytes read from remote */
465  void *context; /* general purpose storage */
466  unsigned int keepalive:1;
467  unsigned int disablereuse:1;
468  unsigned int is_address_reusable:1;
469  unsigned int retry_set:1;
470  unsigned int timeout_set:1;
471  unsigned int acquire_set:1;
472  unsigned int ping_timeout_set:1;
473  unsigned int conn_timeout_set:1;
474  unsigned int recv_buffer_size_set:1;
475  unsigned int io_buffer_size_set:1;
476  unsigned int keepalive_set:1;
477  unsigned int disablereuse_set:1;
478  unsigned int was_malloced:1;
479  unsigned int is_name_matchable:1;
480  unsigned int response_field_size_set:1;
482 
483 #define ALIGNED_PROXY_WORKER_SHARED_SIZE (APR_ALIGN_DEFAULT(sizeof(proxy_worker_shared)))
484 
485 /* Worker configuration */
486 struct proxy_worker {
487  proxy_hashes hash; /* hash of worker name */
488  unsigned int local_status; /* status of per-process worker */
489  proxy_conn_pool *cp; /* Connection pool to use */
490  proxy_worker_shared *s; /* Shared data */
491  proxy_balancer *balancer; /* which balancer am I in? */
492 #if APR_HAS_THREADS
493  apr_thread_mutex_t *tmutex; /* Thread lock for updating address cache */
494 #endif
495  void *context; /* general purpose storage */
496  ap_conf_vector_t *section_config; /* <Proxy>-section wherein defined */
497 };
498 
499 /* default to health check every 30 seconds */
500 #define HCHECK_WATHCHDOG_DEFAULT_INTERVAL (30)
501 
502 /*
503  * Time to wait (in microseconds) to find out if more data is currently
504  * available at the backend.
505  */
506 #define PROXY_FLUSH_WAIT 10000
507 
508 typedef struct {
509  char sticky_path[PROXY_BALANCER_MAX_STICKY_SIZE]; /* URL sticky session identifier */
510  char sticky[PROXY_BALANCER_MAX_STICKY_SIZE]; /* sticky session identifier */
511  char lbpname[PROXY_MAX_PROVIDER_NAME_SIZE]; /* lbmethod provider name */
512  char nonce[APR_UUID_FORMATTED_LENGTH + 1];
517  apr_interval_time_t timeout; /* Timeout for waiting on free connection */
518  apr_time_t wupdated; /* timestamp of last change to workers list */
519  int max_attempts; /* Number of attempts before failing */
520  int index; /* shm array index */
522  unsigned int sticky_force:1; /* Disable failover for sticky sessions */
523  unsigned int scolonsep:1; /* true if ';' seps sticky session paths */
524  unsigned int max_attempts_set:1;
525  unsigned int was_malloced:1;
526  unsigned int need_reset:1;
527  unsigned int vhosted:1;
528  unsigned int inactive:1;
529  unsigned int forcerecovery:1;
530  char sticky_separator; /* separator for sessionid/route */
531  unsigned int forcerecovery_set:1;
532  unsigned int scolonsep_set:1;
533  unsigned int sticky_force_set:1;
534  unsigned int nonce_set:1;
535  unsigned int sticky_separator_set:1;
537 
538 #define ALIGNED_PROXY_BALANCER_SHARED_SIZE (APR_ALIGN_DEFAULT(sizeof(proxy_balancer_shared)))
539 
541  apr_array_header_t *workers; /* initially configured workers */
542  apr_array_header_t *errstatuses; /* statuses to force members into error */
543  ap_slotmem_instance_t *wslot; /* worker shm data - runtime */
545  int growth; /* number of post-config workers can added */
546  int max_workers; /* maximum number of allowed workers */
548  apr_time_t wupdated; /* timestamp of last change to workers list */
550  apr_global_mutex_t *gmutex; /* global lock for updating list of workers */
551 #if APR_HAS_THREADS
552  apr_thread_mutex_t *tmutex; /* Thread lock for updating shm */
553 #endif
555  void *context; /* general purpose storage */
556  proxy_balancer_shared *s; /* Shared data */
557  int failontimeout; /* Whether to mark a member in Err if IO timeout occurs */
558  unsigned int failontimeout_set:1;
559  unsigned int growth_set:1;
560  unsigned int lbmethod_set:1;
561  ap_conf_vector_t *section_config; /* <Proxy>-section wherein defined */
562 };
563 
565  const char *name; /* name of the load balancer method*/
566  proxy_worker *(*finder)(proxy_balancer *balancer,
567  request_rec *r);
568  void *context; /* general purpose storage */
569  apr_status_t (*reset)(proxy_balancer *balancer, server_rec *s);
570  apr_status_t (*age)(proxy_balancer *balancer, server_rec *s);
571  apr_status_t (*updatelbstatus)(proxy_balancer *balancer, proxy_worker *elected, server_rec *s);
572 };
573 
574 #if APR_HAS_THREADS
575 #define PROXY_THREAD_LOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_lock((x)->tmutex) : APR_SUCCESS)
576 #define PROXY_THREAD_UNLOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_unlock((x)->tmutex) : APR_SUCCESS)
577 #else
578 #define PROXY_THREAD_LOCK(x) (APR_SUCCESS)
579 #define PROXY_THREAD_UNLOCK(x) (APR_SUCCESS)
580 #endif
581 
582 #define PROXY_GLOBAL_LOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_lock((x)->gmutex) : APR_SUCCESS)
583 #define PROXY_GLOBAL_UNLOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_unlock((x)->gmutex) : APR_SUCCESS)
584 
585 /* hooks */
586 
587 /* Create a set of PROXY_DECLARE(type), PROXY_DECLARE_NONSTD(type) and
588  * PROXY_DECLARE_DATA with appropriate export and import tags for the platform
589  */
590 #if !defined(WIN32)
591 #define PROXY_DECLARE(type) type
592 #define PROXY_DECLARE_NONSTD(type) type
593 #define PROXY_DECLARE_DATA
594 #elif defined(PROXY_DECLARE_STATIC)
595 #define PROXY_DECLARE(type) type __stdcall
596 #define PROXY_DECLARE_NONSTD(type) type
597 #define PROXY_DECLARE_DATA
598 #elif defined(PROXY_DECLARE_EXPORT)
599 #define PROXY_DECLARE(type) __declspec(dllexport) type __stdcall
600 #define PROXY_DECLARE_NONSTD(type) __declspec(dllexport) type
601 #define PROXY_DECLARE_DATA __declspec(dllexport)
602 #else
603 #define PROXY_DECLARE(type) __declspec(dllimport) type __stdcall
604 #define PROXY_DECLARE_NONSTD(type) __declspec(dllimport) type
605 #define PROXY_DECLARE_DATA __declspec(dllimport)
606 #endif
607 
608 /* Using PROXY_DECLARE_OPTIONAL_HOOK instead of
609  * APR_DECLARE_EXTERNAL_HOOK allows build/make_nw_export.awk
610  * to distinguish between hooks that implement
611  * proxy_hook_xx and proxy_hook_get_xx in mod_proxy.c and
612  * those which don't.
613  */
614 #define PROXY_DECLARE_OPTIONAL_HOOK APR_DECLARE_EXTERNAL_HOOK
615 
616 
617 /* These 2 are in mod_proxy.c */
620 
621 /* Following 4 from health check */
623 APR_DECLARE_OPTIONAL_FN(void, hc_select_exprs, (request_rec *, const char *));
624 APR_DECLARE_OPTIONAL_FN(int, hc_valid_expr, (request_rec *, const char *));
627  const char *, const char *, void *));
628 
629 PROXY_DECLARE_OPTIONAL_HOOK(proxy, PROXY, int, section_post_config,
630  (apr_pool_t *p, apr_pool_t *plog,
631  apr_pool_t *ptemp, server_rec *s,
632  ap_conf_vector_t *section_config))
633 
634 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, scheme_handler,
636  proxy_server_conf *conf, char *url,
638 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, check_trans,
639  (request_rec *r, const char *url))
640 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, canon_handler,
641  (request_rec *r, char *url))
642 
643 PROXY_DECLARE_OPTIONAL_HOOK(proxy, PROXY, int, create_req,
644  (request_rec *r, request_rec *pr))
646 
647 
648 
655  (request_rec *r, proxy_conn_rec *backend))
656 
665 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, pre_request,
666  (proxy_worker **worker, proxy_balancer **balancer,
667  request_rec *r, proxy_server_conf *conf, char **url))
672 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, post_request,
673  (proxy_worker *worker, proxy_balancer *balancer,
674  request_rec *r, proxy_server_conf *conf))
675 
681 PROXY_DECLARE_OPTIONAL_HOOK(proxy, PROXY, int, request_status,
682  (int *status, request_rec *r))
683 
684 /* proxy_util.c */
685 
686 PROXY_DECLARE(apr_status_t) ap_proxy_strncpy(char *dst, const char *src,
687  apr_size_t dlen);
688 PROXY_DECLARE(int) ap_proxy_hex2c(const char *x);
689 PROXY_DECLARE(void) ap_proxy_c2hex(int ch, char *x);
690 PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t,
691  int forcedec, int proxyreq);
692 PROXY_DECLARE(char *)ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
693  char **passwordp, char **hostp, apr_port_t *port);
694 PROXY_DECLARE(int) ap_proxyerror(request_rec *r, int statuscode, const char *message);
695 
705  const char *hostname, apr_sockaddr_t *addr);
706 
707 
709 /* DEPRECATED (will be replaced with ap_proxy_connect_backend */
711 /* DEPRECATED (will be replaced with ap_proxy_check_connection */
713  request_rec *r);
717  ap_conf_vector_t *per_dir_config,
718  int enable);
720 PROXY_DECLARE(const char *) ap_proxy_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var);
721 
722 /* Header mapping functions, and a typedef of their signature */
723 PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *url);
724 PROXY_DECLARE(const char *) ap_proxy_cookie_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *str);
725 
726 #if !defined(WIN32)
727 typedef const char *(*ap_proxy_header_reverse_map_fn)(request_rec *,
728  proxy_dir_conf *, const char *);
729 #elif defined(PROXY_DECLARE_STATIC)
730 typedef const char *(__stdcall *ap_proxy_header_reverse_map_fn)(request_rec *,
731  proxy_dir_conf *, const char *);
732 #elif defined(PROXY_DECLARE_EXPORT)
733 typedef __declspec(dllexport) const char *
734  (__stdcall *ap_proxy_header_reverse_map_fn)(request_rec *,
735  proxy_dir_conf *, const char *);
736 #else
737 typedef __declspec(dllimport) const char *
738  (__stdcall *ap_proxy_header_reverse_map_fn)(request_rec *,
739  proxy_dir_conf *, const char *);
740 #endif
741 
742 
743 /* Connection pool API */
752  proxy_worker *worker);
753 
763  const proxy_worker *worker,
764  const char *upgrade,
765  const char *dflt);
766 
776  proxy_balancer *balancer,
777  proxy_server_conf *conf,
778  const char *url);
790  proxy_worker **worker,
791  proxy_balancer *balancer,
792  proxy_server_conf *conf,
793  const char *url,
794  int do_malloc);
795 
808  proxy_worker **worker,
809  proxy_balancer *balancer,
810  proxy_server_conf *conf,
811  const char *url,
812  int do_malloc);
813 
822  proxy_worker_shared *shm,
823  int i);
824 
833  server_rec *s,
834  apr_pool_t *p);
835 
843 
844 
854  proxy_server_conf *conf,
855  const char *url,
856  int careactive);
857 
866  proxy_balancer *balancer,
867  const char *url);
868 
880  proxy_balancer **balancer,
881  proxy_server_conf *conf,
882  const char *url,
883  const char *alias,
884  int do_malloc);
885 
895  int i);
896 
905  server_rec *s,
906  apr_pool_t *p);
907 
908 typedef int (proxy_is_best_callback_fn_t)(proxy_worker *current, proxy_worker *prev_best, void *baton);
909 
921  request_rec *r,
923  void *baton);
924 /*
925  * Needed by the lb modules.
926  */
928  (proxy_balancer *balancer,
929  request_rec *r,
931  void *baton));
932 
942  ap_slotmem_instance_t *slot,
943  proxy_worker *worker,
944  unsigned int *index);
945 
955  ap_slotmem_instance_t *slot,
956  proxy_balancer *balancer,
957  unsigned int *index);
958 
970 PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker,
971  proxy_balancer **balancer,
972  request_rec *r,
973  proxy_server_conf *conf,
974  char **url);
985 PROXY_DECLARE(int) ap_proxy_post_request(proxy_worker *worker,
986  proxy_balancer *balancer,
987  request_rec *r,
988  proxy_server_conf *conf);
989 
1007  proxy_server_conf *conf,
1008  proxy_worker *worker,
1009  proxy_conn_rec *conn,
1010  apr_uri_t *uri,
1011  char **url,
1012  const char *proxyname,
1014  char *server_portstr,
1015  int server_portstr_size);
1016 
1027  (const char *proxy_function, proxy_worker *worker, server_rec *s));
1028 
1040 PROXY_DECLARE(int) ap_proxy_acquire_connection(const char *proxy_function,
1041  proxy_conn_rec **conn,
1042  proxy_worker *worker,
1043  server_rec *s);
1052 PROXY_DECLARE(int) ap_proxy_release_connection(const char *proxy_function,
1053  proxy_conn_rec *conn,
1054  server_rec *s);
1055 
1056 #define PROXY_CHECK_CONN_EMPTY (1 << 0)
1057 
1072  proxy_conn_rec *conn,
1073  server_rec *server,
1074  unsigned max_blank_lines,
1075  int flags);
1076 
1087 PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
1088  proxy_conn_rec *conn,
1089  proxy_worker *worker,
1090  server_rec *s);
1091 
1099 PROXY_DECLARE(apr_status_t) ap_proxy_connect_uds(apr_socket_t *sock,
1100  const char *uds_path,
1101  apr_pool_t *p);
1112 PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function,
1113  proxy_conn_rec *conn,
1114  conn_rec *c, server_rec *s);
1115 
1125 PROXY_DECLARE(int) ap_proxy_connection_create_ex(const char *proxy_function,
1126  proxy_conn_rec *conn,
1127  request_rec *r);
1137 
1146 PROXY_DECLARE(void) ap_proxy_backend_broke(request_rec *r,
1147  apr_bucket_brigade *brigade);
1148 
1157 
1158 PROXY_DECLARE(unsigned int) ap_proxy_hashfunc(const char *str, proxy_hash_t method);
1159 
1160 
1168 PROXY_DECLARE(apr_status_t) ap_proxy_set_wstatus(char c, int set, proxy_worker *w);
1169 
1170 
1177 PROXY_DECLARE(char *) ap_proxy_parse_wstatus(apr_pool_t *p, proxy_worker *w);
1178 
1179 
1188  server_rec *s,
1189  proxy_server_conf *conf);
1190 
1191 
1203 PROXY_DECLARE(int) ap_proxy_trans_match(request_rec *r,
1204  struct proxy_alias *ent,
1205  proxy_dir_conf *dconf);
1206 
1223  apr_bucket_brigade *header_brigade,
1224  request_rec *r,
1225  proxy_conn_rec *p_conn,
1226  proxy_worker *worker,
1227  proxy_server_conf *conf,
1228  apr_uri_t *uri,
1229  char *url, char *server_portstr,
1230  char **old_cl_val,
1231  char **old_te_val);
1232 
1246 PROXY_DECLARE(int) ap_proxy_prefetch_input(request_rec *r,
1247  proxy_conn_rec *backend,
1248  apr_bucket_brigade *input_brigade,
1249  apr_read_type_e block,
1250  apr_off_t *bytes_read,
1251  apr_off_t max_read);
1252 
1262 PROXY_DECLARE(int) ap_proxy_spool_input(request_rec *r,
1263  proxy_conn_rec *backend,
1264  apr_bucket_brigade *input_brigade,
1265  apr_off_t *bytes_spooled,
1266  apr_off_t max_mem_spool);
1267 
1277 PROXY_DECLARE(int) ap_proxy_read_input(request_rec *r,
1278  proxy_conn_rec *backend,
1279  apr_bucket_brigade *input_brigade,
1280  apr_off_t max_read);
1281 
1292  request_rec *r, proxy_conn_rec *p_conn,
1293  conn_rec *origin, apr_bucket_brigade *bb,
1294  int flush);
1295 
1296 struct proxy_tunnel_conn; /* opaque */
1297 typedef struct {
1298  request_rec *r;
1299  const char *scheme;
1303  struct proxy_tunnel_conn *client,
1304  *origin;
1306  int replied;
1308 
1318  request_rec *r, conn_rec *c_o,
1319  const char *scheme);
1320 
1329 
1338  (request_rec *r, apr_table_t *headers));
1339 
1349  (request_rec *, apr_table_t *params));
1350 
1356  (apr_socket_t *sock, request_rec *r,
1357  apr_interval_time_t timeout));
1358 
1359 
1365 
1366 #define PROXY_LBMETHOD "proxylbmethod"
1367 
1368 /* The number of dynamic workers that can be added when reconfiguring.
1369  * If this limit is reached you must stop and restart the server.
1370  */
1371 #define PROXY_DYNAMIC_BALANCER_LIMIT 16
1372 
1377 int ap_proxy_lb_workers(void);
1378 
1386 PROXY_DECLARE(int) ap_proxy_should_override(proxy_dir_conf *conf, int code);
1387 
1393 PROXY_DECLARE(apr_port_t) ap_proxy_port_of_scheme(const char *scheme);
1394 
1400 PROXY_DECLARE (const char *) ap_proxy_show_hcmethod(hcmethod_t method);
1401 
1408 PROXY_DECLARE(const char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url);
1409 
1410 /*
1411  * Transform buckets from one bucket allocator to another one by creating a
1412  * transient bucket for each data bucket and let it use the data read from
1413  * the old bucket. Metabuckets are transformed by just recreating them.
1414  * Attention: Currently only the following bucket types are handled:
1415  *
1416  * All data buckets
1417  * FLUSH
1418  * EOS
1419  *
1420  * If an other bucket type is found its type is logged as a debug message
1421  * and APR_EGENERAL is returned.
1422  *
1423  * @param r request_rec of the actual request. Used for logging purposes
1424  * @param from the bucket brigade to take the buckets from
1425  * @param to the bucket brigade to store the transformed buckets
1426  * @return apr_status_t of the operation. Either APR_SUCCESS or
1427  * APR_EGENERAL
1428  */
1429 PROXY_DECLARE(apr_status_t) ap_proxy_buckets_lifetime_transform(request_rec *r,
1430  apr_bucket_brigade *from,
1431  apr_bucket_brigade *to);
1432 
1433 /*
1434  * The flags for ap_proxy_transfer_between_connections(), where for legacy and
1435  * compatibility reasons FLUSH_EACH and FLUSH_AFTER are boolean values.
1436  */
1437 #define AP_PROXY_TRANSFER_FLUSH_EACH (0x00)
1438 #define AP_PROXY_TRANSFER_FLUSH_AFTER (0x01)
1439 #define AP_PROXY_TRANSFER_YIELD_PENDING (0x02)
1440 #define AP_PROXY_TRANSFER_YIELD_MAX_READS (0x04)
1441 
1442 /*
1443  * Sends all data that can be read non blocking from the input filter chain of
1444  * c_i and send it down the output filter chain of c_o. For reading it uses
1445  * the bucket brigade bb_i which should be created from the bucket allocator
1446  * associated with c_i. For sending through the output filter chain it uses
1447  * the bucket brigade bb_o which should be created from the bucket allocator
1448  * associated with c_o. In order to get the buckets from bb_i to bb_o
1449  * ap_proxy_buckets_lifetime_transform is used.
1450  *
1451  * @param r request_rec of the actual request. Used for logging purposes
1452  * @param c_i inbound connection conn_rec
1453  * @param c_o outbound connection conn_rec
1454  * @param bb_i bucket brigade for pulling data from the inbound connection
1455  * @param bb_o bucket brigade for sending data through the outbound connection
1456  * @param name string for logging from where data was pulled
1457  * @param sent if not NULL will be set to 1 if data was sent through c_o
1458  * @param bsize maximum amount of data pulled in one iteration from c_i
1459  * @param flags AP_PROXY_TRANSFER_* bitmask
1460  * @return apr_status_t of the operation. Could be any error returned from
1461  * either the input filter chain of c_i or the output filter chain
1462  * of c_o, APR_EPIPE if the outgoing connection was aborted, or
1463  * APR_INCOMPLETE if AP_PROXY_TRANSFER_YIELD_PENDING was set and
1464  * the output stack gets full before the input stack is exhausted.
1465  */
1467  request_rec *r,
1468  conn_rec *c_i,
1469  conn_rec *c_o,
1470  apr_bucket_brigade *bb_i,
1471  apr_bucket_brigade *bb_o,
1472  const char *name,
1473  apr_off_t *sent,
1474  apr_off_t bsize,
1475  int flags);
1476 
1477 /*
1478  * returns number of bytes read from the back end tunnel
1479  * @param ptunnel proxy_tunnel_rec use during the tunnelling.
1480  * @return apr_off_t number of bytes read.
1481  */
1483  proxy_tunnel_rec *ptunnel);
1484 /*
1485  * returns number of bytes sent to the back end tunnel
1486  * @param ptunnel proxy_tunnel_rec use during the tunnelling.
1487  * @return apr_off_t number of bytes sent.
1488  */
1490  proxy_tunnel_rec *ptunnel);
1491 
1493 
1494 #endif /*MOD_PROXY_H*/
1495 
#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:490
unsigned int fnv
Definition: mod_proxy.h:409
int ap_proxy_tunnel_run(proxy_tunnel_rec *tunnel)
size_t apr_size_t
Definition: apr.h:393
int ap_proxy_retry_worker(const char *proxy_function, proxy_worker *worker, server_rec *s)
apr_pool_t * pool
Definition: mod_proxy.h:273
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:430
proxy_worker proxy_server_conf char const char apr_port_t proxyport
Definition: mod_proxy.h:637
Definition: mod_proxy.h:169
int hmax
Definition: mod_proxy.h:432
apr_sockaddr_t * addr
Definition: mod_proxy.h:275
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)
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)
void hc_show_exprs(request_rec *)
APR Network library.
APR UUID library.
apr_size_t recv_buffer_size
Definition: mod_proxy.h:172
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:133
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:119
Definition: mod_proxy.h:1297
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:117
Definition: apr_tables.h:62
const char * name
Definition: mod_proxy.h:146
Definition: mod_proxy.h:80
proxy_worker * worker
Definition: mod_proxy.h:272
int lbfactor
Definition: mod_proxy.h:429
Definition: mod_proxy.h:83
char flag
Definition: mod_proxy.h:91
apr_port_t port
Definition: mod_proxy.h:281
struct apr_reslist_t apr_reslist_t
Definition: apr_reslist.h:42
Definition: mod_proxy.h:168
struct proxy_tunnel_conn * origin
Definition: mod_proxy.h:1303
ap_conf_vector_t * section_config
Definition: mod_proxy.h:561
int ap_proxy_connection_create(const char *proxy_function, proxy_conn_rec *conn, conn_rec *c, server_rec *s)
Definition: mod_proxy.h:295
Definition: mod_proxy.h:145
apr_time_t wupdated
Definition: mod_proxy.h:518
float cache_completion
Definition: mod_proxy.h:296
int bgrowth
Definition: mod_proxy.h:165
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
Definition: mod_proxy.h:443
request_rec * r
Definition: mod_proxy.h:654
proxy_conn_pool * cp
Definition: mod_proxy.h:489
const char * ssl_hostname
Definition: mod_proxy.h:288
const char * name
Definition: mod_proxy.h:565
struct apr_sockaddr_t * hostaddr
Definition: mod_proxy.h:141
Apache Provider API.
apr_interval_time_t interval
Definition: mod_proxy.h:456
const char * uds_path
Definition: mod_proxy.h:287
proxy_hashes hash
Definition: mod_proxy.h:439
Definition: mod_proxy.h:76
proxy_balancer * balancer
Definition: mod_proxy.h:135
ap_slotmem_provider_t * storage
Definition: mod_proxy.h:189
apr_array_header_t * cookie_domains
Definition: mod_proxy.h:265
proxy_server_conf * sconf
Definition: mod_proxy.h:554
int ap_proxy_post_request(proxy_worker *worker, proxy_balancer *balancer, request_rec *r, proxy_server_conf *conf)
int replied
Definition: mod_proxy.h:1306
apr_interval_time_t async_idle_timeout
Definition: mod_proxy.h:254
apr_sockaddr_t * addr
Definition: mod_proxy.h:303
int index
Definition: mod_proxy.h:520
Definition: mod_proxy.h:508
unsigned int ap_proxy_hashfunc(const char *str, proxy_hash_t method)
proxy_worker * reverse
Definition: mod_proxy.h:159
apr_array_header_t * cookie_paths
Definition: mod_proxy.h:264
Definition: mod_proxy.h:167
apr_interval_time_t timeout
Definition: mod_proxy.h:1302
const char * domain
Definition: mod_proxy.h:160
apr_uint32_t flags
Definition: mod_proxy.h:280
Definition: mod_proxy.h:262
const char * scheme
Definition: mod_proxy.h:1299
apr_status_t ap_proxy_initialize_worker(proxy_worker *worker, server_rec *s, apr_pool_t *p)
apr_off_t ap_proxy_tunnel_conn_get_transferred(proxy_tunnel_rec *ptunnel)
proxy_hash_t
Definition: mod_proxy.h:1156
int ap_proxy_connect_backend(const char *proxy_function, proxy_conn_rec *conn, proxy_worker *worker, server_rec *s)
Definition: mod_proxy.h:407
proxy_worker * ap_proxy_balancer_get_best_worker(proxy_balancer *balancer, request_rec *r, proxy_is_best_callback_fn_t *is_best, void *baton)
const char * real
Definition: mod_proxy.h:131
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:460
apr_status_t balancer_manage(request_rec *, apr_table_t *params)
void * context
Definition: mod_proxy.h:465
apr_interval_time_t timeout
Definition: mod_proxy.h:517
apr_size_t io_buffer_size
Definition: mod_proxy.h:458
CORE HTTP Daemon.
int fails
Definition: mod_proxy.h:437
apr_array_header_t * errstatuses
Definition: mod_proxy.h:542
char * name
Definition: mod_proxy.h:139
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:549
PROXY_DECLARE_DATA proxy_hcmethods_t proxy_hcmethods[]
int use_regex
Definition: mod_proxy.h:121
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:631
detach_backend
Definition: mod_proxy.h:654
#define PROXY_WORKER_MAX_ROUTE_SIZE
Definition: mod_proxy.h:370
Definition: apr_buckets.h:258
const char apr_size_t dlen
Definition: mod_proxy.h:686
APR Thread Mutex Routines.
void * context
Definition: mod_proxy.h:568
Definition: mod_proxy.h:115
Definition: mod_proxy.h:80
int ap_proxy_worker_can_upgrade(apr_pool_t *p, const proxy_worker *worker, const char *upgrade, const char *dflt)
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:447
Definition: mod_proxy.h:76
Structure to store things which are per connection.
Definition: httpd.h:1183
int flush_wait
Definition: mod_proxy.h:433
APR-UTIL Resource List Routines.
#define APR_UUID_FORMATTED_LENGTH
Definition: apr_uuid.h:46
Virtual Host package.
APR-UTIL registration of functions exported by modules.
int fixups(request_rec *r)
apr_size_t response_field_size
Definition: mod_proxy.h:461
apr_status_t ajp_handle_cping_cpong(apr_socket_t *sock, request_rec *r, apr_interval_time_t timeout)
Symbol export macros and hook functions.
#define PROXY_MAX_PROVIDER_NAME_SIZE
Definition: mod_proxy.h:386
#define PROXY_DECLARE_OPTIONAL_HOOK
Definition: mod_proxy.h:614
char * ap_proxy_parse_wstatus(apr_pool_t *p, proxy_worker *w)
apr_array_header_t * cookie_domains
Definition: mod_proxy.h:224
apr_interval_time_t timeout
Definition: mod_proxy.h:175
const char * set_worker_hc_param(apr_pool_t *, server_rec *, proxy_worker *, const char *, const char *, void *)
Definition: mod_proxy.h:150
apr_array_header_t * aliases
Definition: mod_proxy.h:153
#define PROXY_DECLARE_DATA
Definition: mod_proxy.h:593
apr_pool_t * pool
Definition: mod_proxy.h:162
Definition: mod_proxy.h:76
Definition: apr_arch_global_mutex.h:23
signed char interpolate_env
Definition: mod_proxy.h:226
int ap_proxy_conn_is_https(conn_rec *c)
apr_time_t wupdated
Definition: mod_proxy.h:548
int req
Definition: mod_proxy.h:163
Apache Logging library.
apr_array_header_t * sec_proxy
Definition: mod_proxy.h:152
unsigned int local_status
Definition: mod_proxy.h:488
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:118
unsigned int status
Definition: mod_proxy.h:440
apr_int64_t apr_time_t
Definition: apr_time.h:45
void * forward
Definition: mod_proxy.h:279
#define PROXY_RFC1035_HOSTNAME_SIZE
Definition: mod_proxy.h:379
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:555
apr_size_t io_buffer_size
Definition: mod_proxy.h:173
const char * ap_proxy_show_hcmethod(hcmethod_t method)
apr_size_t read_buf_size
Definition: mod_proxy.h:1305
Definition: mod_proxy.h:138
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:487
Apache hook functions.
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, apr_off_t *sent, apr_off_t bsize, int flags)
Definition: mod_proxy.h:1156
#define PROXY_BALANCER_MAX_ROUTE_SIZE
Definition: mod_proxy.h:371
unsigned int flags
Definition: mod_proxy.h:134
A structure to store information for each virtual server.
Definition: httpd.h:1370
void * context
Definition: mod_proxy.h:495
apr_global_mutex_t * mutex
Definition: mod_proxy.h:187
apr_time_t error_time
Definition: mod_proxy.h:448
Definition: mod_proxy.h:76
const char * p
Definition: mod_proxy.h:211
int growth
Definition: mod_proxy.h:545
int
Definition: mod_proxy.h:654
apr_array_header_t * pfds
Definition: mod_proxy.h:1301
int smax
Definition: mod_proxy.h:431
apr_array_header_t * raliases
Definition: mod_proxy.h:263
apr_interval_time_t async_delay
Definition: mod_proxy.h:253
Definition: mod_proxy.h:268
Definition: mod_proxy.h:413
int max_attempts
Definition: mod_proxy.h:519
apr_off_t read
Definition: mod_proxy.h:464
#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)
Definition: mod_proxy.h:177
int hc_valid_expr(request_rec *, const char *)
int max_balancers
Definition: mod_proxy.h:164
apr_pollset_t * pollset
Definition: mod_proxy.h:1300
const char * ap_proxy_de_socketfy(apr_pool_t *p, const char *url)
apr_interval_time_t ttl
Definition: mod_proxy.h:449
proxy_balancer_shared * s
Definition: mod_proxy.h:556
#define PROXY_WORKER_MAX_NAME_SIZE
Definition: mod_proxy.h:372
Definition: mod_proxy.h:540
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:111
apr_socket_t * sock
Definition: mod_proxy.h:277
apr_reslist_t * res
Definition: mod_proxy.h:304
request_rec * r
Definition: mod_proxy.h:270
const char * name
Definition: mod_proxy.h:92
APR-UTIL Buckets/Bucket Brigades.
long maxfwd
Definition: mod_proxy.h:174
Definition: mod_proxy.h:130
proxy_worker proxy_server_conf char * url
Definition: mod_proxy.h:637
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:377
unsigned int apr_uint32_t
Definition: apr.h:347
hcmethod_t
Definition: mod_proxy.h:79
APR Platform Definitions.
apr_array_header_t * cookie_paths
Definition: mod_proxy.h:223
apr_port_t port
Definition: mod_proxy.h:462
APR MD5 Routines.
APR general purpose library routines.
#define PROXY_WORKER_MAX_HOSTNAME_SIZE
Definition: mod_proxy.h:374
APR-UTIL string matching routines.
#define PROXY_BALANCER_MAX_STICKY_SIZE
Definition: mod_proxy.h:376
int ap_proxyerror(request_rec *r, int statuscode, const char *message)
void * context
Definition: mod_proxy.h:555
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:147
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:452
Definition: mod_proxy.h:76
void ap_proxy_c2hex(int ch, char *x)
HTTP protocol handling.
int pcount
Definition: mod_proxy.h:436
Definition: apr_uri.h:85
Definition: mod_proxy.h:178
apr_array_header_t * workers
Definition: mod_proxy.h:156
apr_pool_t * p
#define PROXY_BALANCER_MAX_NAME_SIZE
Definition: mod_proxy.h:373
ap_slotmem_provider_t * storage
Definition: mod_proxy.h:544
apr_array_header_t * error_override_codes
Definition: mod_proxy.h:251
proxy_conn_rec * conn
Definition: mod_proxy.h:305
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:297
apr_array_header_t * workers
Definition: mod_proxy.h:541
int implemented
Definition: mod_proxy.h:86
apr_interval_time_t acquire
Definition: mod_proxy.h:453
apr_read_type_e
Definition: apr_buckets.h:57
apr_global_mutex_t * gmutex
Definition: mod_proxy.h:550
apr_off_t transferred
Definition: mod_proxy.h:463
Definition: mod_proxy.h:1156
apr_sockaddr_t * source_address
Definition: mod_proxy.h:186
apr_pool_t * scpool
Definition: mod_proxy.h:276
apr_pool_t * dns_pool
Definition: mod_proxy.h:306
struct proxy_alias * alias
Definition: mod_proxy.h:227
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:860
int retries
Definition: mod_proxy.h:427
int fcount
Definition: mod_proxy.h:438
Apache filter library.
const char *(* ap_proxy_header_reverse_map_fn)(request_rec *, proxy_dir_conf *, const char *)
Definition: mod_proxy.h:727
const char * hostname
Definition: mod_proxy.h:274
APR Strings library.
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)
proxy_worker * forward
Definition: mod_proxy.h:158
apr_status_t ap_proxy_tunnel_create(proxy_tunnel_rec **tunnel, request_rec *r, conn_rec *c_o, const char *scheme)
enctype
Definition: mod_proxy.h:75
apr_port_t port
Definition: mod_proxy.h:122
int passes
Definition: mod_proxy.h:435
int lbset
Definition: mod_proxy.h:426
dav_buffer const char * str
Definition: mod_dav.h:464
int ap_proxy_should_override(proxy_dir_conf *conf, int code)
apr_interval_time_t retry
Definition: mod_proxy.h:451
const char * id
Definition: mod_proxy.h:161
int status
Definition: mod_dav.h:141
#define PROXY_DECLARE(type)
Definition: mod_proxy.h:591
apr_off_t ap_proxy_tunnel_conn_get_read(proxy_tunnel_rec *ptunnel)
int ap_proxy_connection_reusable(proxy_conn_rec *conn)
char * name
Definition: mod_proxy.h:85
apr_interval_time_t ping_timeout
Definition: mod_proxy.h:454
struct apr_table_t apr_table_t
Definition: apr_tables.h:56
unsigned int bit
Definition: mod_proxy.h:90
#define PROXY_BALANCER_MAX_HOSTNAME_SIZE
Definition: mod_proxy.h:375
const char * name
Definition: mod_dav.h:805
int ap_proxy_hex2c(const char *x)
Definition: mod_proxy.h:183
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:116
apr_thread_mutex_t * tmutex
Definition: mod_proxy.h:552
Definition: mod_proxy.h:301
ap_slotmem_instance_t * bslot
Definition: mod_proxy.h:188
int index
Definition: mod_proxy.h:434
apr_bucket_brigade * tmp_bb
Definition: mod_proxy.h:289
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
Definition: mod_proxy.h:80
conn_rec * connection
Definition: mod_proxy.h:269
int ap_proxy_pre_request(proxy_worker **worker, proxy_balancer **balancer, request_rec *r, proxy_server_conf *conf, char **url)
Definition: http_config.h:355
const char * ap_proxy_cookie_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *str)
hcmethod_t method
Definition: mod_proxy.h:84
int apr_status_t
Definition: apr_errno.h:44
Definition: mod_proxy.h:80
#define APR_DECLARE_OPTIONAL_FN(ret, name, args)
Definition: apr_optional.h:50
proxy_hashes hash
Definition: mod_proxy.h:521
Definition: mod_proxy.h:80
Definition: mod_proxy.h:486
apr_status_t ap_proxy_initialize_balancer(proxy_balancer *balancer, server_rec *s, apr_pool_t *p)
int failontimeout
Definition: mod_proxy.h:557
apr_pool_t * pool
Definition: mod_proxy.h:302
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:369
const char * fake
Definition: mod_proxy.h:132
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:496
Definition: mod_proxy.h:89
void * data
Definition: mod_proxy.h:278
apr_thread_mutex_t * tmutex
Definition: mod_proxy.h:493
int lbstatus
Definition: mod_proxy.h:428
apr_array_header_t * balancers
Definition: mod_proxy.h:157
Definition: mod_proxy.h:80
proxy_worker proxy_server_conf * conf
Definition: mod_proxy.h:637
apr_size_t recv_buffer_size
Definition: mod_proxy.h:457
Definition: mod_proxy.h:80
Definition: mod_proxy.h:210
unsigned int def
Definition: mod_proxy.h:408
struct ap_conf_vector_t ap_conf_vector_t
Definition: http_config.h:519
hcmethod_t method
Definition: mod_proxy.h:446
apr_interval_time_t conn_timeout
Definition: mod_proxy.h:455
proxy_worker * worker
Definition: mod_proxy.h:637
apr_status_t ap_proxy_ssl_connection_cleanup(proxy_conn_rec *conn, request_rec *r)
apr_array_header_t * raliases
Definition: mod_proxy.h:222
apr_array_header_t * proxies
Definition: mod_proxy.h:151
Definition: mod_proxy.h:442
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1452
apr_array_header_t * refs
Definition: mod_proxy.h:246
proxy_balancer * balancer
Definition: mod_proxy.h:491
char * ap_proxy_update_balancer(apr_pool_t *p, proxy_balancer *balancer, const char *url)
ap_regex_t * r
Definition: mod_proxy.h:212
int max_workers
Definition: mod_proxy.h:546
Definition: mod_proxy.h:1156
apr_status_t ap_proxy_share_worker(proxy_worker *worker, proxy_worker_shared *shm, int i)
PROXY
Definition: mod_proxy.h:654
apr_status_t ap_proxy_set_wstatus(char c, int set, proxy_worker *w)
const char * creds
Definition: mod_proxy.h:120
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:564
proxy_worker * proxy_balancer_get_best_worker(proxy_balancer *balancer, request_rec *r, proxy_is_best_callback_fn_t *is_best, void *baton)
apr_array_header_t * noproxies
Definition: mod_proxy.h:154
off_t apr_off_t
Definition: apr.h:395
Memory Slot Extension Storage Module for Apache.
proxy_hashes hash
Definition: mod_proxy.h:547
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:543
proxy_worker proxy_server_conf char const char * proxyhost
Definition: mod_proxy.h:637
Definition: apr_network_io.h:266
apr_array_header_t * dirconn
Definition: mod_proxy.h:155
signed char p_is_fnmatch
Definition: mod_proxy.h:225
Definition: mod_proxy.h:80
Definition: mod_proxy.h:182
char sticky_separator
Definition: mod_proxy.h:530
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)
request_rec * r
Definition: mod_proxy.h:1298
SSL protocol handling.
int ap_proxy_read_input(request_rec *r, proxy_conn_rec *backend, apr_bucket_brigade *input_brigade, apr_off_t max_read)
int( proxy_is_best_callback_fn_t)(proxy_worker *current, proxy_worker *prev_best, void *baton)
Definition: mod_proxy.h:908
const char * src
Definition: mod_proxy.h:686
Definition: apr_arch_poll_private.h:119
apr_size_t elected
Definition: mod_proxy.h:459