1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00

1761 Commits

Author SHA1 Message Date
Stefan Eissing
a0521d289a Merge of r1895981,r1895986 from trunk:
*) mod_proxy: Don't prevent forwarding URIs w/ no hostname.
                (fix for r1895955 already in 2.4.x)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1896044 13f79535-47bb-0310-9956-ffa450edef68
2021-12-16 11:23:49 +00:00
Yann Ylavic
a962ba7304 Merge r1895914, r1895921 from trunk:
*) http: Enforce that fully qualified uri-paths not to be forward-proxied
     have an http(s) scheme, and that the ones to be forward proxied have a
     hostname, per HTTP specifications.
     trunk patch: http://svn.apache.org/r1895914
                  http://svn.apache.org/r1895921
     2.4.x patch: https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/286.patch
     backport PR: https://github.com/apache/httpd/pull/286
     +1: ylavic, minfrin, gbechis


mod_proxy: Detect unix: scheme syntax errors at load time.

* modules/proxy/mod_proxy.c(add_pass, add_member, set_proxy_param,
                            proxysection):
  Check return value of ap_proxy_de_socketfy().

* modules/proxy/proxy_util.c(ap_proxy_get_worker_ex):
  Check return value of ap_proxy_de_socketfy().



http: Enforce that fully qualified uri-paths not to be forward-proxied
      have an http(s) scheme, and that the ones to be forward proxied have a
      hostname, per HTTP specifications.

The early checks avoid failing the request later on and thus save cycles
for those invalid cases.


Submitted by: ylavic
Reviewed by: ylavic, minfrin, gbechis
Closes #286


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895955 13f79535-47bb-0310-9956-ffa450edef68
2021-12-14 15:35:56 +00:00
Stefan Eissing
fbda64f2f3 Merge r1889494,r1892563,r1892917 from trunk:
- mod_proxy_balancer: add missing spaces in HTML output
     - mod_proxy_http: Avoid a double call to apr_table_get()
     - mod_ssl: Fix some typo and doxygen issues
     [Jean-Frederic Clere]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895943 13f79535-47bb-0310-9956-ffa450edef68
2021-12-14 09:58:22 +00:00
Graham Leggett
1a4d3c4676 Backport.
*) mod_proxy_connect, mod_proxy: Do not change the status code after we
     already sent it to the client.
     Trunk version of patch:
        https://svn.apache.org/r1895715
     Backport version for 2.4.x of patch:
       https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/283.diff
     Can be applied via apply_backport_pr.sh 283
     +1: rpluem, icing, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895903 13f79535-47bb-0310-9956-ffa450edef68
2021-12-13 15:46:50 +00:00
Graham Leggett
c28fdf37f8 Backport:
*) mod_proxy_connect: Honor the smallest of the backend or client timeout
     while tunneling, and handle "proxy-nohalfclose" as opt-out for hlaf-close
     tunneling. PR 65631, 65662, 65689.
     trunk patch: http://svn.apache.org/r1894290
                  http://svn.apache.org/r1895304
     backport PR: https://github.com/apache/httpd/pull/278
     2.4.x patch: https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/278.patch
     +1: ylavic, rpluem, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895762 13f79535-47bb-0310-9956-ffa450edef68
2021-12-10 13:23:51 +00:00
Stefan Eissing
8966e290a6 Merge of r1894074 from trunk:
*) mod_proxy_uwsgi: Remove duplicate slashes at the beginning of PATH_INFO.
     PR 65616.  [Ruediger Pluem]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1895097 13f79535-47bb-0310-9956-ffa450edef68
2021-11-17 08:42:35 +00:00
Stefan Eissing
81a8b0133b backport of 1893519,1893532 from trunk:
*) mod_proxy: Handle UDS URIs with empty hostname ("unix:///...") as if they
     had no hostname ("unix:/..."), also in mod_rewrite's is_absolulte_uri().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893559 13f79535-47bb-0310-9956-ffa450edef68
2021-09-23 12:31:53 +00:00
Stefan Eissing
f9c54948e4 Merge r1890605, r1893164, r1893179 from trunk:
*) core/mod_proxy/mod_ssl:
     Adding `outgoing` flag to conn_rec, indicating a connection is
     initiated by the server to somewhere, in contrast to incoming
     connections from clients.
     Adding 'ap_ssl_bind_outgoing()` function that marks a connection
     as outgoing and is used by mod_proxy instead of the previous
     optional function `ssl_engine_set`. This enables other SSL
     module to secure proxy connections.
     The optional functions `ssl_engine_set`, `ssl_engine_disable` and
     `ssl_proxy_enable` are now provided by the core to have backward
     compatibility with non-httpd modules that might use them. mod_ssl
     itself no longer registers these functions, but keeps them in its
     header for backward compatibility.
     The core provided optional function wrap any registered function
     like it was done for `ssl_is_ssl`.


  *core: clarify comments and use hook API better to check for presence of callbacks.



 * optimizing hook check as suggested by Yann.



Submitted by: icing
Reviewed by: 

Github: closes #203


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893182 13f79535-47bb-0310-9956-ffa450edef68
2021-09-09 15:22:23 +00:00
Yann Ylavic
4c1ed8e820 Merge r1893016 from trunk:
mod_proxy: Don't canonicalize with both nocanon and ProxyPassInterpolateEnv On.

If nocanon is set, we should match the unparsed_uri against the interpolated
alias (not the ProxyPass'ed one) when verifying the resulting length. Otherwise
we falsely restore the canonicalized URL in case of mismatch.  PR 65549.


Submitted by: Joel Self <joelself gmail.com>
Reviewed by: ylavic, covener, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893111 13f79535-47bb-0310-9956-ffa450edef68
2021-09-08 08:27:47 +00:00
Yann Ylavic
a67c610394 mod_proxy: Axe unused ap_filter_input_pending in 2.4.x (only) after r1892971.
Submitted by: ylavic
Reviewed by: ylavic, icing,  covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893107 13f79535-47bb-0310-9956-ffa450edef68
2021-09-08 08:21:22 +00:00
Ruediger Pluem
d4901cb321 Merge r1892986, r1892987 from trunk:
mod_proxy: Follow up to r1892814.

* modules/proxy/proxy_util.c(fix_uds_filename):
  Sanity checks on the configured UDS path, fail with 500 if invalid since
  continuing through proxy processing wouldn't work as expected.



mod_proxy: Follow up to r1892986: APLOGNO()

Stefan get out of this body! :)


Submitted by: ylavic
Reviewed by: rpluem, ylavic, covener

Github: closes #265


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893101 13f79535-47bb-0310-9956-ffa450edef68
2021-09-08 07:00:09 +00:00
Yann Ylavic
4ef2a7fcff Merge r1892740, r1892851 from trunk:
mod_proxy: Fix potential tunneling infinite loop and spurious timeout.
           PRs 65521 and 65519.

* modules/proxy/proxy_util.c(ap_proxy_tunnel_run):
  Avoid an infinite loop by shutting down the connection for write when poll()
  returns POLLHUP and read is already down.  PR 65521.

* modules/proxy/proxy_util.c(ap_proxy_tunnel_run):
  When write completion is finished don't check for ap_filter_input_pending()
  before proxy_tunnel_forward() to flush input data, this is a nonblocking read
  already which will do the same thing implicitely. ap_filter_input_pending()
  is broken in 2.4.x without the whole pending data mechanism (not backported
  yet), so let's align here.  PR 65519.


mod_proxy: Follow up to r1892740.

Really remove the old ap_filter_input_pending() handling forgotten by r1892740.


Submitted by: ylavic
Reviewed by: ylavic, covener, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892971 13f79535-47bb-0310-9956-ffa450edef68
2021-09-06 08:34:19 +00:00
Yann Ylavic
6d9672bf09 Merge r1892805 from trunk:
mod_proxy_uwsgi: Fix PATH_INFO setting for generic worker.

When the generic "proxy:reverse" worker is selected for an uwsgi scheme, the
worker name is irrelevant so uwscgi_handler() should point to the PATH_INFO
directly from the given URL.


Submitted by: ylavic
Reviewed by: ylavic, covener, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892875 13f79535-47bb-0310-9956-ffa450edef68
2021-09-03 17:00:07 +00:00
Yann Ylavic
496c863776 Merge r1892814, r1892853 from trunk:
mod_proxy: Faster unix socket path parsing in the "proxy:" URL.

The actual r->filename format is "[proxy:]unix:path|url" for UDS, no need to
strstr(,"unix:") since it's at the start of the string.


mod_proxy: Follow up to r1892814.

Save some few cycles in ap_proxy_de_socketfy() too.


Submitted by: ylavic
Reviewed by: ylavic, covener, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892874 13f79535-47bb-0310-9956-ffa450edef68
2021-09-03 16:52:38 +00:00
Yann Ylavic
be99f85dba Merge r1891206, r1891216, r1891284 from trunk:
mod_proxy: Fix possible reuse/merging of Proxy(Pass)Match workers.  PR 65419.

We can't truncate ProxyMatch's worker name/url to the first '$' substitution
without possibly colliding with other workers. This also makes the matching
done at runtime by ap_proxy_strcmp_ematch() completely pointless.

To fix this and still address r1878467 (i.e. make http://host:port$1 a "valid"
URL), we need to remove '$' substitutions from the :port part of the URL only
since it's allowed anywhere else by apr_uri_parse().

So let's strip them before apr_uri_parse() and prepend them back in the path
before apr_uri_unparse() to restore the original URL. Non-matchable workers are
not concerned so ap_proxy_define_worker() is made a local helper (w/o the ap_
prefix) which takes "matchable" as argument and can then be called by both
ap_proxy_define_[match_]worker() functions.


mod_proxy: Follow up to r1891206: fix UDS scheme.


mod_proxy: Avoid confusion of prefix/regex matching workers at loading.  PR 65429.

ap_proxy_get_worker() needs to know whether it should lookup for prefix or
match or both matching workers, depending on the context.

For instance <Proxy[Match]> or ProxyPass[Match] directives need to lookup for
an existing worker with the same type as the directive (*Match or not), because
they will define one with that matching type if none exists.

On the contrary, "ProxySet <url>" at load time or ap_proxy_pre_request() at run
time need to find a worker matching an url whether it's by prefix or by regex.

So this commit adds ap_proxy_get_worker_ex() which takes a bitmask for the
matching type and calls it appropriately where needed.

For consistency, ap_proxy_define_worker_ex() is also added, using the same
bitmask flags, deprecating ap_proxy_define_match_worker().

Follow up to r1891206.


Github: closes #261

Submitted by: ylavic
Reviewed by: ylavic, minfrin, icing


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892569 13f79535-47bb-0310-9956-ffa450edef68
2021-08-24 12:44:28 +00:00
Graham Leggett
21ee1a7dbf Backport:
*) back port the add of balancer_manage in mod_proxy_balancer.
     trunk patch: http://svn.apache.org/r1859235
                  http://svn.apache.org/r1887176
                  http://svn.apache.org/r1887359
                  http://svn.apache.org/r1887144
     Backport version for 2.4.x of patch:
          https://people.apache.org/~jfclere/patches/patch.210810.txt
     +1: jfclere, jim, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892522 13f79535-47bb-0310-9956-ffa450edef68
2021-08-22 09:51:33 +00:00
Stefan Eissing
e04c7b15ee *) mod_proxy: Fix icomplete initialization of BalancerMember(s) from the
balancer-manager, which can lead to a crash.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892165 13f79535-47bb-0310-9956-ffa450edef68
2021-08-10 08:32:35 +00:00
Stefan Eissing
6a5d3e006b Merged /httpd/httpd/trunk:r1879074-1879080,1879094-1879095,1879110-1879112,1879114,1879116-1879117,1879137,1879144-1879145,1879147,1879149,1879235,1879360
back port the mapping=servlet proxy logic.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892161 13f79535-47bb-0310-9956-ffa450edef68
2021-08-10 08:27:18 +00:00
Graham Leggett
f4af9fc212 *) back port: Add CPING to health check logic - remove hardcoded timeout.
Trunk version of patch:
        https://svn.apache.org/r1887439
     Backport version for 2.4.x of patch:
      Trunk version of patch works
      svn merge -c 1887439 ^/httpd/httpd/trunk .
     +1: minfrin, rpluem, covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1891276 13f79535-47bb-0310-9956-ffa450edef68
2021-07-05 09:01:27 +00:00
Graham Leggett
044b45e0da *) back port: Add CPING to health check logic.
Trunk version of patch:
        https://svn.apache.org/r1887415
   Backport version for 2.4.x of patch:
      Trunk version of patch works
      svn merge -c 1887415 ^/httpd/httpd/trunk .
   +1: jfclere, jim, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1890947 13f79535-47bb-0310-9956-ffa450edef68
2021-06-21 17:03:35 +00:00
Yann Ylavic
cb517a3b8a Merge r1889792, r1889795 from trunk:
mod_proxy_wstunnel: Add ProxyWebsocketFallbackToProxyHttp.

Allows to opt-out the fallback to mod_proxy_http to handle WebSocket upgrade,
and let mod_proxy_wstunnel handle the requests as in 2.4.46 and earlier.

Update docs.


Follow up to r1889792: CHANGES entry.


Submitted by: ylavic
Reviewed by: ylavic, covener, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1889902 13f79535-47bb-0310-9956-ffa450edef68
2021-05-14 19:18:52 +00:00
Yann Ylavic
01a8f46983 mod_proxy: Fix flushing of THRESHOLD_MIN_WRITE data while tunneling. BZ 65294
Submitted by: ylavic
Reviewed by: ylavic, covener, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1889901 13f79535-47bb-0310-9956-ffa450edef68
2021-05-14 19:15:11 +00:00
Stefan Eissing
c0cff48bcc Merge of [r1886840, r1887085, r1887087, r1887134, r1887151, r1887152,
r1887337, r1887340, r1887342, r1887343, r1887360, r1887364, 
       r1887923, r1887965, r1887993, r1888006, r1888083, r1888084,
       r1888723, r1888724, r1888726, r1888729, r1889788] from trunk:

   *) core/mod_ssl/mod_md:
     - adding new ap_ssl_*() functions for a backward
       compatible replacement of the major optional mod_ssl functions. This
       allows other ssl modules to work without impersonating mod_ssl and
       also allows different ssl modules being active on separate ports.
     - latest mod_md with support for multiple certificates per domain
       and ECDSA certificates. Removed ACMEv1 support.
     - Interworking mod_md and ssl modules changed to exchange PEM strings
       instead of file paths for ACME challenges.
     - core/mod_ssl/mod_md: adding OCSP response provisioning as core feature.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1889793 13f79535-47bb-0310-9956-ffa450edef68
2021-05-12 10:14:42 +00:00
Christophe Jaillet
8433a9b8c9 Merge r1730128, r1878140, r1878265, r1881736, r1882775, r1883872, r1884509, r1887720 from trunk
*) Easy patches: synch 2.4.x and trunk
         - doxygen: Correct doxygen groupname
         - .gdbinit: align columns
         - .gdbinit: fix indentation
         - mod_dav: Add specific logs for different modes
         - core: ap_pbase64encode(): save double NUL byte allocation and assignment
         - core: ap_pbase64decode(): save double NUL byte allocation and assignment
         - support: Fix a typo in a comment
         - proxy_util.c: Fix leak in error path in the do_malloc case

Submitted by: wrowe, ylavic, ylavic, jorton, rpluem, ylavic, jorton, jorton
Reviewed by: jailletc36, gbechis, ylavic
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1888929 13f79535-47bb-0310-9956-ffa450edef68
2021-04-18 19:40:13 +00:00
Christophe Jaillet
c0882d0209 Merge (most of) r1876599 from trunk
* Add missing pool tags to help debugging

Submitted by: ylavic
Reviewed by: jailletc36, gbechis, ylavic
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1888928 13f79535-47bb-0310-9956-ffa450edef68
2021-04-18 19:11:48 +00:00
Yann Ylavic
e7d7feb58b Merge r1875353 from trunk:
* modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response): Clear any
  possible returned buckets in the brigade in the error case. As we want to
  close the connection anyway there is no sensible content we could still
  sent and hence doing the needed life time transformation of the buckets
  would be a waste.

PR: 64234

Submitted by: rpluem
Reviewed by: ylavic, jorton, jfclere


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1887378 13f79535-47bb-0310-9956-ffa450edef68
2021-03-09 16:09:07 +00:00
Yann Ylavic
184a3aa8b7 Merge r1885691 from trunk:
mod_proxy_hcheck: don't pile up health checks.  PR 63010.

Prevent health checks from running for a worker until the last one is fully
finished, to avoid making things worse (memory growth, #connections, ..).

This is done by zeroing worker->s->updated before scheduling the worker in the
threadpool, and resetting the time when it's finished. The scheduler then does
nothing if worker->s->updated is zero.

Also, to save some apr_time_now() calls when !HC_USE_THREADS, *baton->now is
updated in the callback and reused by the scheduler.


Submitted by: ylavic
Reviewed by: ylavic, covener, icing


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1887119 13f79535-47bb-0310-9956-ffa450edef68
2021-03-02 20:51:55 +00:00
Yann Ylavic
9f7d27dadd Merge r1886141, r1886151 from trunk:
* We need to check for (!scheme && (u = strchr(url, ':')) && (u - url) > 14)
  later as (!scheme || u[0] != '/' || u[1] != '/' || u[2] == '\0') is true
  for requests with the CONNECT method which we need to decline. But in many
  cases requests with the CONNECT method have (u - url) > 14 as in this
  case (u - url) is the length of the FQDN the forward proxy should connect
  to.


mod_proxy_http: follow up to r1886141, axe overlong scheme check.

Since mod_proxy can see CONNECT URIs, "hostname:port" versus "scheme:"
is hardly distinguishable (we don't want to limit the length of hostnames),
and we don't allocate the scheme anymore while parsing, let's simply decline
unrecognized schemes (overlong or not) and be caught by the no-handler case
if there really is no proxy handler interested.


Submitted by: rpluem, ylavic
Reviewed by: ylavic, covener, icing


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1887118 13f79535-47bb-0310-9956-ffa450edef68
2021-03-02 20:50:40 +00:00
Ruediger Pluem
599310caf3 Merge r1398307, r1465839, r1530603, r1578759, r1729507 from trunk:
* If we face a timeout during receiving the response from the backend and if
  we pinged it successfully before don't assume the whole backend has failed.
  Assume that only the request has failed and return a gateway timeout then.



Add failontimeout to allow server admin to mark balancer member in err if IO timeout occurs.

ping tuning via Yann Ylavic <ylavic.dev@gmail.com>


Use 'apr_table_setn' instead of 'apr_table_set' when possible in order to save memory.

mod_proxy: axe negative "ping" parameter setting and handling.
This used to check for the backend connection readability only (instead of
the full ping/100-continue round-trip), but the case is already handled by
ap_proxy_connect_backend() which is always called.


Submitted by: rpluem, druggeri, jim, jailletc36, ylavic
Reviewed by: rpluem, ylavic, icing

Github: closes #170


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1887116 13f79535-47bb-0310-9956-ffa450edef68
2021-03-02 20:02:32 +00:00
Christophe Jaillet
5ace948f42 Merge most of r1747469 from trunk
* When ap_cstr_casecmp[n] have been introduced, in r1747469, it has 
         introduced many differences between 2.4.x and trunk.
         Direct backporting was not that easy because:
            - it was initialy introduced as ap_casecmpstr[n] with several patches
            - it touched some files that were not in 2.4.x branch
         Later, parts of it have already been backported.

         This patch tries to clean all this.

Submitted by: many people
Reviewed by: jailletc36, minfrin, ylavic
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885697 13f79535-47bb-0310-9956-ffa450edef68
2021-01-19 19:29:43 +00:00
Graham Leggett
af0f1c68ae Backport to v2.4:
*) Easy patches: synch 2.4.x and trunk
        - mod_dav: save a few cycles
        - mod_{ssl,md}: init_stapling_status hooks should return an int
        - util_md5: avoid temporary stack result in ap_md5_binary()
        - mod_proxy_balancer: Add a missing </tr>
        - mod_md: get_stapling_status hooks should return an int
        - mod_session: Improve a message about SessionExpiryUpdateInterval values
     trunk patch:
          http://svn.apache.org/r1837388
          http://svn.apache.org/r1876549
          http://svn.apache.org/r1877551
          http://svn.apache.org/r1882210
          http://svn.apache.org/r1882399
          http://svn.apache.org/r1883414
     2.4.x patch: svn merge -c 1837388,1876549,1877551,1882210,1882399,1883414 ^/httpd/httpd/trunk .
     +1: jailletc36, ylavic, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885610 13f79535-47bb-0310-9956-ffa450edef68
2021-01-17 17:07:42 +00:00
Graham Leggett
8d5648e4d7 Backport to 2.4:
*) mod_proxy: common spooling code to allow mod_proxy_fgci proxy-sendcl. BZ 57087
     trunk patch: https://svn.apache.org/r1884067
                  https://svn.apache.org/r1884068
                  https://svn.apache.org/r1884069
                  https://svn.apache.org/r1884070
     2.4.x patch: http://people.apache.org/~ylavic/patches/2.4.x-mod_proxy_fcgi-sendcl-5on5.patch
                  https://github.com/apache/httpd/pull/162
     +1: ylavic, covener, minfrin
     ylavic: Long standing BZ (always send Content-Length, according to the CGI
             specs) which is addressed by reusing mod_proxy_http's spooling
             code (moved to proxy_util) in mod_proxy_fcgi. The user still needs
             to SetEnv proxy-sendcl for that (2.4 compat).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885607 13f79535-47bb-0310-9956-ffa450edef68
2021-01-17 16:41:47 +00:00
Graham Leggett
fa22b50457 Backport to v2.4:
*) mod_proxy_http: handle upgrade/tunneling protocols. BZ 61616 is about
                     mod_proxy_connect but there has been wstunnel reports
                     on dev@ about that too lately.
     trunk patch: https://svn.apache.org/r1678771
                  https://svn.apache.org/r1832348
                  https://svn.apache.org/r1869338
                  https://svn.apache.org/r1869420
                  https://svn.apache.org/r1878367
                  https://svn.apache.org/r1877557
                  https://svn.apache.org/r1877558
                  https://svn.apache.org/r1877646
                  https://svn.apache.org/r1877695
                  https://svn.apache.org/r1879401
                  https://svn.apache.org/r1879402
                  https://svn.apache.org/r1880200
                  https://svn.apache.org/r1885239
                  https://svn.apache.org/r1885240
                  https://svn.apache.org/r1885244
     2.4.x patch: http://people.apache.org/~ylavic/patches/2.4.x-mod_proxy_http-upgrade-4on5-v2.patch
                  https://github.com/apache/httpd/pull/158
     +1: ylavic, covener, minfrin
     ylavic: All the corresponding trunk changes to mod_proxy_wstunnel (but
             r1885239) have been dropped for this backport proposal, the goal
             being to handle upgrade in mod_proxy_http from now, while r1885239
             allows to benefit from the Upgrade improvements done in proxy_http
             with existing wstunnel configurations (provided mod_proxy_http
             module is loaded).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885605 13f79535-47bb-0310-9956-ffa450edef68
2021-01-17 16:21:35 +00:00
Graham Leggett
41cdf59f23 Backport 2.4:
*) mod_proxy_http: individual status codes for ProxyErrorOverride. BZ 63628
     trunk patch: https://svn.apache.org/r1754974
                  https://svn.apache.org/r1754975
                  https://svn.apache.org/r1876404
                  https://svn.apache.org/r1877696
                  https://svn.apache.org/r1877697
                  https://svn.apache.org/r1877728
     2.4.x patch: http://people.apache.org/~ylavic/patches/2.4.x-mod_proxy_http-override-3on5.patch
                  https://github.com/apache/httpd/pull/157
     +1: ylavic, covener, minfrin
     ylavic: Besides ProxyErrorOverride individual status codes, merging now
             the non-functional changes in ap_proxy_http_process_response()
             around ProxyErrorOverride code helps reducing conflicts with the
             following commits, and with trunk/2.4 alignment still.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885575 13f79535-47bb-0310-9956-ffa450edef68
2021-01-16 14:22:41 +00:00
Graham Leggett
97597452bb Backport to 2.4:
*) mod_proxy_http: Fix 100-continue deadlock for spooled request bodies. BZ 63855.
     trunk patch: https://svn.apache.org/r1769760
                  https://svn.apache.org/r1770220
                  https://svn.apache.org/r1868576
                  https://svn.apache.org/r1868653
                  https://svn.apache.org/r1883639
                  https://svn.apache.org/r1883640
                  https://svn.apache.org/r1884218
                  https://svn.apache.org/r1884220
     2.4.x patch: http://people.apache.org/~ylavic/patches/2.4.x-bz63855-1on5.patch
                  https://github.com/apache/httpd/pull/154
     +1: ylavic, covener, minfrin



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885571 13f79535-47bb-0310-9956-ffa450edef68
2021-01-16 13:49:50 +00:00
Yann Ylavic
44dfe7d945 Merge r1883744 from trunk:
mod_proxy: pconf vs pchild consistency, and correctness in ONE_PROCESS mode.

Consistently use pconf for ap_proxy_define_{worker,balancer}() and pchild for
ap_proxu_initialize_{worker,balancer}() in mod_proxy [child_]init code.

pchild is needed in _initialize() for mutexes/shms' child_init and cleanup,
and to avoid a crash on shutdown (i.e. ap_terminate) in ONE_PROCESS mode,
where worker->cp->pool is destroyed twice, let's register conn_pool_cleanup()
as a pre_cleanup of pchild.

Submitted by: ylavic
Reviewed by: ylavic, jorton, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1885141 13f79535-47bb-0310-9956-ffa450edef68
2021-01-05 10:30:09 +00:00
Jim Jagielski
a834551b83 Merge r1776290, r1869399 from trunk:
let wstunnel run first

Since wstunnel can step aside based on the Upgrade: header.



mod_proxy: Add proxy check_trans hook.

This allows proxy modules to decline request handling at early stage.
Then mod_proxy_wstunnel can implement that hook to verify that an Upgrade
is requested, and otherwise hand over to mod_proxy_http.

Submitted by: covener, ylavic
Reviewed by: jim, rpluem, jfclere


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1883534 13f79535-47bb-0310-9956-ffa450edef68
2020-11-17 14:59:04 +00:00
Jim Jagielski
b203c575a3 Merge r1879878 from trunk:
Avoid NULL pointer dereferences for empty environment variable values
Submitted by: rpluem
Reviewed by: jailletc36, covener, gbechis, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1880773 13f79535-47bb-0310-9956-ffa450edef68
2020-08-11 12:09:44 +00:00
Jim Jagielski
17770c2660 Merge r1609680, r1609688, r1641381, r1826289, r1826313, r1878467, r1878994, r1879000, r1879001, r1879002, r1879361 from trunk:
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


mod_proxy: better check for worker->s->is_name_matchable


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.


Follow up to r1609680: simpler/faster ap_proxy_strcmp_ematch().

No functional change.


Follow up to r1609680: further simplify/optimize ap_proxy_strcmp_ematch().

While at it, same treatment for its mother ap_strcmp_match().


make sure the $n of the regular expressions is not included the name of the worker.
for example,  the example:
ProxyPassMatch "^(/.*\.gif)$" "http://backend.example.com:8000$1"
was giving:
AH00526: Syntax error on line nnn of bla/conf/httpd.conf:
ProxyPass Unable to parse URL: http://backend.example.com:8000$1



ap_proxy_define_match_worker: don't copy the url unnecessarily.

And save a few cycles, when the duplication is needed, by not copying
the ignored part.


ap_proxy_define_match_worker: disable connection reuse by default.

To avoid compat issues with dns/connection reuse now that a worker with
dollar substitution can be elected.


CHANGES entry for ap_proxy_define_match_worker().

Oups, axe spurious copypasta.

mod_proxy: unfail mixed ProxyPass/<Proxy> and ProxyPassMatch/<ProxyMatch>.

It is not a failure in current 2.4.x, so to ease backport and to avoid compat
breakage simply warn about the second directive being ignored.

This commit can be reverted in trunk if we want next versions to fail in this
case.


[Reverted by r1879363]

Submitted by: jkaluza, covener, ylavic, ylavic, jfclere, ylavic, ylavic, ylavic, ylavic, ylavic
Reviewed by: ylavic, minfrin (with an MMN bump), jim (agree w/ minfrin)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1880772 13f79535-47bb-0310-9956-ffa450edef68
2020-08-11 12:05:11 +00:00
Christophe Jaillet
e45f2c7cbb Backport r1877830 which is missing in r1879525
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1880438 13f79535-47bb-0310-9956-ffa450edef68
2020-07-30 10:04:47 +00:00
Yann Ylavic
0c543e3f5b Merge r1880205, r1880214 from trunk:
mod_proxy_uwsgi: Error out on HTTP header larger than 16K

The uwsgi protocol does not let us serialize more than 16K of HTTP header,
so fail early with 500 if it happens.


Follow up to r1880205, APLOGNO().


Submitted by: ylavic
Reviewed by: ylavic, covener, icing


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1880251 13f79535-47bb-0310-9956-ffa450edef68
2020-07-24 09:35:25 +00:00
Graham Leggett
3303dc4f72 *) strict content-length parsing
trunk patch http://svn.apache.org/r1877954
                 http://svn.apache.org/r1877955
                 http://svn.apache.org/r1879369
                 http://svn.apache.org/r1879373
     2.4.x patch: http://people.apache.org/~ylavic/patches/httpd-2.4.x-ap_parse_strict_length.patch
    +1: ylavic, minfrin, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1879639 13f79535-47bb-0310-9956-ffa450edef68
2020-07-08 11:09:13 +00:00
Graham Leggett
e5a20cf485 *) mod_proxy_fcgi: Don't unset when condition is false. PR64365
trunk patch:
        - http://svn.apache.org/r1877829
        - http://svn.apache.org/r1877830
     2.4.x patch: svn merge -c 1877829,1877830 ^/httpd/httpd/trunk .
    +1: covener, ylavic, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1879525 13f79535-47bb-0310-9956-ffa450edef68
2020-07-05 12:58:58 +00:00
Christophe Jaillet
7f1ce37f5f Merge r1612945, r1734835, r1738875, r1833416, r1842898, r1867257, r1876745, r1876807, r1876823, r1877642 from trunk
Easy patches: synch 2.4.x and trunk
        - core: Re-introduce check for sufficient PCRE version.
        - core: Fix doc string for QualifyRedirectURL
        - mod_proxy: really return an error message on invalid "flusher" value.
        - mod_http2: Remove extra and un-needed ""
        - mod_ldap: fix a (unlikely) memory leak 
        - ab: fix a typo
        - suexec: Report error string after failure from setgid/initgroups or setuid
        - mod_session_crypto: be less specific and don't echo passphrase
        - mod_proxy_html: Fix proxy_html_conf.bufsz to have correct type, as
                          it is used with ap_set_int_slot.
        - mod_md: update duplicated APLOGNOs.

Submitted by: fuankg, trawick, ylavic, jailletc36, jorton, jailletc36, jorton, covener, jorton, ylavic
Reviewed by: jailletc36, jim, ylavic
Backported by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1879490 13f79535-47bb-0310-9956-ffa450edef68
2020-07-03 19:53:37 +00:00
Yann Ylavic
ced24e032e Merge r1878280 from trunk:
mod_proxy_http: don't strip EOS when spooling request body to file.

To prevent stream_reqbody() from sending the FILE and FLUSH bucket in separate
brigades, and thus apr_file_setaside() to trigger if network congestion occurs
with the backend, restore the EOS in spool_reqbody_cl() which was stripped
when spooling the request body to a file.

Until APR r1878279 is released (and installed by users), apr_file_setaside()
on a temporary file (mktemp) will simply drop the file cleanup, leaking the
fd and inode..

This fixes BZ 64452.


Submitted by: ylavic
Reviewed by: ylavic, jorton, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1879226 13f79535-47bb-0310-9956-ffa450edef68
2020-06-26 10:21:19 +00:00
Jim Jagielski
ef3eacda96 Merge r1534995, r1560482, r1728779, r1805491, r1861528, r1868016, r1874470, r1874602, r1875769, r1875811 from trunk:
don't ignore some apr_procattr failures (clang scan-build)

doxygen improvements

Standardize order of "extern" and XXX_DECLARE_YYY.


Fix some compilation warning when MIME_MAGIC_DEBUG is defined.

warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument <n> has type ‘<something> *’ [-Wformat=]

style: cmd_rec at the bottom

no functional change


Fix a typo in a message.

Reported and fixed by Christian Bartolomäus (bartolin gmx.de)
PR 63806

malloc -> ap_malloc
bz #63967


Slighly simplify code.

No need to set to NULL or 0 fields that are apr_pcalloc'ed.
Axe 'set_cookie_enable' and use 'ap_set_flag_slot' instead.

(based on ideas taken from r1874389)

Parentheses around AP_BUCKET_IS_EOR argument.


Fix a typo
Submitted by: trawick, rjung, jailletc36, covener, jailletc36, gbechis, jailletc36, ylavic, jailletc36
Reviewed by: jailletc36, gbechis, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1876885 13f79535-47bb-0310-9956-ffa450edef68
2020-04-23 12:32:02 +00:00
Daniel Ruggeri
e624b4a0c1 *) mod_proxy_hcheck: Use is_ssl for wss and https.
trunk patch: http://svn.apache.org/r1875579
     2.4.x patch: svn merge -c 1875579 ^/httpd/httpd/trunk .
     +1: jfclere, gbechis, druggeri


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1875712 13f79535-47bb-0310-9956-ffa450edef68
2020-03-26 14:37:03 +00:00
Eric Covener
f7d35dc166 Merge r1869216, r1869224 from trunk:
mod_proxy_http: fix load-balancer fallback for requests with a body.

Since r1656259 (or r1656259 in 2.4.41) and the move of prefetch before connect,
the balancer fallback case where proxy_http_handler() is re-entered with the
next balancer member broke.

We need to save the body (partially) prefetched the first time and reuse it on
successive calls, otherwise we might forward partial or empty body.


mod_proxy_http: follow up to r1869216.

Let's call stream_reqbody() for all rb_methods, no RB_SPOOL_CL special case.

This both simplifies code and allows to keep EOS into the input_brigade until
it's sent, and thus detect whether we already fetched the whole body if/when
proxy_http_handler() re-enters for different balancer members.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1875111 13f79535-47bb-0310-9956-ffa450edef68
2020-03-12 02:03:17 +00:00
Jim Jagielski
c4127d496b Merge r1874616 from trunk:
PR64140: Allow %{Content-Type} in health check expressions

Submitted By: Renier Velazco <renier.velazco upr.edu>
Commited By: covener

Github: closes #97


Submitted by: covener
Reviewed by: covener, ylavic, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1874908 13f79535-47bb-0310-9956-ffa450edef68
2020-03-06 16:14:06 +00:00
Rainer Jung
d8b6d798c1 mod_proxy_ajp: Add "secret" parameter to proxy workers
to implement legacy AJP13 authentication.  PR 53098.
The attribute is now suggested/required by tomcat.

Backport of r1738878 from trunk.

Backported by: covener
Reviewed by: covener, jorton, rjung


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1874456 13f79535-47bb-0310-9956-ffa450edef68
2020-02-24 15:18:33 +00:00