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

57 Commits

Author SHA1 Message Date
Jean-Frederic Clere
988dc93196 create the brigate outside ap_proxygetline and reuse it.
correct the overflow handling. (returning APR_ENOSPC was
changing the behaviour).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@561778 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 12:20:34 +00:00
Jean-Frederic Clere
cd6a6923c2 Improve traces in ap_proxy_http_process_response().
That will help to investigate PR 37770. (errors from backend :-)).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@549420 13f79535-47bb-0310-9956-ffa450edef68
2007-06-21 08:01:30 +00:00
Jeff Trawick
8b9efbf9ca HTTP proxy ProxyErrorOverride: Leave 1xx and 3xx responses alone. Only
processing of error responses (4xx, 5xx) will be altered.

PR: 39245

This is based on a patch submitted by Bart van der Schans <schans hippo.nl>
and tweaked slightly by me based on discussions on dev@ since April 2006.
I think rpleum was the first to mention the 1xx issue.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@527969 13f79535-47bb-0310-9956-ffa450edef68
2007-04-12 15:07:11 +00:00
Justin Erenkrantz
df0aa883d5 Re-add "proxy-sendextracrlf" first introduced in r157478 and silently removed
in r219224.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@495808 13f79535-47bb-0310-9956-ffa450edef68
2007-01-13 01:02:46 +00:00
Ruediger Pluem
4f83ebed74 * Handle request bodies larger than 2 GB by converting the Content-Length
header string of the request correctly to apr_off_t.

PR: 40883


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@486320 13f79535-47bb-0310-9956-ffa450edef68
2006-12-12 21:22:36 +00:00
Jim Jagielski
3f66c0200f Minor nit: why make the logic more complex than it needs to
be ? :)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@437768 13f79535-47bb-0310-9956-ffa450edef68
2006-08-28 17:57:24 +00:00
Mladen Turk
9bbf36995e Cleanup: Remove close_on_recycle from proxy_conn_rec.
It behaves the same as close.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@427959 13f79535-47bb-0310-9956-ffa450edef68
2006-08-02 12:03:42 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Joe Orton
c13f8dd6eb * server/core.c (default_handler): Use apr_brigade_insert_file() to
append the file to the brigade.

* server/protocol.c (ap_send_fd),
modules/proxy/mod_proxy_http.c (spool_reqbody_cl), 
modules/cache/mod_mem_cache.c (recall_body),
modules/cache/mod_disk_cache.c (recall_body),
modules/mappers/mod_negotiation.c (handle_map_file),
modules/generators/mod_asis.c (asis_handler),
modules/dav/fs/repos.c [DEBUG_GET_HANDLER] (dav_fs_deliver),
modules/arch/win32/mod_isapi.c (ServerSupportFunction): Likewise.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@414238 13f79535-47bb-0310-9956-ffa450edef68
2006-06-14 13:16:29 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Ruediger Pluem
96c6356987 * Avoid calling ap_proxy_http_cleanup twice as this releases a connection
from the connection pool twice. This causes this connection to be present
  in the connection pool twice. Thus it may be used by different threads
  at the same time which causes many troubles (segfaults in this case).
  Furthermore implement a logic to prevent double releases to the connection
  pool if they are triggered by buggy code and log an error message in this
  case.

  - mod_proxy_http.c: remove double calls to ap_proxy_http_cleanup
  - proxy_util.c: Add logic to prevent double releases of a
    connection to the connection pool.

PR: 38793


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@394088 13f79535-47bb-0310-9956-ffa450edef68
2006-04-14 13:20:28 +00:00
Ruediger Pluem
70bd1f6329 * Disable persistent connections for SSL backends again as we do not
handle them correctly, because we recreate backend->connection for each
  request and thus try to initialize an already existing SSL connection.

Noticed by: Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@379237 13f79535-47bb-0310-9956-ffa450edef68
2006-02-20 20:56:50 +00:00
Jim Jagielski
d05d878779 *) mod_proxy: Fix KeepAlives not being allowed and set to
backend servers. PR38602. [Ruediger Pluem, Jim Jagielski]

Also, document previous patch:
  *) Correctly initialize mod_proxy workers, which use a
     combination of local and shared datasets. Adjust logging
     to better trace usage. PR38403. [Jim Jagielski]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@378032 13f79535-47bb-0310-9956-ffa450edef68
2006-02-15 16:44:42 +00:00
Ruediger Pluem
df09bfe3f6 * Use the correct pool for apr_table_copy. Otherwise we trigger the bad pool
ancestry abort in apr_table_copy if apr is compiled with APR_POOL_DEBUG.

Noticed by: Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@377525 13f79535-47bb-0310-9956-ffa450edef68
2006-02-13 22:58:03 +00:00
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