1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

134 Commits

Author SHA1 Message Date
Yann Ylavic
c717758efb mod_proxy_fggi: Follow up to r1919547: Accurate dirwalk for proxy-fcgi-pathinfo=full
Use the proxied uri-path, and try to resolve the script's path first without
then with the DocumentRoot prefix.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1921238 13f79535-47bb-0310-9956-ffa450edef68
2024-10-10 15:42:49 +00:00
Yann Ylavic
b0d469a6d7 mod_proxy_fgci: Follow up to r1919628: Simplify.
Variable from_handler is used once so axe it.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1921237 13f79535-47bb-0310-9956-ffa450edef68
2024-10-10 15:36:48 +00:00
Yann Ylavic
f1eda2be4d Follow up to r1919620: Restore r->filename re-encoding for ProxyPass URLs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919628 13f79535-47bb-0310-9956-ffa450edef68
2024-08-02 00:53:53 +00:00
Yann Ylavic
ad7218959c Follow up to r1919620: init path after "proxy:" is skipped.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919623 13f79535-47bb-0310-9956-ffa450edef68
2024-08-01 16:09:14 +00:00
Yann Ylavic
13963ef367 mod_proxy_fcgi: Don't re-encode SCRIPT_FILENAME. PR 69203
Before r1918550 (r1918559 in 2.4.60), "SetHandler proxy:..." configurations
did not pass through proxy_fixup() hence the proxy_canon_handler hooks, leaving
fcgi's SCRIPT_FILENAME environment variable (from r->filename) decoded, or more
exactly not re-encoded.

We still want to call ap_proxy_canon_url() for "fcgi:" to handle/strip the UDS
"unix:" case and check that r->filename is valid and contains no controls, but
proxy_fcgi_canon() will not ap_proxy_canonenc_ex() thus re-encode anymore.

Note that this will do the same for "ProxyPass fcgi:...", there is no reason
that using SetHandler or ProxyPass don't result in the same thing. If an opt
in/out makes sense we should probably look at ProxyFCGIBackendType.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919620 13f79535-47bb-0310-9956-ffa450edef68
2024-08-01 14:43:58 +00:00
Yann Ylavic
25ef591ed6 mod_proxy_fcgi: Use r->uri rather than r->filename for directory walk.
r->filename is a "proxy:" one for mod_proxy modules, and ap_directory_walk()
can't cope with that, so force r->uri.

Github: closes #468



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919547 13f79535-47bb-0310-9956-ffa450edef68
2024-07-27 13:54:08 +00:00
Joe Orton
aa86530aec * modules/proxy/mod_proxy_fcgi.c (dispatch): Only allocate a heap
buffer if the configured size is greater than the stack-allocated
  buffer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1917576 13f79535-47bb-0310-9956-ffa450edef68
2024-05-08 12:44:52 +00:00
Eric Covener
61645eaac8 let httpd handle CL/TE for non-http handlers
Submitted By: ylavic, covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916769 13f79535-47bb-0310-9956-ffa450edef68
2024-04-03 11:49: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
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
Yann Ylavic
11758dc66a mod_proxy_fcgi: follow up to r1884068 and r1884069.
No mixed Transfer-Encoding and Content-Length possible.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884070 13f79535-47bb-0310-9956-ffa450edef68
2020-12-03 16:10:08 +00:00
Yann Ylavic
23edca6b4b mod_proxy_fcgi: follow up to r1884068.
Use the same heuristic as mod_proxy_http to determinine whether we need to
spool the request body.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884069 13f79535-47bb-0310-9956-ffa450edef68
2020-12-03 16:00:13 +00:00
Yann Ylavic
fa29f28624 mod_proxy_fcgi: Honor "SetEnv proxy-sendcl".
When proxy-sendcl is set, spool the request body to memory/disk so that a
Content-Length can be computed and provided to the backend.

If not set, still try to prefetch the body in non blocking mode, which allows
to handle small bodies (< 16K) the same way by default.

PR 57087.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884068 13f79535-47bb-0310-9956-ffa450edef68
2020-12-03 14:21:47 +00:00
Eric Covener
c03f75c6c3 lognos
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877830 13f79535-47bb-0310-9956-ffa450edef68
2020-05-16 18:30:15 +00:00
Eric Covener
5d51c6db9c PR 64365: proxy_fcgi doesn't check expression before unsetting var
Submitted By: Michael König <mail ikoenig.net>
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877829 13f79535-47bb-0310-9956-ffa450edef68
2020-05-16 18:28:50 +00:00
Yann Ylavic
f461bcf12c Add missing pool tags to help debugging.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876599 13f79535-47bb-0310-9956-ffa450edef68
2020-04-16 12:32:33 +00:00
Eric Covener
a545608f83 PR63628: individual status codes for ProxyErrorOverride.
Support specifying the http status codes to be considered by ProxyErrorOverride 

Submitted By: Martin Drößler <mail martindroessler.de>
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876404 13f79535-47bb-0310-9956-ffa450edef68
2020-04-11 21:19:08 +00:00
Luca Toscano
81dbaddc53 mod_proxy_fcgi: prioritize the check for mayflush when using flushpackets
The mayflush variable should be checked before the rest
to avoid polling when not needed.

Suggested by Yann Ylavic on the dev@ mailing list.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1823886 13f79535-47bb-0310-9956-ffa450edef68
2018-02-11 19:30:40 +00:00
Yann Ylavic
9c60ed2473 mod_proxy_fcgi: follow up to r1807876.
Fix mixed declarations and code [-Wdeclaration-after-statement].



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1808014 13f79535-47bb-0310-9956-ffa450edef68
2017-09-11 10:49:13 +00:00
Luca Toscano
449105a615 mod_proxy_fcgi: limit the flush buckets inserted when flushpackets=on|auto
This commit is a follow up of r1802040 based on Jacob's
feedback, namely inserting the FLUSH buckets only when
really needed and useful, not always.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1807876 13f79535-47bb-0310-9956-ffa450edef68
2017-09-09 10:24:19 +00:00
Christophe Jaillet
5a2cce3163 Fix a compilation warning introduced by r1802040.
mod_proxy_fcgi.c:893:19: warning: ‘flushpoll’ may be used uninitialized in this function [-Wmaybe-uninitialized]

This warning is a false positive.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805490 13f79535-47bb-0310-9956-ffa450edef68
2017-08-19 07:42:16 +00:00
Luca Toscano
aae1c23f32 mod_proxy_fcgi: Add the support for mod_proxy's
flushpackets and flushwait params

This change was requested on the development mailing
list in order to fill another gap between mod_fcgi
and mod_proxy_fcgi, namely the -flush funtionality.

The more evolved core trunk code would not need this
feature becuse of the non-blocking writes, but it
is be needed in 2.4.x.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1802040 13f79535-47bb-0310-9956-ffa450edef68
2017-07-16 08:40:46 +00:00
Jacob Champion
856b65e315 proxy_fcgi: remove FPM-specific logic
Reverts r1780328, r1780329, and their associated followups, which
incorrectly manipulated SCRIPT_NAME by default. All proxy_fcgi.t
regression tests now pass.

PR: 61202

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1800306 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 17:43:48 +00:00
Eric Covener
6d14ff6cac whitespace and match 2.4.x
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1797662 13f79535-47bb-0310-9956-ffa450edef68
2017-06-05 13:13:21 +00:00
Christophe Jaillet
800af53861 Remove a space to synch with 2.4.x.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1793314 13f79535-47bb-0310-9956-ffa450edef68
2017-05-01 11:58:37 +00:00
Eric Covener
3555d2d597 drop the longhand version
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1788040 13f79535-47bb-0310-9956-ffa450edef68
2017-03-22 00:00:30 +00:00
Yann Ylavic
b24e686f57 Follow up to r1780327 and r1780329: mute update-log-tags.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783767 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 14:08:27 +00:00
Jacob Champion
2c70ed7562 ProxyFCGISetEnvIf: reject invalid invocations, streamline unsets
Neither of the following makes sense:
- ProxyFCGISetEnvIf cond !VARIABLE value
- ProxyFCGISetEnvIf cond !

Error out in these cases. Also, don't execute the (unused) replacement
expression when unsetting.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782532 13f79535-47bb-0310-9956-ffa450edef68
2017-02-10 21:31:13 +00:00
Eric Covener
94167768e7 support unsetting vars
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782482 13f79535-47bb-0310-9956-ffa450edef68
2017-02-10 15:25:25 +00:00
Jacob Champion
457a723537 mod_proxy_fcgi: allow setting empty variables in ProxyFCGISetEnvIf
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782419 13f79535-47bb-0310-9956-ffa450edef68
2017-02-09 23:59:15 +00:00
Jacob Champion
e5aac6970e mod_proxy_fcgi: fix spelling in APLOG_INFO message
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782418 13f79535-47bb-0310-9956-ffa450edef68
2017-02-09 23:59:14 +00:00
Jim Jagielski
54cb64ca1b Allow final admin-level fine-tuning
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782323 13f79535-47bb-0310-9956-ffa450edef68
2017-02-09 12:58:35 +00:00
Jim Jagielski
7635969d8d Remove trailing whitespace : no functional change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782193 13f79535-47bb-0310-9956-ffa450edef68
2017-02-08 14:53:05 +00:00
Yann Ylavic
bcb2cebac8 Follow up to r1782164: fix typo (closing double-quote).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782166 13f79535-47bb-0310-9956-ffa450edef68
2017-02-08 13:33:13 +00:00
Jim Jagielski
2eef117666 Logging update
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782164 13f79535-47bb-0310-9956-ffa450edef68
2017-02-08 13:23:36 +00:00
Eric Covener
8c772d56ee add ProxyFCGISetEnvIf
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1781329 13f79535-47bb-0310-9956-ffa450edef68
2017-02-01 23:07:53 +00:00
Jim Jagielski
456d07fce5 debugging
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1780329 13f79535-47bb-0310-9956-ffa450edef68
2017-01-26 03:52:35 +00:00
Jim Jagielski
0b1a529705 Adjust as needed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1780328 13f79535-47bb-0310-9956-ffa450edef68
2017-01-26 03:52:34 +00:00
Jim Jagielski
232be9a3b1 debug
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1780327 13f79535-47bb-0310-9956-ffa450edef68
2017-01-26 03:52:31 +00:00
Christophe Jaillet
78d4351137 Follow-up to r1778350
Remove useless tests in order to avoid the duplication of a message.
Be consistent with "FPM" vs "PHP-FPM" usage messages.
Fix style issues.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1778500 13f79535-47bb-0310-9956-ffa450edef68
2017-01-13 07:22:29 +00:00
Eric Covener
728cb09d13 PR60576: php-fpm broken w/ per-dir rewrites
Attempt to dig out of well-meaning fixes for generic fcgi backends
that negatively affected some FPM configs.

Adds ProxyFCGIBackendType 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1778350 13f79535-47bb-0310-9956-ffa450edef68
2017-01-11 20:58:33 +00:00
Luca Toscano
ef6fbcf590 Return HTTP 504 rather than 503 when a proxy timeout is hit.
Part of the review for PR: 56188



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1775858 13f79535-47bb-0310-9956-ffa450edef68
2016-12-23 17:34:11 +00:00
Luca Toscano
333632287c Fix stupid mistake introduced in r1759984
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1760018 13f79535-47bb-0310-9956-ffa450edef68
2016-09-09 13:33:49 +00:00
Luca Toscano
5a53fac726 mod_proxy_fcgi: handle the HTTP 412 use case
This is a follow up of http://svn.apache.org/r1752347;
ap_meet_conditions could return a 412 status that if not
handled causes subsequent bogus reads and wrong messages
logged (like AH01070). After a chat on dev@ the feedback
was to couple HTTP_NOT_MODIFIED with HTTP_PRECONDITION_FAILED,
but any other feedback is welcome.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1759984 13f79535-47bb-0310-9956-ffa450edef68
2016-09-09 11:17:36 +00:00
Yann Ylavic
45d8216e5f mod_proxy_fcgi: revert r1756187.
rpluem: The default is disablereuse=off and the code you removed makes the
default disablereuse=on.

ylavic: so right..


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757097 13f79535-47bb-0310-9956-ffa450edef68
2016-08-21 23:53:24 +00:00
Yann Ylavic
ca4e35a740 mod_proxy_fcgi: forcing proxy_conn->close here is useless, same is done
either above in ap_proxy_determine_connection(), or below in
ap_proxy_release_connection().

[Reverted by r1757097]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756187 13f79535-47bb-0310-9956-ffa450edef68
2016-08-12 14:04:51 +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