Commit Graph

229 Commits

Author SHA1 Message Date
ed70569bf5 * modules/proxy/mod_proxy_balancer.c (balancer_handler): Check Referer
to improve on protection against balancer-manager XSRF attacks
  provided by the nonce.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1864695 13f79535-47bb-0310-9956-ffa450edef68
2019-08-08 12:11:36 +00:00
7f1e163de0 Follow up to r1847232.
There is no point to use "old" numbers in recent commit.

Also avoid number duplication. The messages are the same but in different code path, so having different numbers makes sense.
This also avoids a warning when running:
   make update-log-msg-tags

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1861333 13f79535-47bb-0310-9956-ffa450edef68
2019-06-14 11:46:18 +00:00
fa4eb1f879 Arrange balancer_handler() to be able to call
balancer_process_balancer_worker() to create/enable/disable
workers from another modules via a provider.
No functional changes in this first commit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1859235 13f79535-47bb-0310-9956-ffa450edef68
2019-05-14 15:26:08 +00:00
c66bef968e Fix some HTML syntax issues.
PR 63095 (Masahiro IMABAYASHI, <masahiro.imabayashi sony.com>)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1855614 13f79535-47bb-0310-9956-ffa450edef68
2019-03-15 20:38:45 +00:00
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
3552227669 Arrange the xml display and make it uses xml.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1847295 13f79535-47bb-0310-9956-ffa450edef68
2018-11-23 17:10:45 +00:00
9d74d0c874 fix incorrect rv. Sorry.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1847234 13f79535-47bb-0310-9956-ffa450edef68
2018-11-23 09:36:36 +00:00
e4b68ca5fc Add error messages and return bad request.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1847232 13f79535-47bb-0310-9956-ffa450edef68
2018-11-23 09:32:20 +00:00
2acd655200 * Always retrieve conditional function. static variable might contain garbage if module was reloaded in a static build.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836383 13f79535-47bb-0310-9956-ffa450edef68
2018-07-20 19:36:01 +00:00
33bd5995b0 mod_proxy_balancer: clear slotmem slots' inuse flags from persisted files.
Otherwise, when BalancerPersist is enabled, we might fail (re)starting with a
saved slotmem if a BalancerMember was renamed (e.g. PR 62308's port change).
This is because the renamed member is considered a new one, while the old name
still reserves a slot, so we end up missing one room. The overall number of
members does not change so the sizes check succeeds thus the persisted slotmem
is not invalidated. Yet the slomem is not really compatible.

By clearing inuse flags, we still allow for slots to be reused if their index
did not change (thanks to ap_proxy_find_balancershm() and slotmem_fgrab() at
the given index), but will also invalidate renamed slots which don't match the
index. We now have the correct behaviour by slot and the server (re)starts in
any case.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1831938 13f79535-47bb-0310-9956-ffa450edef68
2018-05-20 13:08:13 +00:00
76418da90b Revert r1831218, the API garantees slotmem_attach() is called in child_init().
r1831394 is the right follow to r1830800 to preserve "inherited" slotmems in
children processes.

While at it, comment on the expectations from mod_proxy_balancer w.r.t.
slotmem_attach() implementations, and eventually how we could improve the API
later (w/o backporting to 2.4.x).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1831396 13f79535-47bb-0310-9956-ffa450edef68
2018-05-11 09:44:38 +00:00
21cdbc9854 mod_proxy_balancer: follow up to r1830800.
Don't call slotmem_attach() if the slot is already initialized/reused, that
used to work previously because the returned error status is ignored, but
r1830800 changed the function to forcibly reset the returned slot pointer to
NULL first.

There is no point to call slotmem_attach() in this case, the slot is already
initialized because it's either inherited/fork()ed on Unixes, or on Windows
the attachment happened in post_config/slotmem_create() already.

One case where slotmem_attach() would fail is when balancers are defined
globally (main server) and some virtualhosts don't have/use any mod_proxy
configuration/directive. In this case their proxy server config is a pointer
copy of the main server thus their slots are already initialized in both
post_config and child_init hooks. While the case was already handled in
the balancer_post_config(), it did not in balancer_child_init() where we
relied on slotmem_attach() to be a noop.

[Reverted by r1831396]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1831218 13f79535-47bb-0310-9956-ffa450edef68
2018-05-09 01:23:59 +00:00
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
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
fad6cd0e46 mod_proxy_balancer: follow up tp r1822509.
Rework server_rec ID so that it doesn't change on restart (or stop/start)
unless it's Host(s)/IP(s):port(s), ServerName and/or ServerAlias(es) changed.

The goal being to reuse SHMs (and persisted files) names as much as possible,
with minimal bindings to configuration changes (as far as mod_proxy_balancer
is concerned). So if the ServerName and first Host/IP:port are unique we use
that first, otherwise the ServerAlias(es) and other Host(s)/IP(s):port(s) are
also taken into account, and finally if that's still not enough the server
index is also used (pathological case handled for correctness with regard to
the underlying mod_slotmem_shm's reuse code).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1823564 13f79535-47bb-0310-9956-ffa450edef68
2018-02-08 15:08:09 +00:00
37578399ef Revert r1822800 and r1822804.
All was already there, I just misread name vs sname :/



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822806 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 14:25:53 +00:00
7c2fce4a11 mod_proxy_balancer: follow up tp r1822509 and r1822800.
Actually we already have an (per vhost) unique id for the balancer, so use it.

[Reverted by r1822806]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822804 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 14:15:03 +00:00
bf336e8280 mod_proxy_balancer: follow up tp r1822509.
Use a unique balancer id per vhost for workers' slotmem too.

[Reverted by r1822806]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822800 13f79535-47bb-0310-9956-ffa450edef68
2018-01-31 13:55:53 +00:00
84cabd2d8e Revert r1813167 (per review).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1813255 13f79535-47bb-0310-9956-ffa450edef68
2017-10-25 07:23:34 +00:00
abea15ba12 mod_proxy_balancer: fix runtime lbfactor value changed in 2.4.28.
It is assumed to be between 1 and 100 by lbmethods, so normalize it
accordingly.

[Reverted by r1813255]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1813167 13f79535-47bb-0310-9956-ffa450edef68
2017-10-24 10:50:34 +00:00
8dc841ea11 Fix remaining lint from ms capability for hchecks.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805206 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 15:14:48 +00:00
737e70ca1f Umm. This is C :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805190 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 13:07:31 +00:00
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
7a9415519a OK... we display ms, since we want to be able to provide
values for <1sec, so entries should assume ms input when
using bal-mgr



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799485 13f79535-47bb-0310-9956-ffa450edef68
2017-06-21 16:29:54 +00:00
d1c3e06c4a allow balancer-manager to also accept subsecond intervals
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799482 13f79535-47bb-0310-9956-ffa450edef68
2017-06-21 16:24:00 +00:00
cc97ce3e52 https://bz.apache.org/bugzilla/show_bug.cgi?id=58855
Optimize check for empty strings


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1778067 13f79535-47bb-0310-9956-ffa450edef68
2017-01-09 22:08:01 +00:00
af9775ba47 * Prevent redirect loops between workers within a balancer by limiting the
number of redirects to the number balancer members.

PR: 59864


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1753594 13f79535-47bb-0310-9956-ffa450edef68
2016-07-20 18:32:14 +00:00
f4cc76ee71 Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747469 13f79535-47bb-0310-9956-ffa450edef68
2016-06-09 00:06:42 +00:00
e81d9afe33 Actually, do the nulling indepedent of whether it is being
set or not.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728209 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 20:49:23 +00:00
89058e7b74 If disabling health check (NONE) or using TCP method, then
the expression is moot and is nulled out

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728208 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 20:49:17 +00:00
ddc56a597b Now honor changed params!
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728203 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 20:28:13 +00:00
3d4399435e Now input-ize the values... next step is to tie into the
actual POST

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728166 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 18:04:46 +00:00
ee6d08cab1 Tie bal-man to hcheck for dynamic adjustments... right now,
actually editing not implemented yet.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728161 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 17:23:43 +00:00
d082119d56 Better naming
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728155 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 15:45:39 +00:00
a64b2be937 Only show if hcheck module is loaded
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728154 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 15:45:32 +00:00
62a5f9e552 Since these are externs, prepend proxy_
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728148 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 15:21:38 +00:00
ad328cbcf4 expose more worker status info in prep for making
more dynamically changable

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728142 13f79535-47bb-0310-9956-ffa450edef68
2016-02-02 14:56:30 +00:00
a107563a23 And make the list of health check conditions viewable via
the balancer manager :)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725609 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 20:48:33 +00:00
5ec89deb21 Expose the expr
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725608 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 20:48:24 +00:00
7cc83fe9ab Use worker status character defines taken
from mod_proxy.h instead of explicit characters.

Noted by rpluem.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725602 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 19:44:13 +00:00
52916ae253 Open up hook/scar to allow for passes/fails and
method to be changed via bal-man...

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725498 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 12:49:56 +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
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
96f716ff3a Adjust since we are now in shared mem area
Thx Werror: error: address of array 'balancer->s->sticky' will always evaluate to 'true'


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705776 13f79535-47bb-0310-9956-ffa450edef68
2015-09-28 21:04:45 +00:00
d1ad117a18 Revert r1696960 (see commit thread).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1698123 13f79535-47bb-0310-9956-ffa450edef68
2015-08-27 11:45:06 +00:00
1cd406d23e mod_proxy_balancer: Fix balancers and balancer members reuse on
restart when new ones are added.  PR 58024.

Since slotmem_create() issues a strict check on the size of an existing
slot before reusing it, it won't reuse existing balancers and members when
new ones are added during restart (whereas growth margins would allow it).
Fix this by using slotmem_attach() first and if it succeeds do the checks
based on the returned previous number of existing entries.

[Reverted by r1698123]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1696960 13f79535-47bb-0310-9956-ffa450edef68
2015-08-21 12:34:02 +00:00
83c5985cbb Fresheh html
BUGZ:55466

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1664356 13f79535-47bb-0310-9956-ffa450edef68
2015-03-05 14:35:34 +00:00