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
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
Yann Ylavic
da8a9b53dc Revert r1755930: actually what'd be read after AP_FCGI_END_REQUEST is padding,
not any potential/errorneous next response.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755931 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 10:40:49 +00:00
Yann Ylavic
190d808ea4 mod_{proxy,authnz}_fcgi: follow up to r1750392.
Don't try to read past AP_FCGI_END_REQUEST on the backend side, it would be
a response for the next request.

[Reverted by r1755931]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755930 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 10:32:35 +00:00
Luca Toscano
798c3f4efc Revert r1754732,r1754734,r1754736 after a conversation on dev@ and IRC.
We agreed to consider r1752347 as bug fix and delay performance improvements
for later revisions.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1754983 13f79535-47bb-0310-9956-ffa450edef68
2016-08-02 17:22:44 +00:00
Luca Toscano
ef144aed6f Changed the code comments to be more clear a fixed a typo (will be more careful next time, didn't spot the problem until already committed)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1754736 13f79535-47bb-0310-9956-ffa450edef68
2016-08-01 11:24:44 +00:00
Luca Toscano
b5c40d8adc Fixed a typo introduced by my previous commit, really sorry about it
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1754734 13f79535-47bb-0310-9956-ffa450edef68
2016-08-01 11:01:04 +00:00
Luca Toscano
1bfdcc8834 Skip message-body with HTTP 304 responses and mod_proxy_fcgi with no conn reuse.
Background: https://bz.apache.org/bugzilla/show_bug.cgi?id=59838

This commit should be an improvement for http://svn.apache.org/r1752347, in which
I tried to resolve a long standing issue with mod_proxy_fcgi: when a FCGI backend
returns a response that will become a HTTP 304, mod_proxy_fcgi forces a break
in the request processing ending up in reading the remaining bytes (for example
the message-body) and trying to intepret them as a FCGI header. This would cause
a error and a weird behavior:
1) HTTP 304 response flushed to the client correctly.
2) HTTP 503 logged in the access_log plus other bogus errors in the error_log.
I tried to separate the behavior when connection reuse is set or not, to eliminate
unnecessary latency in the latter case (which is the default).

I tested the change with and without connection reuse successfully, but feedback is
really welcome. If nobody will have anything against it I'll then proceed to update
my 2.4.x backport proposal.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1754732 13f79535-47bb-0310-9956-ffa450edef68
2016-08-01 10:55:03 +00:00
Luca Toscano
3655cf4b8d mod_proxy_fcgi: avoid loops serving proxied error documents
This commit should solve the issue indicated in PR 55415.
Httpd loops while serving a error document if:
1) The error document's content is proxied.
2) ProxyErrorOverride is set.
The solution proposed is to limit the use of ap_die only
to the initial request. I tested the change with very basic
scenarios but I am not sure if I got all the use cases,
feedback is really welcome.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1753167 13f79535-47bb-0310-9956-ffa450edef68
2016-07-18 08:02:23 +00:00
Luca Toscano
d3c4feb149 Force mod_proxy_fcgi to read the whole FCGI response
even when the content has not been modified (HTTP 304).

The problem is described in PR 59838. This patch should 
avoid bogus reads causing the following issues with
HTTP 304 responses:
- AH01068: Got bogus version X, expected 1
- AH01069: Got bogus rid X, expected 1
- AH01075: Error dispatching request to :
- HTTP 503 logged instead of 304 (even if the external 
  client gets correctly a 304)

As discussed on IRC the HTTP_PRECONDITION_FAILED use case
should be handled like the HTTP_NOT_MODIFIED one but it will
be done in a separate commit.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1752347 13f79535-47bb-0310-9956-ffa450edef68
2016-07-12 21:13:37 +00:00
Eric Covener
f18a7a4e9b PR59815: rewrite per-directory + fcgi broken in 2.4.23
remove the query string from r->filename before calculating environment
(SCRIPT_FILENAME) in mod_proxy_fcgi.  Before PR59618, php-fpm would
see proxy:fcgi:// and do some of this same stripping.





git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1751970 13f79535-47bb-0310-9956-ffa450edef68
2016-07-08 21:49:47 +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
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
Eric Covener
1b594119fd Strip proxy:fcgi:// just like proxy:balancer
Submitted By: Jacob Champion <champion.pxi gmail.com>
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747810 13f79535-47bb-0310-9956-ffa450edef68
2016-06-10 22:53:07 +00:00
William A. Rowe Jr
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
Christophe Jaillet
a3479f987f Avoid memory allocation before making sure that this handler can handle the URL
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1744458 13f79535-47bb-0310-9956-ffa450edef68
2016-05-18 21:41:02 +00:00
Christophe Jaillet
a5cd346481 Fix typo in comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726059 13f79535-47bb-0310-9956-ffa450edef68
2016-01-21 18:45:24 +00:00
Eric Covener
33a5f0556a *) mod_proxy_fcgi: Suppress HTTP error 503 and message 01075,
"Error dispatching request", when the cause appears to be 
     the client closing the connection. 

PR58118.  

Submitted By: Tobias Adolph <adolph lrz.de>
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1724857 13f79535-47bb-0310-9956-ffa450edef68
2016-01-15 16:49:36 +00:00
Yann Ylavic
6f8a850766 Follow up to r1715880: revert abusive ap_casecmpstr[n]() usages.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1716151 13f79535-47bb-0310-9956-ffa450edef68
2015-11-24 14:38:54 +00:00
Yann Ylavic
e30575b0b0 More ap_casecmpstr[n]() usages (follow up to r1715876).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715880 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:48:35 +00:00
Yann Ylavic
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
Yann Ylavic
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
Yann Ylavic
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
Yann Ylavic
b26841b8dc mod_proxy(es): Avoid error response/document handling by the core if some
input filter already did it while reading client's payload.

When an input filter returns AP_FILTER_ERROR, it has already called ap_die()
or at least already responded to the client.

Here we don't want to lose AP_FILTER_ERROR when returning from proxy handlers,
so we use ap_map_http_request_error() to forward any AP_FILTER_ERROR to
ap_die() which knows whether a response needs to be completed or not.

Before this commit, returning an HTTP error code in this case caused a double
response to be generated.

Depends on r1657881 to preserve r->status (for logging) when nothing is to be
done by ap_die() when handling AP_FILTER_ERROR.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1657897 13f79535-47bb-0310-9956-ffa450edef68
2015-02-06 16:54:16 +00:00
Eric Covener
a8afe6572f save some bytes per Christophe's review.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1650309 13f79535-47bb-0310-9956-ffa450edef68
2015-01-08 15:28:48 +00:00
Mike Rumph
98efe0ccb1 Fix some spelling errors in mod_proxy_fcgi comments.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1648557 13f79535-47bb-0310-9956-ffa450edef68
2014-12-30 17:43:59 +00:00
Eric Covener
d77e7a6885 provide alternative PATH_INFO calculation options for proxy_fcgi.
PR 55329



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1647035 13f79535-47bb-0310-9956-ffa450edef68
2014-12-20 18:45:23 +00:00
Eric Covener
2af6b8f57f Allow (a hokey) opt-in to connection reuse for mod_proxy_fcgi + TCP.
Connection reuse has been disabled since r1032345 at the end of
2011. 

Attempt to reverse the polarity of the connection reuse doc which
has been wrong for a long time.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1647005 13f79535-47bb-0310-9956-ffa450edef68
2014-12-20 15:38:27 +00:00
Eric Covener
727a07d553 tweak SCRIPT_FILENAME passed to fastcgi backends when a balancer is used.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1646724 13f79535-47bb-0310-9956-ffa450edef68
2014-12-19 14:03:52 +00:00
Jan Kaluža
ae9b5862f6 * mod_proxy_fcgi: Follow up to r1640495. Ignore body data from backend
for 304 responses also when read with the header.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1644031 13f79535-47bb-0310-9956-ffa450edef68
2014-12-09 11:39:57 +00:00
Eric Covener
3ec0da5912 dump fcgi headers with trace8 instead of debug+compile-time flag.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643672 13f79535-47bb-0310-9956-ffa450edef68
2014-12-07 12:54:52 +00:00
Jan Kaluža
a9831ff12f * mod_proxy_fcgi: Ignore body data from backend for 304 responses. PR 57198.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640495 13f79535-47bb-0310-9956-ffa450edef68
2014-11-19 07:19:13 +00:00
Yann Ylavic
f9520fec08 mod_proxy_fcgi, mod_authnz_fcgi: stop reading the response and issue an error
when parsing or forwarding the response fails.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640040 13f79535-47bb-0310-9956-ffa450edef68
2014-11-16 22:25:32 +00:00
Yann Ylavic
54f0797498 mod_proxy_fcgi: SECURITY: CVE-2014-3583 (cve.mitre.org)
Fix a potential crash with response headers' size above 8K.

The code changes to mod_authnz_fcgi keep the handle_headers()
function in sync between the two modules.  mod_authnz_fcgi
does not have this issue because it allocated a separate byte
for terminating '\0'.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640036 13f79535-47bb-0310-9956-ffa450edef68
2014-11-16 22:04:39 +00:00
Yann Ylavic
31e1a51f0f Revert r1638818, r1639812, r1639717 and r1639814 for new staging.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640034 13f79535-47bb-0310-9956-ffa450edef68
2014-11-16 21:52:40 +00:00
Yann Ylavic
e472402601 mod_proxy_fcgi: follow up to r1638818.
Let ap_scan_script_header*() validate the headers.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1639812 13f79535-47bb-0310-9956-ffa450edef68
2014-11-15 00:35:37 +00:00
Yann Ylavic
02e736ae5a mod_proxy_fcgi: CVE-2014-3583: Fix a potential crash with response headers'
size above 8K.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1638818 13f79535-47bb-0310-9956-ffa450edef68
2014-11-12 15:41:07 +00:00
Jeff Trawick
7e9b8a0b06 mod_proxy_fcgi: Fix faulty logging of large amounts of stderr from the
application.

PR: 56858
Submitted by: Manuel Mausz <manuel-asf mausz.at>
Reviewed by: trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1618401 13f79535-47bb-0310-9956-ffa450edef68
2014-08-16 19:15:02 +00:00
Christophe Jaillet
56d0c25725 Add missing APLOGNO.
Refactor some lines to keep APLOGNO on the same line as ap_log_error, when applicable.
Split lines longer than 80.
Improve alignment.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612068 13f79535-47bb-0310-9956-ffa450edef68
2014-07-20 09:32:58 +00:00
Yann Ylavic
aa5ca9770e mod_proxy_fcgi: follow up to r1592032.
Also break the outer loop when "sending stdin" fails.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1603122 13f79535-47bb-0310-9956-ffa450edef68
2014-06-17 10:37:15 +00:00
Jeff Trawick
e22212a41b Reindent after small fix in r1603027
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1603029 13f79535-47bb-0310-9956-ffa450edef68
2014-06-16 23:57:19 +00:00
Jeff Trawick
d6d845cfcd Fix bug introduced in r1591508 which resulted in the final empty
FCGI_STDIN not being sent.  Interaction with latest uWSGI (and
probably other protocol implementations) breaks without this.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1603027 13f79535-47bb-0310-9956-ffa450edef68
2014-06-16 23:56:06 +00:00
Jeff Trawick
a8b72c1517 mod_proxy_fcgi: Fix occasional high CPU when handling request bodies.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592037 13f79535-47bb-0310-9956-ffa450edef68
2014-05-02 20:46:28 +00:00
Jeff Trawick
31dab168f5 better diagnostics for failures during dispatch()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592032 13f79535-47bb-0310-9956-ffa450edef68
2014-05-02 20:33:57 +00:00
Jeff Trawick
5dac70c7aa mod_proxy_fcgi: Support iobuffersize parameter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591508 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 22:52:41 +00:00
Jeff Trawick
cc065dba44 Axe unnecessary memset() calls and allocating an extra
byte in an I/O buffer for '\0', which hasn't been needed
since a strstr("\r\n\r\n") was removed in r371428.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591472 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 20:21:03 +00:00
Jeff Trawick
eb9b6affd5 mod_proxy_fcgi: Don't segfault when failing to connect to the backend.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1590437 13f79535-47bb-0310-9956-ffa450edef68
2014-04-27 18:10:03 +00:00
Jeff Trawick
7775249b30 mod_proxy_fcgi: Fix sending of response without some HTTP headers
that might be set by filters.

The problem occurs when no body bytes were read while reading the
response headers, resulting in an empty brigade being sent down
the filter stack.  One particualr filter that mishandles the empty
initial brigade is mod_deflate.  It neglects to add to the response
header fields.

PR: 55558
Submitted by: Jim Riggs <jim riggs.me>
Reviewed by: trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1585824 13f79535-47bb-0310-9956-ffa450edef68
2014-04-08 20:07:04 +00:00
Jeff Trawick
304da56908 mod_proxy_fcgi: Fix error message when an unexpected protocol version
number is received from the application.

PR: 56110


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1564756 13f79535-47bb-0310-9956-ffa450edef68
2014-02-05 12:58:11 +00:00
Jim Jagielski
bb76893cfb We were not being consistent between http and others
if we added the default port or not during the canonizing
phase... Baseline the http method (don't add unless the
port provided isn't the default).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1542562 13f79535-47bb-0310-9956-ffa450edef68
2013-11-16 20:13:48 +00:00
Jeff Trawick
d79b9a03c5 mod_proxy: Add ap_connection_reusable() for checking if a connection
is reusable as of this point in processing.

mod_proxy_fcgi uses the new API to determine if FCGI_CONN_CLOSE
should be enabled, but that doesn't change existing behavior
since the connection is currently marked for closure elsewhere
in the module.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1526189 13f79535-47bb-0310-9956-ffa450edef68
2013-09-25 14:29:02 +00:00