1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

205 Commits

Author SHA1 Message Date
Jim Jagielski
a7d488a6d2 simple, functional interface to add additional balancer lb selection methods
without requiring code changes to mod_proxy/mod_proxy_balancer;
these can be implemented via sub-modules now.

Let the games begin...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@232282 13f79535-47bb-0310-9956-ffa450edef68
2005-08-12 12:47:04 +00:00
Nick Kew
ab0fd007b9 Fix mess left by incompleteness of previous ProxyPassReverse fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@232247 13f79535-47bb-0310-9956-ffa450edef68
2005-08-12 09:38:09 +00:00
Nick Kew
d153de58fe Fix ProxyPassReverse & family to work correctly in <Location>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@231355 13f79535-47bb-0310-9956-ffa450edef68
2005-08-10 23:36:39 +00:00
Mladen Turk
e7479bf114 Add status param option so that current worker
status can be changed via editing httpd.conf instead
just using web page. Seems the ApacheCon is paying of.
Thanks to Sander for pointing that out.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@225751 13f79535-47bb-0310-9956-ffa450edef68
2005-07-28 11:16:34 +00:00
Ian Holsman
9ffe8c5d1a This patch adds a new hook (request_status) that gets ran in proxy_handler
just before the final return.  This gives modules an opportunity to do
something based on the proxy status.

A couple of examples where this is useful:

-You are using a caching module and would rather return stale content rather
than an error to the client if the origin is down.

-you proxy some subrequests (using SSI - mod_include) and do not want SSI
errors when the backend is down. If you would normally return
HTTP_BAD_GATEWAY, you may have a module that serves some other content.


new hook -- so mmn bump.. i made it a major one, hope thats ok 

Patch From Brian Akins <Brian.Akins turner.com>




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219372 13f79535-47bb-0310-9956-ffa450edef68
2005-07-17 05:12:10 +00:00
Mladen Turk
0eab042f6a Use two optional functions from mod_ssl so that we
can receive both is_ssl and ssl_var for ajp protocol.
This is combined work based on patch from Brad Boyer and
Joe Orton's suggestion to use ssl_var_lookup.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@160690 13f79535-47bb-0310-9956-ffa450edef68
2005-04-09 16:16:54 +00:00
Joe Orton
a0570c8746 Move the POSIX reg* implementations into the ap_* namespace;
internalise the ap_reg*<->PCRE wrapper:

* configure.in: Add srclib/pcre to the include path.

* include/ap_regex.h: Renamed from include/pcreposix.h.  Prefix all
constants with AP_; prefix all functions and types with ap_.  Define
AP_DECLARE to nothing if necessary.  Remove regcomp error codes.

* include/httpd.h: Include ap_regex.h not pcreposix.h.
(ap_pregcomp, ap_regexec, ap_regfree): s/regex_t/ap_regex_t/.
(ap_regexec, ap_regerror): Prototypes moved to ap_regex.h.

* server/util.c (regex_cleanup, ap_pregcomp, ap_pregsub, ap_pregfree):
Adjust for ap_ prefixed types.  (ap_regexec, ap_regerror): Removed.

* server/Makefile.in: Build util_pcre.c.

* server/util_pcre.c: Copied from srclib/pcre/pcreposix.c; remove use
of PCRE-internals to do error mapping; rename types to add AP_/ap_
prefixes as above.  Use APR includes.  (ap_regerror): Use apr_snprintf.

* srclib/pcre/Makefile.in: Don't build pcreposix.c into libpcre.la.

* modules/*: Update to use new type and constant names.

PR: 27750 (part one)
Submitted by: Andres Salomon <dilinger voxel.net>, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153384 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:00:41 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Jim Jagielski
9935c31bdd Close PR 32459, 15207. API change for PROXY_DECLARE ap_proxy_canonenc()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151153 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 13:38:24 +00:00
Jim Jagielski
fe2650384d Add in a weighted byte count of all traffic (in and out) as
an alternative balancing method. We do not "adjust" the
byte count wrt scheme or method, simply by factoring
in the lbfactor value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@126304 13f79535-47bb-0310-9956-ffa450edef68
2005-01-24 18:28:16 +00:00
Sander Striker
46ba14216d Rewrite Cookies and other headers in mod_proxy_ajp as configured with
ProxyPassReverse and ProxyPassReverseCookiePath.

* modules/proxy/proxy_ajp.c

  (ap_proxy_ajp_request): Update call to ajp_parse_header().


* modules/proxy/ajp.h

  (ajp_msg_get_string): constify argument.

  (ajp_parse_header): Add conf argument.


* modules/proxy/proxy_util.c

  (ap_proxy_location_reverse_map): Promoted from mod_proxy_http.

  (ap_proxy_cookie_reverse_map): Promoted from mod_proxy_http;
    renamed from proxy_cookie_reverse_map.


* modules/proxy/ajp_msg.c

  (ajp_msg_get_string): constify argument.


* modules/proxy/proxy_http.c

  (ap_proxy_location_reverse_map, proxy_cookie_reverse_map: Removed.

  (process_proxy_header): Update header mapping table to reference the now
    public functions.


* modules/proxy/ajp_header.c

  (ajp_unmarshal_response): And conf argument.  Reverse map cookies and
    other headers.

  (ajp_parse_header): Update call to ajp_unmarshal_response().


* modules/proxy/mod_proxy.h

  (ap_proxy_location_reverse_map, ap_proxy_cookie_reverse_map): Declare
    functions that have been promoted to be public.

  (ap_proxy_header_reverse_map_fn): Typedef for the signature of the above
    two functions (currently used in mod_proxy_http).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@124901 13f79535-47bb-0310-9956-ffa450edef68
2005-01-11 08:35:46 +00:00
Cliff Woolley
a89bce3fd9 "transfered" is not a word.
s/transfered/transferred/g;



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111858 13f79535-47bb-0310-9956-ffa450edef68
2004-12-14 18:58:25 +00:00
Jim Jagielski
0fb2f37f3e grammatical parameter change... "readed" -> "read"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111830 13f79535-47bb-0310-9956-ffa450edef68
2004-12-14 16:08:55 +00:00
Mladen Turk
939710c063 Make proxy address cache thread safe and available only
to pooled workers.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111827 13f79535-47bb-0310-9956-ffa450edef68
2004-12-14 15:45:19 +00:00
Mladen Turk
4dda290fd1 Add generic reverse proxy worker so that module-driven reverse proxying works. It is enabled by default, but IMO it should be configurable like any other worker so we can limit the number of outgoing connections.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109316 13f79535-47bb-0310-9956-ffa450edef68
2004-12-01 08:44:11 +00:00
Mladen Turk
1994180dc0 Add server_rec to initialize_worker_share so that it get's
correctly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105345 13f79535-47bb-0310-9956-ffa450edef68
2004-09-29 19:05:44 +00:00
Mladen Turk
0d9c89ae6f Reformat code to no tab and no CR-LF
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105320 13f79535-47bb-0310-9956-ffa450edef68
2004-09-28 16:54:29 +00:00
Mladen Turk
258273c945 Make sure that we don't increase balancer worker count on
gracefull restart. Thanks to Christian...again.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105318 13f79535-47bb-0310-9956-ffa450edef68
2004-09-28 16:35:29 +00:00
Mladen Turk
8a2d25e4fa Remove proxy_runtime_worker and make the things simpler by
sharing runtime status accross child processes. Also make sure
that shared data is initialized after the scoreboard is created.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105293 13f79535-47bb-0310-9956-ffa450edef68
2004-09-26 06:54:27 +00:00
Mladen Turk
b4442f1f73 Make worker retry algorithm much simpler removing incremental
timeout increase.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105177 13f79535-47bb-0310-9956-ffa450edef68
2004-09-17 08:00:20 +00:00
Mladen Turk
6799ab5774 Add maximum nuber of attempts for failover and run scheme handler
if worker is in error state up to that number.
Another great idea from Christian von Roques.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105171 13f79535-47bb-0310-9956-ffa450edef68
2004-09-16 12:08:00 +00:00
Mladen Turk
ff2207a250 Register output function so that core can retrieve it and set
scoreboard accordingly


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105132 13f79535-47bb-0310-9956-ffa450edef68
2004-09-15 11:57:02 +00:00
Mladen Turk
5cc48386c4 Always use prive connection pool for allocation, and call
apr_pool_clear when the connection is closed on recycle, so
that we don't leak on persistent connections.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105108 13f79535-47bb-0310-9956-ffa450edef68
2004-09-13 11:13:28 +00:00
Mladen Turk
dd00fb7d89 Do not add forward proxy to other proxies. Use new function to
create the worker that isn't by default added to the list of other workers.
This enalbles mixing forward and reverse proxy functionality on the same box.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105070 13f79535-47bb-0310-9956-ffa450edef68
2004-09-11 09:31:10 +00:00
Mladen Turk
dca2aae9b3 Remove the unused close_connection function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105069 13f79535-47bb-0310-9956-ffa450edef68
2004-09-11 09:12:26 +00:00
Mladen Turk
225dd230c4 Just like for balancers initialize the workers on post_config
instead on first request to skip the race condition.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105064 13f79535-47bb-0310-9956-ffa450edef68
2004-09-10 18:29:16 +00:00
Mladen Turk
916b02a98d Move the shared scoreboard data initization to the balancer module.
The initialization is done like for the worker, on first request.
This is done because during config phase we don't have a scoreboard
to allocate from. Thanks to Chritian von Roques for spotting that.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105057 13f79535-47bb-0310-9956-ffa450edef68
2004-09-10 08:16:25 +00:00
Mladen Turk
44d1474f1e Add PROXY_WORKER_IGNORE_ERRORS flags that
disables puting the entire worker in retry mode, cause
for forward workers the remote is not fixed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105047 13f79535-47bb-0310-9956-ffa450edef68
2004-09-09 13:15:40 +00:00
Mladen Turk
bea1cc4147 Add sockaddr to proxy_conn_rec. Using the workers address
is unsafe for forward proxy workers, cause unlike reverse
proxies the forward can have each connection with different
remote address.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105046 13f79535-47bb-0310-9956-ffa450edef68
2004-09-09 13:03:06 +00:00
Mladen Turk
5593ebbfb2 Add 'default' foward proxy worker to the proxy_server_conf.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105043 13f79535-47bb-0310-9956-ffa450edef68
2004-09-09 10:22:19 +00:00
Mladen Turk
2a80ab7e07 Untabify the source.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104813 13f79535-47bb-0310-9956-ffa450edef68
2004-08-26 06:57:16 +00:00
Mladen Turk
a224ba752c Add pool used for allocating proxy_server_conf to that struct.
It will be used for dynamic configuration, to ensure that dynamic
params has the same lifetime as the config has.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104811 13f79535-47bb-0310-9956-ffa450edef68
2004-08-26 06:49:22 +00:00
Mladen Turk
00005d8082 Document new API functions.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104798 13f79535-47bb-0310-9956-ffa450edef68
2004-08-25 11:22:54 +00:00
Mladen Turk
c5eb96b6cb Remove the tabs from code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104797 13f79535-47bb-0310-9956-ffa450edef68
2004-08-25 11:21:15 +00:00
Graham Leggett
bf820c3251 Fix some compiler warnings in proxy
PR:
Obtained from:
Submitted by:	Geoffrey Young <geoff@modperlcookbook.org>
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104708 13f79535-47bb-0310-9956-ffa450edef68
2004-08-18 13:34:17 +00:00
William A. Rowe Jr
c42bcbc7ba Added proxy status for conf, and elected member to runtime worker
Added mod_status extension for displaying runtime
status informations for load balancer.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104627 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 23:30:17 +00:00
William A. Rowe Jr
4d5f6895d1 Implement the worker retry functionality.
It uses either worker->retry option or default 60 second retry
that is on each revolution extended by another 60 seconds.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104619 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 23:05:59 +00:00
William A. Rowe Jr
906f2c3d2d Shared memory support. The shared memory is inside
apache scoreboard. If it ever gets back ported we could use it on 2.0

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104617 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 23:02:53 +00:00
William A. Rowe Jr
b8a176667f Add route and redirect to worker so they can be set trough configuration.
Add worker status flag definitions.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104611 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:56:51 +00:00
William A. Rowe Jr
3698b4588c Fix structure element typo.
Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104609 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:55:00 +00:00
William A. Rowe Jr
7d605dabeb Fix some config checking params.
Added route and route redirect to the runtime worker.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104606 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:48:13 +00:00
William A. Rowe Jr
f99f785c89 Change the scheme handler hook to include worker.
We will probably need the balancer too, but that can wait for now.
Other undocumented changes (shame,shame) in proxy_util.c

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104600 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:41:02 +00:00
William A. Rowe Jr
ae18ec32a1 Added close_on_recycle flags for creatin connections.
This flag enables to distinguish between connection types.
Also added a pool cleanup bound to connection pool that recycles
the connection when client disconnects from server.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104599 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:39:02 +00:00
William A. Rowe Jr
6cc26c2656 Added acquire and release connection functions.
The acquire pulls the connection from the pool.
The release returns the connection to the pool.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104598 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:37:08 +00:00
William A. Rowe Jr
62ccd6ca6a Added ap_proxy_connection_create function that makes
conn_rec for opened connection. It is used bt http(s) and ftp for
bounding the backend connection to client connection with the same id's.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104597 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:36:28 +00:00
William A. Rowe Jr
5faf9c3c49 Added KeepAlive worker option.
The scheme handler will override this setting if required, depending on the
protocol itself and keepalive_set flag.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104596 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:35:19 +00:00
William A. Rowe Jr
5ead791f0e Add ap_proxy_connect_backend that will replace
ap_proxy_connect_to_backend. It uses worker params for setting socket
options and checks for conection's connect status.
It works both on empty and acquired connections.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104595 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:34:26 +00:00
William A. Rowe Jr
6c7efc889b Added iobuffersize and receivebuffersize to be worker specific.
As for timeout their default value is from proxy_conf.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104594 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:33:07 +00:00
William A. Rowe Jr
a603a36021 Added timeout_set for worker. Each worker can have a different timeout
the ProxyTimout sets. Also changed proxy_conf's timeout_set to int.

Use timeout_set for worker inherited from ProxyTimeout but overridable
using timout=xxx

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104592 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:31:46 +00:00
William A. Rowe Jr
c25b89a720 Added acquire timeout for obtaining resources from reslist.
The timeout is in milliseconds to enable quick return in case the
reslist is exceded the maximum number of connections.

Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104591 13f79535-47bb-0310-9956-ffa450edef68
2004-08-11 22:30:06 +00:00