Commit Graph

507 Commits

Author SHA1 Message Date
e8fb815ecd * Fill missing log number
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726781 13f79535-47bb-0310-9956-ffa450edef68
2016-01-26 12:19:50 +00:00
67ddd9009c * Introduce ap_proxy_buckets_lifetime_transform as a replacement for
proxy_buckets_lifetime_transform in mod_proxy_http. Another future consumer
  of this will be mod_proxy_wstunnel.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726779 13f79535-47bb-0310-9956-ffa450edef68
2016-01-26 12:13:56 +00:00
af14d158a3 Added many log numbers to log statements that
had none.

Those were not detected by the coccinelle script.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725485 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 12:02:41 +00:00
26019784af Expose this in our API
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725306 13f79535-47bb-0310-9956-ffa450edef68
2016-01-18 16:54:06 +00:00
2fda66ec46 Make balancer manager health-check aware
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725120 13f79535-47bb-0310-9956-ffa450edef68
2016-01-17 20:12:09 +00:00
8ea2d71642 Oops :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1724882 13f79535-47bb-0310-9956-ffa450edef68
2016-01-15 21:43:55 +00:00
9f2dd3550e 1st cut of 'simple' tcp check... We reuse various proxy
function and so this *could* be more streamlined, but
use this to show how the other would work, since we need
brigades, SSL/TLS support, etc.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1724879 13f79535-47bb-0310-9956-ffa450edef68
2016-01-15 21:37:23 +00:00
4d3ab92dbf Make aware of new status: Failed Health Check.
Store the number of current passes/fails in shm

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1722195 13f79535-47bb-0310-9956-ffa450edef68
2015-12-29 17:42:19 +00:00
2b7a352917 Abstract out as macro
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1721759 13f79535-47bb-0310-9956-ffa450edef68
2015-12-26 21:29:21 +00:00
c80e6b2a34 Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715876 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:46:01 +00:00
3c9ddf44bf Revert r1715789: will re-commit without spurious functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715869 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:28:36 +00:00
29843dc73f Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).
[Reverted by r1715869]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715789 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 12:33:09 +00:00
fab37e8e26 mod_proxy: Fix ProxySourceAddress binding failure with AH00938. PR 56687.
Proposed by: Arne de Bruijn <apache arbruijn.dds.nl>
Reviewed by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1703902 13f79535-47bb-0310-9956-ffa450edef68
2015-09-18 16:43:25 +00:00
cef0bb5ac5 mod_proxy: don't recyle backend announced "Connection: close" connections.
Failing to do this may lead to a race condition where we send a new request
before the backend really closes the connection (or lost SSL-Alert/FIN make
us think the connection is still alive, until the retransmission).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1703807 13f79535-47bb-0310-9956-ffa450edef68
2015-09-18 10:58:58 +00:00
ba6ece3161 * Do a more complete cleanup here. At this point we cannot end up with something useful with the data we created so far.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1697323 13f79535-47bb-0310-9956-ffa450edef68
2015-08-24 07:43:19 +00:00
3efa9ca002 mod_proxy: follow up to r1678768.
The resource is not dereferenceable if connection_destructor()
is called from reslist_destroy().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1687783 13f79535-47bb-0310-9956-ffa450edef68
2015-06-26 15:10:29 +00:00
d83f45cee1 Improve error message (related to PR57311 diagnostic)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1682819 13f79535-47bb-0310-9956-ffa450edef68
2015-06-01 05:45:13 +00:00
ff720d0f56 mod_proxy: check for the correct pool (lifetime) in connection_cleanup(),
according to the associated comment and the value really NULLed in
conn_pool_cleanup().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1678768 13f79535-47bb-0310-9956-ffa450edef68
2015-05-11 15:26:13 +00:00
339e1a5943 mod_proxy: only cleanup the socket for a connection asked to be closed but
whose address can still be reused.

This saves unnecessary socket pool destroy and creation at cleanup and reuse
time, plus the same initialization of conn->pool's associated data which can
be reused in that case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1678763 13f79535-47bb-0310-9956-ffa450edef68
2015-05-11 14:53:34 +00:00
59240d4951 mod_proxy: use the original (non absolute) form of the request-line's URI
for requests embedded in CONNECT payloads used to connect SSL backends via
a ProxyRemote forward-proxy. PR 55892.

Submitted by: Hendrik Harms <hendrik.harms gmail com>
Reviewed  by: wrowe, ylavic
Committed by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1665215 13f79535-47bb-0310-9956-ffa450edef68
2015-03-09 12:45:56 +00:00
6864b2c781 * Do not reset the retry timeout if the worker is in error at this stage even
if the connection to the backend was successful. It was likely set into
   error by a different thread / process in parallel e.g. for a timeout or
   bad status. We should respect this and should not continue with a connection
   via this worker even if we got one.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1664709 13f79535-47bb-0310-9956-ffa450edef68
2015-03-06 19:31:42 +00:00
ccc2e4c751 mod_proxy_http: don't connect or reuse backend before prefetching request body.
The goal is to minimize the delay between this connection is considered alive
and the first bytes sent (should the client's link be slow or some input filter
retain the data).
This is a best effort to prevent the backend from closing (from under us) what
it thinks is an idle connection, hence to reduce to the minimum the unavoidable
local ap_proxy_is_socket_connected() vs remote keepalive race condition.
PR 56541.

Also, allow the new subprocess_env variable "proxy-flushall" to prevent any
buffering of the request body before it is forwarded to the backend.
When set, the prefetch is still done (although non-blocking), so we can still
determine Content-Length vs chunked vs spooled (depending on data available
with the header or while reading it), and then all brigades are flushed when
passed to the backend.
PR 37920.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1656259 13f79535-47bb-0310-9956-ffa450edef68
2015-02-01 00:05:59 +00:00
1f6fd365c3 mod_proxy: Don't put non balancer-member workers in error state by
default for connection or 500/503 errors, and honor status=+I for
any error.  PR 48388.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1650028 13f79535-47bb-0310-9956-ffa450edef68
2015-01-07 10:36:12 +00:00
c54599cf61 PR 56603: Inappropiate ProxyPassReverse match when interpolated URL
is empty string 

Submitted By: <ajprout hotmail.com>
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1648433 13f79535-47bb-0310-9956-ffa450edef68
2014-12-29 21:05:56 +00:00
85d1a0ba01 Allow SetHandler+UDS+fcgi to take advantage of dedicated workers including
opting in to connection reuse and other proxy options (max=, etc).

adds 'enablereuse' proxyoption and a minor MMN bump to share
proxy_desocketfy outside of mod_proxy.c, which is required to
match workers to URLs.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1647009 13f79535-47bb-0310-9956-ffa450edef68
2014-12-20 15:56:16 +00:00
0c5d74a177 mod_proxy: don't add the default port to the name of proxy workers. PR 57259.
ap_proxy_port_of_scheme() knows more default ports than apr_unparse_uri().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1644503 13f79535-47bb-0310-9956-ffa450edef68
2014-12-10 18:45:24 +00:00
e2fafef499 elaborate on a TRACE2 message about using the default reverse
proxy worker. 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1641636 13f79535-47bb-0310-9956-ffa450edef68
2014-11-25 15:38:10 +00:00
668c7200db Return a match whenever we get to the end of the worker name, regardless
of whether there is URL left.

ProxyPassMatch had been using the default worker in trunk.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1641381 13f79535-47bb-0310-9956-ffa450edef68
2014-11-24 12:36:32 +00:00
3eddd534ce When using EBCDIC encoding, HTTPS through ProxyPass and ProxyRemote doesn't
work correctly. PR 57092

Submitted By: Edward Lu 
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1634425 13f79535-47bb-0310-9956-ffa450edef68
2014-10-27 00:55:20 +00:00
26848f7a23 * Use the correct server name for SNI in case the backend SSL connection itself
is established via a proxy server.

PR: 57139
Submitted by: Szabolcs Gyurko <szabolcs gyurko.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1634120 13f79535-47bb-0310-9956-ffa450edef68
2014-10-24 19:00:10 +00:00
e5cf7761a4 oops... prepend 0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1625952 13f79535-47bb-0310-9956-ffa450edef68
2014-09-18 12:10:54 +00:00
f1176161be Fix sscanf format spotted by cppcheck.
Improve alignment.
Untested.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1621419 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 06:51:11 +00:00
527acb80ce Correct loglevel.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1621372 13f79535-47bb-0310-9956-ffa450edef68
2014-08-29 19:42:34 +00:00
6be32ac353 PR53218
Allow for longer worker names and make truncation a non-fatal
error... 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1621367 13f79535-47bb-0310-9956-ffa450edef68
2014-08-29 19:17:45 +00:00
6d3f422f8c mod_proxy: add missing APLOGNOs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1619455 13f79535-47bb-0310-9956-ffa450edef68
2014-08-21 15:49:54 +00:00
bb2749fd6e SECURITY (CVE-2014-0117): Fix a crash in mod_proxy. In a reverse
proxy configuration, a remote attacker could send a carefully crafted
request which could crash a server process, resulting in denial of
service.

Thanks to Marek Kroemeke working with HP's Zero Day Initiative for
reporting this issue.

* server/util.c (ap_parse_token_list_strict): New function.

* modules/proxy/proxy_util.c (find_conn_headers): Use it here.

* modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response):
  Send a 400 for a malformed Connection header.

Submitted by: Edward Lu, breser, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610674 13f79535-47bb-0310-9956-ffa450edef68
2014-07-15 12:27:00 +00:00
c0a52f109d mod_proxy: add ap_proxy_define_match_worker() and use it for ProxyPassMatch
and ProxyMatch section to distinguish between normal workers and workers
with regex substitutions in the name. Implement handling of such workers
in ap_proxy_get_worker(). PR 43513


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1609680 13f79535-47bb-0310-9956-ffa450edef68
2014-07-11 10:36:15 +00:00
4f08f4008a Fix C99 (or later only) comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1609101 13f79535-47bb-0310-9956-ffa450edef68
2014-07-09 11:11:23 +00:00
ec95d72c5a mod_proxy: Don't limit the size of the connectable Unix Domain Socket paths.
Since connect() to UDS path is used at several places, introduce
ap_proxy_connect_uds() in proxy_util.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1602989 13f79535-47bb-0310-9956-ffa450edef68
2014-06-16 20:26:24 +00:00
637f263141 revert 1602523, until there is understanding
about what the actual issue and "requirement" are.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1602697 13f79535-47bb-0310-9956-ffa450edef68
2014-06-15 13:54:55 +00:00
74820dfc57 Allow for "magic" scheme "auto" which makes the scheme of
the backend worker match whatever the scheme of the
incoming request was...

For example:

   ProxyPass / auto://foo.example.com/

If the incoming request is http:.../lala then
the resultant will be http://foo.example.com/lala

If it's wws:.../lolo then we'd send
wws://foo.example.com/lolo

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1602523 13f79535-47bb-0310-9956-ffa450edef68
2014-06-13 21:10:51 +00:00
3dd42c024f mod_proxy: follow up to r1601291.
Since deferred_write_pool is needed by the core_output_filter and is a subpool
of the connection, shutdown in a pre_cleanup of the connection's pool to avoid
a freed memory access (SEGV).

Reported By: takashi


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601630 13f79535-47bb-0310-9956-ffa450edef68
2014-06-10 13:23:20 +00:00
5cc5869ea4 mod_proxy: Shutdown (eg. SSL close notify) the backend connection
before closing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601291 13f79535-47bb-0310-9956-ffa450edef68
2014-06-09 01:03:39 +00:00
bac2d32f4c Revert r1601285 and r1601283.
Shouldn't have commited the latter without disussing it on dev@.
Since the former creates upper APLOGNOs, revert and then recommit with the reverted next tag number.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601290 13f79535-47bb-0310-9956-ffa450edef68
2014-06-09 00:59:04 +00:00
9f43505e4d mod_proxy: Shutdown (eg. close notify) the backend connection before closing.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601285 13f79535-47bb-0310-9956-ffa450edef68
2014-06-09 00:23:16 +00:00
65341f92bc Follow-up to r1592529:
Define default port for "scgi" schemes (as chosen by
mod_proxy_scgi) in a common location.

Suggested by: jailletc36


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592615 13f79535-47bb-0310-9956-ffa450edef68
2014-05-05 19:26:33 +00:00
dafc97aa81 mod_proxy_scgi: Support Unix sockets.
ap_proxy_port_of_scheme(): Support default SCGI port (4000).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592529 13f79535-47bb-0310-9956-ffa450edef68
2014-05-05 14:02:48 +00:00
a306773aa4 Clarify an existing requirement of the server_portstr parameter
to ap_proxy_determine_connection(): it must be a buffer of at
least one byte in size.

(And don't bother with using strcpy in order to zap a string.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592514 13f79535-47bb-0310-9956-ffa450edef68
2014-05-05 12:47:18 +00:00
19b5b85316 reformat only (get rid of unnecessary block scope)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592511 13f79535-47bb-0310-9956-ffa450edef68
2014-05-05 12:40:47 +00:00
2aa898bb2f strncmp(r->filename, "proxy:", 6) is faster than a
note. Plus, allows for checking even if not due to
rewrite.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588544 13f79535-47bb-0310-9956-ffa450edef68
2014-04-18 19:21:35 +00:00