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

73 Commits

Author SHA1 Message Date
Stefan Eissing
303ca68847 * mod_proxy_http2: revert r1912193 for detecting broken backend connections
as this interferes with backend selection who a node is unresponsive.
    PR69624.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924554 13f79535-47bb-0310-9956-ffa450edef68
2025-03-24 12:48:09 +00:00
Yann Ylavic
7672c68e4a mod_proxy_http2: ap_proxy_determine_connection()'s given &url is in/out.
* modules/http2/mod_proxy_http2.c(proxy_http2_handler):
  Restart from the original URL on reconnect.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918627 13f79535-47bb-0310-9956-ffa450edef68
2024-06-26 00:15:39 +00:00
Stefan Eissing
7c50a846c1 *) mod_proxy_http2: improved error handling on connection errors while
response is already underway.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911964 13f79535-47bb-0310-9956-ffa450edef68
2023-08-28 13:27:10 +00:00
Stefan Eissing
29f9ed1436 *) mod_http2: sync with github version
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911720 13f79535-47bb-0310-9956-ffa450edef68
2023-08-16 10:59:38 +00:00
Stefan Eissing
1c7a70c9d9 * mod_proxy_http2: fixed using the wrong "bucket_alloc" from the backend
connection when sending data on the frontend one. This caused crashes
   or infinite loops in rare situations.
 * mod_proxy_http2: fixed a bug in retry/response handling that could lead
   to wrong status codes or HTTP messages send at the end of response bodies
   exceeding the announced content-length.
 * mod_proxy_http2: fix retry handling to not leak temporary errors.
   On detecting that that an existing connection was shutdown by the other
   side, a 503 response leaked even though the request was retried on a
   fresh connection.
 * mod_http2: fixed a bug that did cleanup of consumed and pending buckets in
   the wrong order when a bucket_beam was destroyed.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910157 13f79535-47bb-0310-9956-ffa450edef68
2023-06-01 10:38:53 +00:00
Yann Ylavic
2eceb6a9fe mod_proxy: Check for space/ctrls in nocanon path/urls before forwarding.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908827 13f79535-47bb-0310-9956-ffa450edef68
2023-03-31 00:11:02 +00:00
Ruediger Pluem
6e75fe3b52 * Whitespace fixes. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908628 13f79535-47bb-0310-9956-ffa450edef68
2023-03-22 08:01:31 +00:00
Ruediger Pluem
2fa15c2c06 Do not double encode encoded slashes
In case that AllowEncodedSlashes is set to NoDecode do not double encode
encoded slashes in the URL sent by the reverse proxy to the backend.

* include/ap_mmn.h: Document the addition of ap_proxy_canonenc_ex to the API.

* modules/proxy/mod_proxy.h: Declare ap_proxy_canonenc_ex and define flag
      values.

* modules/proxy/proxy_util.c: Implement ap_proxy_canonenc_ex by modifying
      ap_proxy_canonenc accordingly and reimplement ap_proxy_canonenc to
      use ap_proxy_canonenc_ex with the appropriate flag.

* modules/http2/mod_proxy_http2.c, modules/proxy/mod_proxy_*.c: Set the
      correct flag based on the AllowEncodedSlashes configuration and use
      ap_proxy_canonenc_ex instead of ap_proxy_canonenc.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908341 13f79535-47bb-0310-9956-ffa450edef68
2023-03-13 10:24:30 +00:00
Yann Ylavic
542804c63b mod_proxy: Check the query-string for proxy-noencode too.
Follow up to r1907972 and r1908095.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908257 13f79535-47bb-0310-9956-ffa450edef68
2023-03-10 21:02:31 +00:00
Joe Orton
1061b64bb7 * modules/http2/mod_proxy_http2.c: Fix missing APLOGNO.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908116 13f79535-47bb-0310-9956-ffa450edef68
2023-03-06 09:24:44 +00:00
Eric Covener
d78a166fed don't forward invalid query strings
Submitted by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908095 13f79535-47bb-0310-9956-ffa450edef68
2023-03-05 20:27:11 +00:00
Yann Ylavic
52930446f6 mod_proxy: Don't decode r->uri and reencode in r->filename for mapping=encoded.
Decoding was not done for mapping=servlet only (a subset), but overlooked for
mapping=encoded. To avoid double-encoding in the canon_handler hook, use a new
"proxy-noencode" (similarly to "proxy-nocanon") entry in r->notes.

* proxy/mod_proxy.c(ap_proxy_trans_match):
  Set "proxy-noencode" in r->notes for PROXYPASS_MAP_ENCODED, and return DONE
  to avoid decoding in ap_process_request_internal().

* proxy/mod_proxy_http.c, proxy/mod_proxy_ajp.c, proxy/mod_proxy_wstunnel.c,
  proxy/mod_proxy_fcgi.c, proxy/mod_proxy_ajp.c, http2/mod_proxy_http2.c:
  Don't process the url through ap_proxy_canonenc() in canon_handler if
  "proxy-noencode" is set.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907972 13f79535-47bb-0310-9956-ffa450edef68
2023-03-02 14:30:20 +00:00
Stefan Eissing
61ebb22bf9 Sync with v2.0.10 from github:
* Extensive testing in production done by Alessandro Bianchi (@alexskynet)
   on the v2.0.x versions for stability. Many thanks!
 * refactored stream response handling to reflect the different phases
   (response/data/trailers) more clearly and help resolving cpu busy loops.
 * Adding more negative tests for handling of errored responses to cover
   edge cases.
 * mod_http2: fixed handling of response where neiter an EOS nor an ERROR was
   received as a cause to reset the stream.
 * mod_proxy_http2: generating error buckets for fault response bodies, to
   signal failure to fron when response header were already sent.

v2.0.9
--------------------------------------------------------------------------------
 * Fixed a bug where errors during reponse body handling did not lead to
   a proper RST_STREAM. Instead processing went into an infinite loop.
   Extended test cases to catch this condition.

v2.0.8
--------------------------------------------------------------------------------
 * Delaying input setup of a stream just before processing starts. This allows
   any EOS indicator arriving from the client before that to take effect.
   Without knowing that a stream has no input, internal processing has to
   simulate chunked encoding. This is not wrong, but somewhat more expensive
   and mod_security has been reported to be allergic to seeing 'chunked'
   on some requests. See <https://bz.apache.org/bugzilla/show_bug.cgi?id=66282>.
 * mod_proxy_http2: fixed #235 by no longer forwarding 'Host:' header when
   request ':authority' is known. Improved test case that did not catch that
   the previous 'fix' was incorrect.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904522 13f79535-47bb-0310-9956-ffa450edef68
2022-10-11 14:54:08 +00:00
Stefan Eissing
6a355db082 *) mod_http2:
- Fixed an issue since 1.15.24 that "Server" headers in proxied requests
       were overwritten instead of preserved. [PR by @daum3ns]
     - Added directove 'H2StreamTimeout' to configure a separate value for HTTP/2
       streams, overriding server's 'Timeout' configuration. [rpluem]
     - HTTP/2 connections now use pollsets to monitor the status of the
       ongoing streams and their main connection when host OS allows this.
     - Removed work-arounds for older versions of libnghttp2 and checking
       during configure that at least version 1.15.0 is present.
     - The HTTP/2 connection state handler, based on an experiment and draft
       at the IETF http working group (abandoned for some time), has been removed.
     - H2SerializeHeaders no longer has an effect. A warning is logged when it is
       set to "on". The switch enabled the internal writing of requests to be parsed
       by the internal HTTP/1.1 protocol handler and was introduced to avoid
       potential incompatibilities during the introduction of HTTP/2.
     - Removed the abort/redo of tasks when mood swings lower the active limit.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894163 13f79535-47bb-0310-9956-ffa450edef68
2021-10-12 13:34:01 +00:00
Stefan Eissing
2d34278612 *) mod_http2:
- Aborting requests via RST_STREAM no longer affect the available
     resources of a connection when the first chunk of the response
     body has been sent.
   - H2Min/MaxWorkers behave as intended again. The module will initially
     create H2MinWorkers threads and add up to H2MaxWorkers when needed. These
     additional workers time out when idle after H2MaxWorkerIdleSeconds and
     disappear again.
   - When the shutdown of a child is detected (e.g. graceful shutdown), the
     module will terminate all idle workers above H2MinWorkers right away.
     This detection currently only happens when a HTTP/2 connection is active.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891312 13f79535-47bb-0310-9956-ffa450edef68
2021-07-06 13:06:00 +00:00
Christophe Jaillet
fcce6c5745 Axe 'flushall' from 'mod_proxy_http2.c'.
It is only set and never used.

This makes trunk and 2.4.x more in line.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1878056 13f79535-47bb-0310-9956-ffa450edef68
2020-05-23 11:54:10 +00:00
Stefan Eissing
1f4ec799b1 *) mod_http2: Fixed rare cases where a h2 worker could deadlock the main connection.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1871810 13f79535-47bb-0310-9956-ffa450edef68
2019-12-19 09:39:22 +00:00
Stefan Eissing
5b32f27b77 * modules/http2: reverting r1859724, as no good.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1860257 13f79535-47bb-0310-9956-ffa450edef68
2019-05-28 12:42:17 +00:00
Stefan Eissing
d5767ac605 *) mod_http2: internal code cleanups and simplifications. Common output code for
h2 and h2c protocols, using nested mutex locks for simplified calls. [Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1859724 13f79535-47bb-0310-9956-ffa450edef68
2019-05-22 13:41:36 +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
Ruediger Pluem
ae106ef0d1 * Only do one retry to be more in line with the other modules.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1859213 13f79535-47bb-0310-9956-ffa450edef68
2019-05-14 08:07:23 +00:00
Stefan Eissing
9b3dd74c58 *) mod_http2: new configuration directive: ``H2Padding numbits`` to control
padding of HTTP/2 payload frames. 'numbits' is a number from 0-8,
     controlling the range of padding bytes added to a frame. The actual number
     added is chosen randomly per frame. This applies to HEADERS, DATA and PUSH_PROMISE
     frames equally. The default continues to be 0, e.g. no padding. [Stefan Eissing] 
  
  *) mod_http2: ripping out all the h2_req_engine internal features now that mod_proxy_http2
     has no more need for it. Optional functions are still declared but no longer implemented.
     While previous mod_proxy_http2 will work with this, it is recommeneded to run the matching
     versions of both modules. [Stefan Eissing]
  
  *) mod_proxy_http2: changed mod_proxy_http2 implementation and fixed several bugs which
     resolve PR63170. The proxy module does now a single h2 request on the (reused)
     connection and returns. [Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1854963 13f79535-47bb-0310-9956-ffa450edef68
2019-03-07 09:41:15 +00:00
Stefan Eissing
4ac456c656 *) mod_http2/mod_proxy_http2: proxy_http2 checks correct master connection aborted status
to trigger immediate shutdown of backend connections. This is now always signalled
     by mod_http2 when the the session is being released. 
     proxy_http2 now only sends a PING frame to the backend when there is not already one
     in flight. [Stefan Eissing]

  *) mod_proxy_http2: fixed an issue where a proxy_http2 handler entered an infinite 
     loop when encountering certain errors on the backend connection. 
     See <https://bz.apache.org/bugzilla/show_bug.cgi?id=63170>. [Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1854365 13f79535-47bb-0310-9956-ffa450edef68
2019-02-26 09:55:44 +00:00
Yann Ylavic
01d8e196dc mod_proxy_http: rework the flushing strategy when forwarding the request body.
Since the forwarding of 100-continue (end to end) in r1836588, we depended on
reading all of the requested HUGE_STRING_LEN bytes to avoid the flushes, but
this is a bit fragile.

This commit introduces the new stream_reqbody_read() function which will try a
nonblocking read first and, if it fails with EAGAIN, will flush on the backend
side before blocking for the next client side read.

We can then use it in stream_reqbody_{chunked,cl}() to flush client forwarded
data only when necessary. This both allows "optimal" flushing and simplifies
code (note that spool_reqbody_cl() also makes use of the new function but not
its nonblocking/flush functionality, thus only for consistency with the two
others, simplification and common error handling).

Also, since proxy_http_req_t::flushall/subprocess_env::proxy-flushall are now
meaningless (and unused) on the backend side, they are renamed respectively to
prefetch_nonblocking/proxy-prefetch-nonblocking, and solely determine whether
to prefetch in nonblocking mode or not. These flags were trunk only and may
not be really useful if we decided to prefetch in nonblocking mode in any case,
but for 2.4.x the opt-in looks wise.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1853407 13f79535-47bb-0310-9956-ffa450edef68
2019-02-11 21:55:43 +00:00
Stefan Eissing
a721d5cc9e *) mod_http2: Configuration directoves H2Push and H2Upgrade can now be specified per
Location/Directory, e.g. disabling PUSH for a specific set of resources. [Stefan Eissing]

  *) mod_http2: HEAD requests to some module such as mod_cgid caused the stream to
     terminate improperly and cause a HTTP/2 PROTOCOL_ERROR. 
     Fixes <https://github.com/icing/mod_h2/issues/167>. [Michael Kaufmann]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1852339 13f79535-47bb-0310-9956-ffa450edef68
2019-01-28 10:27:08 +00:00
Stefan Eissing
a28d3fdf63 mod_http2: mergine trunk+2.4.x code divergences back into a single source with proper MMN checks.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1849296 13f79535-47bb-0310-9956-ffa450edef68
2018-12-19 12:57:05 +00:00
Stefan Eissing
4f9b578980 mod_http2/mod_proxy_http2: add new module flags
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822503 13f79535-47bb-0310-9956-ffa450edef68
2018-01-29 13:10:22 +00:00
Stefan Eissing
eb0fb1c922 On the trunk:
mod_http2: removing comments that documented that greenbytes has untransferable copyright to the sources. The rights, of course, remain unaffected, but maybe some people can sleep better.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1821371 13f79535-47bb-0310-9956-ffa450edef68
2018-01-17 14:41:30 +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
1aa89da70c correct copyright/license headers
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1818306 13f79535-47bb-0310-9956-ffa450edef68
2017-12-15 17:10:14 +00:00
Stefan Eissing
e643f77747 On the trunk:
mod_proxy_http2: 1 is true.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1790827 13f79535-47bb-0310-9956-ffa450edef68
2017-04-10 13:23:03 +00:00
Stefan Eissing
8895bd2f8c On the trunk:
mod_proxy_http2: Reliability of reconnect handling improved.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1790826 13f79535-47bb-0310-9956-ffa450edef68
2017-04-10 13:21:43 +00:00
Stefan Eissing
3076d44593 On the trunk:
mod_http2/mod_proxy_http2: less read attempts on bucket beams that already
     delivered EOS/headers. Fixed bug in re-attempting proxy request after 
     connection error.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1790102 13f79535-47bb-0310-9956-ffa450edef68
2017-04-04 12:39:22 +00:00
Stefan Eissing
eebe5fa1c0 On the trunk:
mod_proxy_http2: fixed retry behaviour when frontend connection uses 
     http/1.1. 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1785672 13f79535-47bb-0310-9956-ffa450edef68
2017-03-06 15:45:05 +00:00
Stefan Eissing
757e5a0ad6 On the trunk:
mod_proxy_http2: support for ProxyPreserverHost directive.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783693 13f79535-47bb-0310-9956-ffa450edef68
2017-02-19 21:02:26 +00:00
Stefan Eissing
b1f6b6edd2 mod_proxy_http2: not forwarding any 1xx responses on frontend HTTP/1.x connections. Unless its 100 and the client is expecting that.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1770998 13f79535-47bb-0310-9956-ffa450edef68
2016-11-23 16:14:06 +00:00
Stefan Eissing
29d1681025 mod_http2: proper parsing and forwarding of multiple or unnaounce 1xx responses
mod_proxy_http2: improved robustness when main connection gets aborted


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1767553 13f79535-47bb-0310-9956-ffa450edef68
2016-11-01 19:40:37 +00:00
Stefan Eissing
fc770710e1 mod_http2/mod_proxy_http2: proper 100-continue handling up to backend, more robustness on connection reuse with PING frames
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1765318 13f79535-47bb-0310-9956-ffa450edef68
2016-10-17 15:52:01 +00:00
Stefan Eissing
8770d40be1 mod_proxy_http2: renaming duplicate symbol clash between h2_proxy_util and h2_util externals
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1764236 13f79535-47bb-0310-9956-ffa450edef68
2016-10-11 13:34:13 +00:00
Stefan Eissing
0da36a75f8 mod_http2: reverting int->apr_uint32_t changes of v1.7.x
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1764005 13f79535-47bb-0310-9956-ffa450edef68
2016-10-09 20:22:40 +00:00
Yann Ylavic
c1bf57bc29 mod_proxy_http2: don't use ap_proxy_ssl_connection_cleanup(), there may be
data available on the backend connection before we reuse it (e.g. PING or SETTINGS change).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750414 13f79535-47bb-0310-9956-ffa450edef68
2016-06-27 21:45:45 +00:00
Stefan Eissing
9444fc4cfa mod_proxy_http2: fixed retry behaviour when proxy engine needs to retry its base request on a new connection
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1749676 13f79535-47bb-0310-9956-ffa450edef68
2016-06-22 12:57:40 +00:00
Stefan Eissing
9aa3dd7bb8 mod_proxy_http2: fix flow control when frontend connection is HTTP/1.1, patch by Evgeny Kotkov
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747735 13f79535-47bb-0310-9956-ffa450edef68
2016-06-10 15:27:34 +00:00
Stefan Eissing
fb0a918862 mod_proxy_http2: own h2_proxy_util.c source file to avoid duplicate use of h2_util.c, updated dsp and cmake as well as configure files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747550 13f79535-47bb-0310-9956-ffa450edef68
2016-06-09 14:03:07 +00:00
William A. Rowe Jr
03fdf196c9 The answer to the question appears to be in 2.4.21, drop h2_casecmpstr fork
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747470 13f79535-47bb-0310-9956-ffa450edef68
2016-06-09 00:19:24 +00:00
Stefan Eissing
6804fad5e7 fix for handling invalid proxy uris and code cleanup provided by Evgeny Kotkov
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1743517 13f79535-47bb-0310-9956-ffa450edef68
2016-05-12 15:12:59 +00:00
Stefan Eissing
9a514360b0 mod_http2: fix for partial file buckets in master connection output, flushing of output revisited, uplift of some 2.4.x compat changes on slave filters
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1742260 13f79535-47bb-0310-9956-ffa450edef68
2016-05-04 12:32:05 +00:00
Stefan Eissing
824121f7f9 mod_http2/mod_proxy_http2: no longer reusing h2_request.o for proxy module
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1741596 13f79535-47bb-0310-9956-ffa450edef68
2016-04-29 09:35:18 +00:00
Yann Ylavic
f9ad2754f7 mod_proxy, mod_ssl: Handle SSLProxy* directives in <Proxy> sections,
allowing per backend TLS configuration.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1740928 13f79535-47bb-0310-9956-ffa450edef68
2016-04-26 00:04:57 +00:00
Stefan Eissing
afd1183937 mod_http2: elimination of h2_io intermediate stream instances
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1740155 13f79535-47bb-0310-9956-ffa450edef68
2016-04-20 15:17:38 +00:00