1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

143 Commits

Author SHA1 Message Date
Ruediger Pluem
80aafcc1fc * Do not close the backend connection, because the client sent a
Connection: close header.

PR: 38524


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@377057 13f79535-47bb-0310-9956-ffa450edef68
2006-02-11 21:15:12 +00:00
Ruediger Pluem
859a572ba2 * Do not remove the connection headers from r->headers_in. They are needed
by the http output filter to create the correct connection response headers.
  Instead work on a copy of r->headers_in.

PR: 38524


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@377053 13f79535-47bb-0310-9956-ffa450edef68
2006-02-11 20:57:12 +00:00
Ruediger Pluem
6b17fc2596 * Call ap_proxy_http_cleanup after ap_log_rerror because it resets
backend->hostname to NULL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@366279 13f79535-47bb-0310-9956-ffa450edef68
2006-01-05 21:02:36 +00:00
Ruediger Pluem
30d205d8a9 * Correctly signal broken backend connections up the chain also for the ajp
backend (see also r357461). Furthermore move common code in mod_proxy_http.c
  and mod_proxy_ajp.c into a new function (ap_proxy_backend_broke) in
  proxy_util.c.

  modules/proxy/mod_proxy_ajp.c : Signal broken backend connection for ajp backend
  modules/proxy/proxy_util.c    : Add ap_proxy_backend_broke
  modules/proxy/mod_proxy_http.c: - Use ap_proxy_backend_broke
                                  - Return DONE also if backend broke
  modules/proxy/mod_proxy.h     : Add declaration of ap_proxy_backend_broke


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@365374 13f79535-47bb-0310-9956-ffa450edef68
2006-01-02 16:39:22 +00:00
Jim Jagielski
d4f879aefa Morph the ap_http_broken_backend_filter() proxy "specific"
filter to a generic http error handling output filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@358022 13f79535-47bb-0310-9956-ffa450edef68
2005-12-20 15:50:37 +00:00
Ruediger Pluem
dcc563844c * If the mod_proxy backend connection broke in the middle of the response,
then
  - Do not cache it.
  - Signal the client that something went wrong by closing the connection
    and not sending the last-chunk marker if the response was T-E chunked.

server/core_filters.c         : Close the connection to the client by setting
                                c->keepalive to AP_CONN_CLOSE.
modules/http/chunk_filter.c   : Do not send last-chunk marker in the case
                                the backend broke.
modules/proxy/mod_proxy_http.c: Signal that the backend connection broke.
modules/cache/mod_disk_cache.c: Respect r->no_cache for discarding the response


Submitted by: Roy T. Fielding, Jim Jagielski, Ruediger Pluem
Reviewed by: Roy T. Fielding, Jim Jagielski, Ruediger Pluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@357461 13f79535-47bb-0310-9956-ffa450edef68
2005-12-18 12:07:39 +00:00
Ruediger Pluem
06c6bde4c6 * revert r355823 and r355837
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@355853 13f79535-47bb-0310-9956-ffa450edef68
2005-12-11 01:28:13 +00:00
Ruediger Pluem
614df45f1e * Move handling of backends that broke after the headers have been sent
into the proxy handler of mod_proxy.

  This patch still sets r->connection->aborted to 1 which is currently
  vetoed by Roy. Moving it from the scheme handler to the proxy handler
  should ease the reimplementation of this, as the scheme handlers only
  needs to return PROXY_BACKEND_BROKEN to signal the above situation to
  the proxy handler.

  mod_proxy.h: Add define for PROXY_BACKEND_BROKEN
  mod_proxy.c: Handle PROXY_BACKEND_BROKEN in proxy handler
  mod_proxy_http.c: Sent back PROXY_BACKEND_BROKEN if backend broke
  after we sent the headers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@355823 13f79535-47bb-0310-9956-ffa450edef68
2005-12-11 00:15:27 +00:00
Justin Erenkrantz
70a553c87c Add a comment and use proper grammar for another comment.
(No functional changes.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@354636 13f79535-47bb-0310-9956-ffa450edef68
2005-12-07 00:44:13 +00:00
Justin Erenkrantz
5311a38fcf If we get an error reading the upstream response, we should bail.
Reported by: Brian Akins


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@354628 13f79535-47bb-0310-9956-ffa450edef68
2005-12-07 00:18:58 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Ruediger Pluem
9d3ff0e04b * Fix PR37145 (data loss with httpd-2.0.55 reverse proxy method=post) by
exchanging APR_BRIGADE_CONCAT with ap_save_brigade to ensure that
  transient buckets get setaside correctly between various iterations of
  ap_get_brigade calls.

Reviewed by: Joe Orton, William Rowe, Jim Jagielski, Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@327590 13f79535-47bb-0310-9956-ffa450edef68
2005-10-21 21:50:46 +00:00
Nick Kew
d153de58fe Fix ProxyPassReverse & family to work correctly in <Location>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@231355 13f79535-47bb-0310-9956-ffa450edef68
2005-08-10 23:36:39 +00:00
Joe Orton
4a4869adca * modules/proxy/mod_proxy_http.c (stream_reqbody_cl): Fix gcc warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@231114 13f79535-47bb-0310-9956-ffa450edef68
2005-08-09 21:15:40 +00:00
William A. Rowe Jr
d034a8eee9 Hopefully, address the last edge case where status may
be uninitialized.  Asserts in non-debug builds are bad things,
  anyways, so this is probably more correct.  This should fix
  -Werror compile warning observed by Joe Orton.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@231046 13f79535-47bb-0310-9956-ffa450edef68
2005-08-09 14:54:46 +00:00
William A. Rowe Jr
6b7dcfacf2 Two blank lines for clarity; whitespace only change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230745 13f79535-47bb-0310-9956-ffa450edef68
2005-08-08 03:34:57 +00:00
William A. Rowe Jr
a29f5c9215 We already accept 80 bytes less than the client body's anticipated
size, so we don't need to also prefetch an extra 1024 bytes; this
  was redundant.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230739 13f79535-47bb-0310-9956-ffa450edef68
2005-08-08 03:12:24 +00:00
William A. Rowe Jr
2bdf4dd430 Drop an impossible case; the while() loop already protected us
from this situation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230735 13f79535-47bb-0310-9956-ffa450edef68
2005-08-08 02:57:55 +00:00
William A. Rowe Jr
c9e9770996 Fix a double-termination case in svn trunk/; we terminated the
headers up-front knowing the resulting headers were already
  correctly composed.

  

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230733 13f79535-47bb-0310-9956-ffa450edef68
2005-08-08 02:51:32 +00:00
William A. Rowe Jr
d6bbff7719 An impossible-to-hit edge case today; we described the request
as chunked - and if chunked always send the body termination "0"
  chunk header.

  Roy's requested change that we always send a body we could read
  in full as a C-L request ensures this code wasn't triggered; some
  change in the future could again reveal this edge case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230718 13f79535-47bb-0310-9956-ffa450edef68
2005-08-08 00:57:52 +00:00
Joe Orton
b3163fe9e9 * modules/proxy/mod_proxy_http.c (stream_reqbody_cl): Fix format
string error.
(ap_proxy_http_request): Restore default case in rb_method switch to
fix gcc warnings.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@224721 13f79535-47bb-0310-9956-ffa450edef68
2005-07-25 12:44:40 +00:00
William A. Rowe Jr
16ab528eb5 Yet another snafu in body handling. We need to clearly avoid any
ap_get_brigade or request body processing in every *subrequest* 
  proxy action.  The new code introduced more chaos because we read
  the request body irrespective of any bogus header handling bugs.

  This requires a goto, and yes, that sucks :)  But this is one of those
  oddball cases where jumping away makes more sense than tons of indented
  code, IMHO.  And if you count the number of goto's I've committed to
  httpd, you know I avoid them like the plague.

  I woulda' suggestd to jorton to take a flying carnal act, except that 
  each time he points me back to the 2.0 patch, I catch another entirely 
  bogus choice within the old/new httpd-2.x request body code :)

  I've bumped the 2.0 patch to correspond; see
  http://people.apache.org/~wrowe/httpd-2.0-proxy-request-4.patch

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219533 13f79535-47bb-0310-9956-ffa450edef68
2005-07-18 16:48:25 +00:00
William A. Rowe Jr
f815ba9885 Fix broken while () {} loops (lingering code from the old logic),
closes an infinite loop in the most recent version.  Init the cl_val
  to prevent failure of zero length bodies in the most recent version.

  Use 'request body' instead of 'data' to describe any errors.

  Finally, loop around ap_get_brigade to grab multiple chunks that still
  fall below our MAX_MEM_SPOOL threshold, since the chunk decoding from
  the client will pass up just one small chunk per ap_get_brigade call.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219430 13f79535-47bb-0310-9956-ffa450edef68
2005-07-18 00:16:52 +00:00
William A. Rowe Jr
f38fd1ca57 On Roy's suggestion; why wait to try to clear out the input
stream if it is smaller than MAX_MEM_SPOOL?  Do this upfront
  before dispatching to a body handler.

  This means changing each of the three body pumps to presume
  a preexisting input_brigade was already loaded, so turn around
  their loop conditions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219224 13f79535-47bb-0310-9956-ffa450edef68
2005-07-15 17:39:27 +00:00
William A. Rowe Jr
5bec2aaeb3 Fix a style problem; b is ambigous (is it a brigade or bucket?)
bb is far less ambigous.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219223 13f79535-47bb-0310-9956-ffa450edef68
2005-07-15 17:37:56 +00:00
William A. Rowe Jr
fac43eeab4 leaving force-proxy-request-1.0 for broken clients, revert my
patch for forcing an HTTP/1.0 proxy request, if the client 
  request is HTTP/1.0, per Roy.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219221 13f79535-47bb-0310-9956-ffa450edef68
2005-07-15 17:32:14 +00:00
William A. Rowe Jr
00b86812a8 Missed an edge case; once we know the C-L didn't match, it's
time to shut down the body already.  Finish reading from the
  client but do nothing else, returning an error.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219057 13f79535-47bb-0310-9956-ffa450edef68
2005-07-14 16:17:56 +00:00
William A. Rowe Jr
b05ef49f93 How can I fix thee? let me count the ways...
* pass a chunked body always (no-body requests don't go chunked).

  * validate that the C-L counted body length doesn't change.

  * follow RFC 2616 for C-L / T-E in the request body C-L / T-E
    election logic.

  * do not forward HTTP/1.0 requests as HTTP/1.1, unless the admin
    configures force-proxy-request-1.1

  * conn was illegible, use 2.0's p_conn.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@218978 13f79535-47bb-0310-9956-ffa450edef68
2005-07-14 03:42:22 +00:00
William A. Rowe Jr
9a44d6866d Fix two fat-fingered typos from commit 216156. Code matches previous
behavior now; time to start fixing.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@216159 13f79535-47bb-0310-9956-ffa450edef68
2005-07-13 14:06:24 +00:00
William A. Rowe Jr
bf0bd6d653 send_request_body and indentation made it very difficult to follow
all the mistakes in this code.  Fold send_request_body into reindent
  to make the pattern clear and skip some extra string handling.
  Little functional change, that comes next.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@216156 13f79535-47bb-0310-9956-ffa450edef68
2005-07-13 13:59:32 +00:00
William A. Rowe Jr
d2ff850241 End abuse of apr_strnat[case]cmp - it isn't str[case]cmp.
Unsure if apr_strnatcasecmp(conf_ip, uri_ip) was intentional, on the
  off chance that the left or right hand ip string happens to contain
  leading zeros.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@216111 13f79535-47bb-0310-9956-ffa450edef68
2005-07-13 04:43:59 +00:00
William A. Rowe Jr
8342bc03a2 Fix a ton of wrong/silly indention, and clarify the fix-notes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@209836 13f79535-47bb-0310-9956-ffa450edef68
2005-07-08 16:25:54 +00:00
Jeff Trawick
f5cd172571 proxy HTTP: If a response contains both Transfer-Encoding and a
Content-Length, remove the Content-Length and don't reuse the
connection, stopping some HTTP Request smuggling attacks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@193205 13f79535-47bb-0310-9956-ffa450edef68
2005-06-23 19:20:29 +00:00
Joe Orton
2ce86aa6ee * modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response):
Don't send an EOS after an interim response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@159671 13f79535-47bb-0310-9956-ffa450edef68
2005-04-01 09:30:01 +00:00
Sander Striker
f3886551fa * modules/proxy/mod_proxy_http.c
(ap_proxy_http_process_response): Fix a comment.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@159534 13f79535-47bb-0310-9956-ffa450edef68
2005-03-30 23:09:32 +00:00
Sander Striker
1073345b0f * modules/proxy/mod_proxy_http.c
(ap_proxy_http_process_response): When there are only headers and no body,
   give the remainder of the output filters a chance by pushing an EOS bucket
   through the filter stack.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@159533 13f79535-47bb-0310-9956-ffa450edef68
2005-03-30 22:58:08 +00:00
Justin Erenkrantz
8bc56b5d29 mod_proxy: Add proxy-sendextracrlf option to send an extra CRLF at the
end of the request body to work with really old HTTP servers.

* modules/proxy/mod_proxy_http.c
  (stream_reqbody_cl, spool_reqbody_cl): If proxy-sendextracrlf option is
  present, append a CRLF to the body stream that isn't counted against CL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@157478 13f79535-47bb-0310-9956-ffa450edef68
2005-03-14 22:22:58 +00:00
Joe Orton
119d90c9bc * modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response): Fix
spurious error at EOF.

PR: 33615


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@155209 13f79535-47bb-0310-9956-ffa450edef68
2005-02-24 16:52:34 +00:00
Jim Jagielski
5875d5f9cf If we rec' a bad response header line, ignore what we've
rec'd so far and force BAD_GATEWAY.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152676 13f79535-47bb-0310-9956-ffa450edef68
2005-02-08 16:08:53 +00:00
Jim Jagielski
d1db88d8ad Better handle the case where ProxyBadHeader StartBody is
in effect and we think we've started reading in the
response body. Take advantage of the fact that the
line read is still in buffer (and document that)
to allow us to add to the bb.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151722 13f79535-47bb-0310-9956-ffa450edef68
2005-02-07 15:41:28 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Sander Striker
15ec543f2b Also translate Destination headers when ProxyPassReverse'd
* modules\proxy\mod_proxy_http.c

  (process_proxy_header): reverse map Destination header.

  NOTE: This is some darn nasty looking code...


* modules\proxy\ajp_header.c

  (ajp_unmarshal_response): reverse map Destination header.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151246 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 23:04:04 +00:00
Sander Striker
0f59873110 Rename proxy modules.
* modules\proxy\mod_proxy_ajp.c
* modules\proxy\mod_proxy_balancer.c
* modules\proxy\mod_proxy_connect.c
* modules\proxy\mod_proxy_ftp.c
* modules\proxy\mod_proxy_http.c

  Renamed from proxy_{ajp,balancer,connect,ftp,http}.c


* modules\proxy\mod_proxy_ajp.dsp
* modules\proxy\mod_proxy_balancer.dsp
* modules\proxy\mod_proxy_connect.dsp
* modules\proxy\mod_proxy_ftp.dsp
* modules\proxy\mod_proxy_http.dsp

  Update references to renamed files.


* modules\proxy\NWGNUproxyajp
* modules\proxy\NWGNUproxybalancer
* modules\proxy\NWGNUproxycon
* modules\proxy\NWGNUproxyftp
* modules\proxy\NWGNUproxyhtp

  Update references to renamed files.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151238 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 21:56:30 +00:00