Commit Graph

100 Commits

Author SHA1 Message Date
c6ecf742f2 Make sure that ajp behaves like http.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1807338 13f79535-47bb-0310-9956-ffa450edef68
2017-09-05 10:58:26 +00:00
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
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
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
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
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
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
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
b6f5963438 mod_proxy_ajp: Add "secret" parameter to proxy workers to implement legacy
AJP13 authentication.  PR 53098.

Proposed by: Dmitry A. Bakshaev <dab1818 gmail com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738878 13f79535-47bb-0310-9956-ffa450edef68
2016-04-12 23:09:07 +00:00
447582e5f4 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729507 13f79535-47bb-0310-9956-ffa450edef68
2016-02-09 23:38:59 +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
0b5aeb0f65 mod_proxy: follow up to r1681694.
Handle the proxy-error-override note also in mod_proxy_ajp.

The note is not needed in mod_proxy_fcgi (which also handles
ProxyErrorOverride) since it calls ap_die() by itself, and always
returns OK to proxy_handler().

Add a comment about the note where used.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1682907 13f79535-47bb-0310-9956-ffa450edef68
2015-06-01 14:06:39 +00:00
70a0b58c6b mod_proxy_ajp: Rename output_failed to client_failed in ap_proxy_ajp_request().
Since any read/write error is caught by this flag, it really means "dialog with
client <ip:port> failed" (as per the associated log message), whereas write to
client (output) errors need not be handled differently than any error occuring
after some bytes have already been sent to the client, which is the purpose of
the data_sent flag.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1674056 13f79535-47bb-0310-9956-ffa450edef68
2015-04-16 12:08:25 +00:00
0a431ef862 core, modules: like r1657897 but for core and other modules than mod_proxy.
More uses of ap_map_http_request_error() and AP_FILTER_ERROR so that we never
return an HTTP error status from a handler if some filter generated a response
already.

That is, from a handler, either ap_get_brigade() (an input filter) returned
AP_FILTER_ERROR and we must forward it to ap_die(), or ap_pass_brigade() (an
output filter) failed with any status and we must return AP_FILTER_ERROR in
any case for ap_die() to determine whether a response is needed or not.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1665625 13f79535-47bb-0310-9956-ffa450edef68
2015-03-10 17:25:17 +00:00
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
9f3e0671fd mod_proxy_ajp: Fix get_content_length().
clength in request_rec is for response sizes,
not request body size. It is initialized to 0,
so the "if" branch was never taken.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1649043 13f79535-47bb-0310-9956-ffa450edef68
2015-01-02 14:28:39 +00:00
04e5d83e7b mod_proxy_ajp: follow up to r1643537.
Log aborted client connections with level DEBUG only (no more noise than other proxy modules).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643543 13f79535-47bb-0310-9956-ffa450edef68
2014-12-06 15:36:19 +00:00
c4bea1a2b6 * mod_proxy_ajp: Fix client connection errors handling and logged status
when it occurs.  PR 56823.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1643537 13f79535-47bb-0310-9956-ffa450edef68
2014-12-06 14:33:52 +00:00
845a77beca Use 'apr_table_setn' instead of 'apr_table_set' when possible in order to save memory.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1578759 13f79535-47bb-0310-9956-ffa450edef68
2014-03-18 06:51:49 +00:00
7d473bfd8f mod_proxy_ajp: remove AJP_EBAD_METHOD, it is not used since r1435178
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560269 13f79535-47bb-0310-9956-ffa450edef68
2014-01-22 07:40:28 +00:00
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
6284650f6d ping tuning via Yann Ylavic <ylavic.dev@gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1530603 13f79535-47bb-0310-9956-ffa450edef68
2013-10-09 13:38:45 +00:00
619866c198 fill in missing message numbers in APLOGNO() invocations
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1524018 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 12:51:08 +00:00
058ebfc8c3 typo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1516965 13f79535-47bb-0310-9956-ffa450edef68
2013-08-23 18:18:51 +00:00
357828f9d2 Allow for a simple socket check in addition to the
higher level protocol-level checks for backends...

Not sure if it makes sense to do both or not... Comments?

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1516930 13f79535-47bb-0310-9956-ffa450edef68
2013-08-23 16:48:42 +00:00
d31632f33c Add failontimeout to allow server admin to mark balancer member in err if IO timeout occurs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1465839 13f79535-47bb-0310-9956-ffa450edef68
2013-04-09 00:18:42 +00:00
6dd8e07528 * 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.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1398307 13f79535-47bb-0310-9956-ffa450edef68
2012-10-15 14:38:04 +00:00
4cf751dbb9 Fix closing the back end connection in case of error.
The field "closed" was changed from an int to a bit
field of size one in 2.4.x.
For historical reasons a close instruction was coded
as an increment on the field, which in 2.4.x flips
the field each time. There were mutliple code paths
that would flip it several times for a single error,
so effectively the connection was no longer closed
in these cases.

Especially in the case of an aborted client connection
this lead to a non consumed back end buffer and thus to
response mixup between users.

PR 53727

CVE-2012-3052


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1373955 13f79535-47bb-0310-9956-ffa450edef68
2012-08-16 17:54:50 +00:00
f23a12fb76 Use short lived pool to avoid memory leaks
Remove the comment about binding upstream and downstream connections. It
seems to be obsolete since r104604, r104605, r105108.

Also avoid allocating memory if we are not handling the connection.

PR: 52275
Submitted by: Naohiro Ooiwa <naohiro ooiwa miraclelinux com>, Stefan Fritsch


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1334343 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 08:30:39 +00:00
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
b56ba5a823 More ap_log_rerror() usage and axe some more AJP: prefixes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1203878 13f79535-47bb-0310-9956-ffa450edef68
2011-11-18 22:02:27 +00:00
8ec7f5c5bf great proxy logging cleanup:
* remove "proxy:", "FCGI", etc. prefixes and pid which are now
    included in the error log format

  * propagate frontend request's logconfig to backend request
    
  * use ap_log_rerror where possible
    
  * remove obsolete APLOG_NOERRNO


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1203859 13f79535-47bb-0310-9956-ffa450edef68
2011-11-18 21:41:09 +00:00
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
17d779bff4 Use HTTP_NOT_IMPLEMENTED instead of HTTP_BAD_REQUEST.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1166657 13f79535-47bb-0310-9956-ffa450edef68
2011-09-08 12:41:30 +00:00
7fa4862380 AJP_EBAD_METHOD is also a bad request so return HTTP_BAD_REQUEST
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1166551 13f79535-47bb-0310-9956-ffa450edef68
2011-09-08 07:45:40 +00:00
c0ac7adb66 * Do not even sent an empty brigade down the filter chain if the headers
have not been sent by the AJP server so far. Even an empty brigade
  will trigger the headers filter to create the (in this case incomplete)
  HTTP headers of the response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1153531 13f79535-47bb-0310-9956-ffa450edef68
2011-08-03 15:07:29 +00:00
966df72b7c Improve logging for mod_proxy_ajp.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1152452 13f79535-47bb-0310-9956-ffa450edef68
2011-07-30 10:58:34 +00:00
73cf5b7f29 mod_proxy_ajp: Respect "reuse" flag in END_REPONSE
packets.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1152379 13f79535-47bb-0310-9956-ffa450edef68
2011-07-29 21:41:00 +00:00
7ae5a61329 replace recent AJP direct comparisons to APR_TIMEUP with APR_STATUS_IS_TIMEUP.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1100513 13f79535-47bb-0310-9956-ffa450edef68
2011-05-07 11:41:59 +00:00
e35a1a09d2 Fixed missing struct member error introduced with r1092076.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1092212 13f79535-47bb-0310-9956-ffa450edef68
2011-04-14 13:05:48 +00:00
6794d36d02 try to prevent a single long request marking a worker in error.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1092076 13f79535-47bb-0310-9956-ffa450edef68
2011-04-14 09:36:14 +00:00
b8d9a25867 *) mod_proxy_ajp: Add support for 'ProxyErrorOverride on'. PR 50945.
[Peter Pramberger <peter pramberger.at>, Jim Jagielski]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087864 13f79535-47bb-0310-9956-ffa450edef68
2011-04-01 19:25:26 +00:00
201bbd1ba9 More movement to shared stuff...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1058623 13f79535-47bb-0310-9956-ffa450edef68
2011-01-13 15:58:57 +00:00
5bccbb504f Don't log errors when we can't send to client, just debug.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986591 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18 08:31:36 +00:00
291d4c641c comment fixes for "send" vs. "sent"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@983056 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 17:04:40 +00:00
53c2b55947 * Ensure that we only return a non fatal error if the request is idempotent
and if we did not sent any request body so far.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@955966 13f79535-47bb-0310-9956-ffa450edef68
2010-06-18 12:22:13 +00:00
1541eb4e2d * Use APR_STATUS_IS_TIMEUP instead of direct compare to APR_TIMEUP to
be more safe on different platforms.

Pointed out by: rjung


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@953385 13f79535-47bb-0310-9956-ffa450edef68
2010-06-10 16:46:35 +00:00
01b9f2e551 - Be less verbose at levels INFO and DEBUG in mod_proxy* and mod_ssl
- Add some trace logging to core and http


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951900 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:07:12 +00:00