1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

672 Commits

Author SHA1 Message Date
Ruediger Pluem
1a9f0f379b * Revert r1865944 and r1865938
Revert r1865944 and r1865938 in order to provide a better patch with less
locking and thus contention.

lognos


PR63503: fix pool concurrency problems in mod_proxy

reslist and resolver related calls could concurrently access the same pool.

Submitted By: Don Poitras <Don.Poitras sas.com>
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1868294 13f79535-47bb-0310-9956-ffa450edef68
2019-10-11 14:36:32 +00:00
Eric Covener
fece93508b restore use of global mutex under !APR_HAS_THREADS
followup to r1852442 which appears to have been too agressive in wrapping
blocks with #if APR_HAS_THREADS.  With !APR_HAS_THREADS a global mutex 
is a proc mutex.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1866145 13f79535-47bb-0310-9956-ffa450edef68
2019-08-30 11:58:41 +00:00
Eric Covener
568ce9b204 lognos
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1865944 13f79535-47bb-0310-9956-ffa450edef68
2019-08-26 15:09:00 +00:00
Eric Covener
1dfc694259 PR63503: fix pool concurrency problems in mod_proxy
reslist and resolver related calls could concurrently access the same pool.

Submitted By: Don Poitras <Don.Poitras sas.com>
Committed By: covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1865938 13f79535-47bb-0310-9956-ffa450edef68
2019-08-26 14:19:31 +00:00
Eric Covener
853f883f73 remove APR_HAS_THREADS check
no need to wrap these after r1865936


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1865937 13f79535-47bb-0310-9956-ffa450edef68
2019-08-26 14:07:08 +00:00
Joe Orton
9fb0386653 * modules/proxy/proxy_util.c (ap_proxy_share_balancer): Create the
nonce as a pseudo-UUID using the PRNG.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864693 13f79535-47bb-0310-9956-ffa450edef68
2019-08-08 12:03:14 +00:00
Eric Covener
c0ce3a7292 remove request details from error documents (CVE-2019-10092).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864191 13f79535-47bb-0310-9956-ffa450edef68
2019-08-02 01:27:37 +00:00
Ruediger Pluem
a84a80c1e5 * Fix the logic to follow the comment. So far we only forwarded the header if
we have NOT used it AND the env variable was set. But if we have not
  used it we should forward it in any case independent of the env variable
  setting.
  This aligns also with the behaviour in ap_proxy_create_hdrbrgd.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1859713 13f79535-47bb-0310-9956-ffa450edef68
2019-05-22 09:54:05 +00:00
Yann Ylavic
975f5e1095 Follow up to r1859371: extend to other ap_proxy_connection_create[_ex]() users.
This function now now handles SSL reuse as well as the "proxy-request-hostname"
note (SNI), so let's also call it unconditionnaly in all proxy modules.

On the mod_ssl side, since this note has the lifetime of the connection, don't
reset/unset it during handshake (ssl_io_filter_handshake).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1859422 13f79535-47bb-0310-9956-ffa450edef68
2019-05-17 08:42:17 +00:00
Jim Jagielski
f67237e46c Fix for: [Bug 62372] Load balancer byrequests required when bytraffic chosen
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1856829 13f79535-47bb-0310-9956-ffa450edef68
2019-04-02 15:00:43 +00:00
Yann Ylavic
c75c9a812e mod_proxy/ssl: cleanup per-request SSL configuration for recycled proxy conns.
The SSL dir config of proxy/backend connections is stored in r->per_dir_config
but those connections have a lifetime independent of the requests they handle.

So we need to allow the external ssl_engine_set() function to reset mod_ssl's
dir config in between proxy requests, or the first sslconn->dc could be used
after free for the next requests.

mod_proxy can then reset/reinit the request config when recycling its backend
connections.

PR 63256.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1855646 13f79535-47bb-0310-9956-ffa450edef68
2019-03-16 13:45:17 +00:00
Stefan Sperling
3ee1b624b8 Make proxy modules compile if APR_HAS_THREADS is not defined.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1852442 13f79535-47bb-0310-9956-ffa450edef68
2019-01-29 12:28:35 +00:00
Christophe Jaillet
43fe7164f6 If ProxyPassReverse is used for reverse mapping of relative redirects, subsequent ProxyPassReverse statements, whether they are relative or absolute, may fail.
PR 60408 [Peter Haworth <pmh1wheel gmail.com>]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837250 13f79535-47bb-0310-9956-ffa450edef68
2018-08-01 18:53:53 +00:00
Yann Ylavic
9559832595 mod_proxy_http: follow up to r1836588: avoid 100-continue responses from core.
When mod_proxy_http handles end-to-end "100 continue", it can't let
ap_http_filter() send its own interim response whenever the body is read.

So save/restore r->expecting_100 before/after handling the request, and use
req->expecting_100 internally (including to restore r->expecting appropriately).

While at it, add comments and debug logs about 100 continue handling, and
fill in missing APLOGNO()s from r1836588.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836648 13f79535-47bb-0310-9956-ffa450edef68
2018-07-25 16:33:44 +00:00
Ruediger Pluem
942e18adda * ap_proxy_balancer_get_best_worker cannot be exported and used as an optional
function at the same time. So rename ap_proxy_balancer_get_best_worker to
  proxy_balancer_get_best_worker and make it static which is then used as an
  optional function and recreate ap_proxy_balancer_get_best_worker as an
  exported thin wrapper of proxy_balancer_get_best_worker.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836603 13f79535-47bb-0310-9956-ffa450edef68
2018-07-25 06:22:53 +00:00
Ruediger Pluem
81e420cfb0 * mod_proxy: Remove load order and link dependency between mod_lbmethod_*
modules and mod_proxy by providing mod_proxy's ap_proxy_balancer_get_best_worker
  as an optional function.

PR: 62557


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836381 13f79535-47bb-0310-9956-ffa450edef68
2018-07-20 19:27:31 +00:00
Jim Jagielski
9121d9c800 Add default schema ports for websockets
PR:62480
Lubos Uhliarik <luhliari@redhat.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1834012 13f79535-47bb-0310-9956-ffa450edef68
2018-06-21 13:28:51 +00:00
Joe Orton
d91c0c0698 * modules/proxy/proxy_util.c (ap_proxy_share_worker): Skip creating subpool
for debugging unless debug-level logging is enabled.  No functional change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1832951 13f79535-47bb-0310-9956-ffa450edef68
2018-06-05 14:47:52 +00:00
Christophe Jaillet
5daf75b208 In 'ap_proxy_cookie_reverse_map', iterate over each token of the 'Set-Cookie' header field in order to avoid updating the wrong one.
This could happen if the header field has something like 'fakepath=foo;path=bar". In this case fakepath would be updated instead of path.


We don't need regex anymore in order to parse the field values and 'ap_proxy_strmatch_domain' and 'ap_proxy_strmatch_path' are now useless. (and should be axed IMHO)

PR 61560

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1832280 13f79535-47bb-0310-9956-ffa450edef68
2018-05-25 22:27:53 +00:00
Jim Riggs
55b4505765 mod_proxy_balancer: Add hot spare member type and corresponding flag (R). Hot spare members are
used as drop-in replacements for unusable workers in the same load balancer set. This differs
from hot standbys which are only used when all workers in a set are unusable. PR 61140.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828890 13f79535-47bb-0310-9956-ffa450edef68
2018-04-11 12:11:05 +00:00
Yann Ylavic
2077d6be0a Follow up to r1609680: further simplify/optimize ap_proxy_strcmp_ematch().
While at it, same treatment for its mother ap_strcmp_match().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1826313 13f79535-47bb-0310-9956-ffa450edef68
2018-03-09 09:36:18 +00:00
Yann Ylavic
17e80c8f32 Follow up to r1609680: simpler/faster ap_proxy_strcmp_ematch().
No functional change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1826289 13f79535-47bb-0310-9956-ffa450edef68
2018-03-08 23:23:30 +00:00
Graham Leggett
86c5536268 Set the notice when hostname is too long for legacy proxy modules to info level.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824482 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 13:52:47 +00:00
Graham Leggett
de63518c3b Tone down the message that worker hostname is too long noting it only
affects legacy modules not yet using hostname_ex.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824460 13f79535-47bb-0310-9956-ffa450edef68
2018-02-16 12:55:49 +00:00
Graham Leggett
fac7f995b0 mod_proxy: Provide an RFC1035 compliant version of the hostname in the
proxy_worker_shared structure. PR62085


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824176 13f79535-47bb-0310-9956-ffa450edef68
2018-02-13 21:22:05 +00:00
Jim Jagielski
a7c10a97f4 too-long worker schemes and/or hostnames are no longer fatal errors
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1823482 13f79535-47bb-0310-9956-ffa450edef68
2018-02-07 15:38:23 +00:00
Yann Ylavic
fb2317342b mod_proxy: follow up to r1822849 and r1822879.
Fix my maths, thanks Stefan and Rüdiger!



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822883 13f79535-47bb-0310-9956-ffa450edef68
2018-02-01 15:41:49 +00:00
Yann Ylavic
1a3e292e1d mod_proxy: follow up to r1822849 and r1822878.
Does r1822878's "static" APR_RETRIEVE_OPTIONAL_FN work if, say, mod_proxy is
builtin but mod_http2 isn't?

Not worth taking the risk here since it's not a fast path...

Note: if this is an issue, I'm afraid it applies elsewhere too.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822879 13f79535-47bb-0310-9956-ffa450edef68
2018-02-01 15:01:40 +00:00
Yann Ylavic
30dfcf3241 mod_proxy: follow up to r1822849.
Get the help(er) of mod_http2 to determine how much connections should
be handled in the reslist by default (i.e. max_threads).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822878 13f79535-47bb-0310-9956-ffa450edef68
2018-02-01 14:42:07 +00:00
Ruediger Pluem
ccbb6885b9 * Add some some comment why we do not limit hmax any longer
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822858 13f79535-47bb-0310-9956-ffa450edef68
2018-02-01 08:34:59 +00:00
Ruediger Pluem
0ea3db080a * When mod_http2 is loaded more then ThreadsPerChild backend connections can
be useful as mod_http2 has an additional thread pool on top of
  ThreadsPerChild.
  But leave the default with ThreadsPerChild.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822849 13f79535-47bb-0310-9956-ffa450edef68
2018-02-01 07:34:02 +00:00
Yann Ylavic
2baf370c0a mod_proxy: fix proxy connection cleanup from an n+2 pool.
When connection_destructor() is called after pchild is gone, we can't
dereference worker->cp anymore. This happens is debug/one_process mode only,
if we exit by calling apr_terminate() or clearing the process pool directly.

Fix this by NULL-ing worker->cp in conn_pool_cleanup(), and by registering it
as a pre_cleanup.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822531 13f79535-47bb-0310-9956-ffa450edef68
2018-01-29 16:41:03 +00:00
Yann Ylavic
56111a692a mod_proxy: allow SSLProxyCheckPeer* usage for all proxy modules.
PR 61857.

Proposed by: Markus Gausling <markusgausling googlemail.com>
Reviewed by: ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1818726 13f79535-47bb-0310-9956-ffa450edef68
2017-12-19 22:46:27 +00:00
Jim Jagielski
d248d8b2ff loadfactor now decimal
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805188 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 12:57:41 +00:00
Yann Ylavic
0674872c16 mod_proxy_{ajp,fcgi}: Fix a possible crash when reusing an established
backend connection, happening with LogLevel trace2 or higher configured,
or at any log level with compilers not detected as C99 compliant (e.g.
MSVC on Windows).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1775775 13f79535-47bb-0310-9956-ffa450edef68
2016-12-22 23:30:05 +00:00
Yann Ylavic
2c87430863 Follow up to r1750392: reduce AH03408 level to INFO as suggested by wrowe/jim.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756531 13f79535-47bb-0310-9956-ffa450edef68
2016-08-16 16:21:13 +00:00
Yann Ylavic
1bda0469cf [mod_proxy_]http: follow up to r1750392.
Export [ap_]check_pipeline() and use it also for ap_proxy_check_connection(),
so that all the necessary checks on the connection are done before reusing it.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756186 13f79535-47bb-0310-9956-ffa450edef68
2016-08-12 13:58:10 +00:00
Yann Ylavic
104ef73c95 Revert r1756064 and r1756060 until fixed (tests framework passes).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756065 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 23:37:45 +00:00
Yann Ylavic
2023d56eea [mod_proxy_]http: follow up to r1750392.
Export [ap_]check_pipeline() and use it also for ap_proxy_check_connection().

[Reverted by r1756065]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756060 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 22:32:42 +00:00
Rainer Jung
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
Yann Ylavic
5d0c0114fd mod_proxy: follow up to r1750392 and r1750474.
Restore PROXY_WORKER_IS_USABLE() check in ap_proxy_connect_backend(), we must
obviously (un)put backend in error state based on the result of the actual
connect(), and don't change it in ap_proxy_check_backend()...
APR_SUCCESS return by ap_proxy_check_backend(), i.e. a usable worker and an
established connection, is enough for modules to continue w/o calling
ap_proxy_connect_backend(), still.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750508 13f79535-47bb-0310-9956-ffa450edef68
2016-06-28 13:48:44 +00:00
Yann Ylavic
26faec4940 mod_proxy: follow up to r1750392.
Avoid double checking the connection in ap_proxy_connect_backend() when
ap_proxy_check_backend() says it is up and good to go.

This can be done by moving the PROXY_WORKER_IS_USABLE() check in
ap_proxy_check_backend(), since it is called by ap_proxy_connect_backend(),
and not calling the latter if the former succeeded (for the modules using it).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750474 13f79535-47bb-0310-9956-ffa450edef68
2016-06-28 11:19:36 +00:00
Yann Ylavic
b031a1ffed mod_proxy: we don't need ap_proxy_ssl_connection_cleanup() anymore with
ap_proxy_check_backend() used at connection reuse time, so remove its last call and deprecate it.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750416 13f79535-47bb-0310-9956-ffa450edef68
2016-06-27 21:49:15 +00:00
Yann Ylavic
bc73d63b45 mod_proxy: use proxy_conn_rec->tmp_bb where appopriate to avoid temporary
brigade create/destroy.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750412 13f79535-47bb-0310-9956-ffa450edef68
2016-06-27 21:39:53 +00:00
Yann Ylavic
d4aa6476b2 mod_proxy_{http,ajp,fcgi}}: don't reuse backend connections with data available
before the request is sent.  PR 57832.

ap_proxy_check_backend() can be used before ap_proxy_connect_backend() to try
to read available data (including from the filters), and is called by
ap_proxy_connect_backend() to check the socket state only (as before, still
relevant after ap_proxy_check_backend() due to filter data which may not have
triggered a real socket operation).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750392 13f79535-47bb-0310-9956-ffa450edef68
2016-06-27 17:26:12 +00:00
Yann Ylavic
4ddbed1baf mod_proxy: revert r1750301, r1750305 and r1750311.
Rework needed.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750376 13f79535-47bb-0310-9956-ffa450edef68
2016-06-27 16:06:42 +00:00
Yann Ylavic
808eb5ee2e mod_proxy: follow up to r1750301: APLOGNO().
[Reverted by r1750376]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750311 13f79535-47bb-0310-9956-ffa450edef68
2016-06-27 08:20:39 +00:00
Yann Ylavic
d353c8bfed mod_proxy: follow up to r1750301.
s/is_socket_connected/get_socket_connected/ in the !USE_ALTERNATE_IS_CONNECTED
case, and add CHANGE + MMN entries.

[Reverted by r1750376]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750305 13f79535-47bb-0310-9956-ffa450edef68
2016-06-27 08:08:26 +00:00
Yann Ylavic
d2e75e1d51 mod_proxy: don't reuse backend connections with data available before the
request is sent.  PR 57832.

[Reverted by r1750376]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750301 13f79535-47bb-0310-9956-ffa450edef68
2016-06-27 08:00:30 +00:00
Christophe Jaillet
4bc9cc0976 When ap_proxy_show_hcmethod has been backported in 2.4.x (r1744951) the function has not been placed at the same position in the code (see r1725306).
Move it at the same place in oder to synch 2.4.x and trunk.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747807 13f79535-47bb-0310-9956-ffa450edef68
2016-06-10 22:12:55 +00:00