1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-28 11:57:22 +03:00
Commit Graph

71 Commits

Author SHA1 Message Date
Jim Jagielski
1a216eca67 More trunk backporting
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpd-2.2-proxy@809545 13f79535-47bb-0310-9956-ffa450edef68
2009-08-31 11:41:33 +00:00
Jim Jagielski
3788e4cf66 Oh joy. Fold in backportable proxy changes/improvements
from trunk as of r772279



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpd-2.2-proxy@772280 13f79535-47bb-0310-9956-ffa450edef68
2009-05-06 14:33:45 +00:00
Jim Jagielski
936301d265 Merge r733127, r733219 from trunk:
pass a server_rec to ap_log_error on two interim response messages
 


use ap_log_rerror instead of r->server per niq's comments

Submitted by: covener
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@733756 13f79535-47bb-0310-9956-ffa450edef68
2009-01-12 13:56:19 +00:00
Jim Jagielski
a10438c040 *) mod_proxy: Prevent segmentation faults by correctly adjusting the lifetime
of the buckets read from the proxy backend. PR 45792 [Ruediger Pluem]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@713146 13f79535-47bb-0310-9956-ffa450edef68
2008-11-11 20:04:34 +00:00
Jim Jagielski
039c677673 Merge r707163 from trunk:
Remove potential for memory leak... allocate on this
request which is now viable due to connection pooling.

Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@713143 13f79535-47bb-0310-9956-ffa450edef68
2008-11-11 20:00:10 +00:00
Eric Covener
0dfb73904b Merge r697362 from trunk:
For timeouts, behave as before and not drop.
Submitted by: Adam Woodworth <mirkperl gmail.com>
Reviewed by: jim, rpluem, covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@699841 13f79535-47bb-0310-9956-ffa450edef68
2008-09-28 15:36:44 +00:00
Eric Covener
ec2cc701f9 Merge r684351, r686549 from trunk:
* Introduce environment variable proxy-initial-not-pooled to avoid reusing
  pooled connections if the client connection is an initial connection.
  This avoids the "proxy: error reading status line from remote server"
  error caused by the race condition that the backend server closed the
  connection after the connection check on our side and before our data
  reached the backend. Yes, this downgrades performance, especially with
  HTTP/1.0 clients. Hence it is configurable and off by default.

PR: 37770


* Add missing documentation for proxy-initial-not-pooled (r684351).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@691230 13f79535-47bb-0310-9956-ffa450edef68
2008-09-02 13:07:50 +00:00
Ruediger Pluem
03c575b69d Merge r661506 from trunk:
* According to RFC 2616 8.2.3 we are not allowed to forward an
  Expect: 100-continue to an HTTP/1.0 server. Instead we MUST return
  a HTTP_EXPECTATION_FAILED.

Submitted by: rpluem
Reviewed by: jim, rpluem, niq


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@678203 13f79535-47bb-0310-9956-ffa450edef68
2008-07-19 18:55:48 +00:00
Jim Jagielski
ed3398fa65 Backport... use approvals from the sec list to
allow for backport here.

Merge r666154, r666180 from trunk:

Patch for CVE-2008-2364...


move back to inner loop... fails otherwise

Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@666229 13f79535-47bb-0310-9956-ffa450edef68
2008-06-10 17:39:38 +00:00
Jim Jagielski
48ead8029e Merge r649169, r649239, r649840, r649922, r650026, r661452, r661459 from trunk:
Make mod_proxy_ajp aware of the nocanon envvar


handle ? in cases where nocanon is in effect


* Do not add the query string again in the case that we are using the
  unparsed uri.

PR: 44803


Set at init time, and combine comments


Typo.


* Do not add the query string again in the case that we are using the
  unparsed uri.

PR: 44803


* Set at init time and combine comments.

Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@663593 13f79535-47bb-0310-9956-ffa450edef68
2008-06-05 12:46:43 +00:00
Jim Jagielski
a101104c2f Merge r660726 from trunk:
*  mod_proxy_http.c
   Ensure that the EOC bucket is inserted BEFORE an EOS bucket in bb as
   some resource filters like mod_deflate pass everything up to the EOS
   down the chain immediately and sent the remainder of the brigade later
   (or even never). But in this case the ap_http_header_filter does not
   get out of our way soon enough.

   http_filters.c
   Remove all data buckets that are in a brigade after an EOC bucket
   was seen, as an EOC bucket tells us that no (further) resource
   and protocol data should go out to the client. OTOH meta buckets
   are still welcome as they might trigger needed actions down in
   the chain (e.g. in network filters like SSL).
   Remark 1: It is needed to dump ALL data buckets in the brigade
             since an filter in between might have inserted data
             buckets BEFORE the EOC bucket sent by the original
             sender and we do NOT want this data to be sent.
   Remark 2: Dumping all data buckets here does not necessarily mean
             that no further data is send to the client as:
             1. Network filters like SSL can still be triggered via
                meta buckets to talk with the client e.g. for a
                clean shutdown.
             2. There could be still data that was buffered before
                down in the chain that gets flushed by a FLUSH or an
                EOS bucket.

PR: 37770

Submitted by: rpluem
Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@660936 13f79535-47bb-0310-9956-ffa450edef68
2008-05-28 12:58:29 +00:00
Ruediger Pluem
1e8c308735 Merge r645813 from trunk:
* In the case that we fail to read the response line from the backend and if
  we are a reverse proxy request shutdown the connection WITHOUT ANY response
  to trigger a retry by the client if allowed (as for idempotent requests).
  BUT currently we should not do this if the request is the first request on
  a keepalive connection as browsers like seamonkey only display an empty page
  in this case and do not do a retry.

Related to PR 37770

Submitted by: rpluem
Reviewed by: rpluem, jim, fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@657443 13f79535-47bb-0310-9956-ffa450edef68
2008-05-17 19:47:38 +00:00
Ruediger Pluem
6c10c6b8b5 * Merge r602542, r603237, r603502, r603543, r604447, r604449, r605314,
r605838 from trunk:

* Enable the proxy to keep connections persistent in the HTTPS case.

  Basicly the persistence is created by keeping the conn_rec structure
  created for our backend connection (whether http or https) in the connection
  pool. This required to adjust scoreboard.c in a way that its functions can
  properly deal with a NULL scoreboard handle by ignoring the call or returning
  an error code.

* Use a separate subpool to manage the data for the socket and the connection
  member of the proxy_conn_rec struct as we destroy this data more frequently
  than other data in the proxy_conn_rec struct like hostname and addr (at least
  in the case where we have keepalive connections that timed out and were
  closed by the backend).
  This fixes a memory leak with short lived and broken connections.

* Fix another memory leak related to PR 44026. Now that we keep the connection
  data structure alive in the reslist, the live time of c->pool is too long.
  r->pool has the correct live time since rp dies before r.

* Do not register connection_cleanup as cleanup for the conn->pool. In the past
  it was needed to register connection_cleanup as a cleanup for the frontend
  connection memory pool (c->pool) to ensure that connection returns into the
  connection pool if the memory pool of the frontend connection memory pool
  gets destroyed / cleared. Now we ensure explicitly the connection returns
  to the connection pool once we finished handling the request.

* Tag the pools appropriately to ease memory debugging.

* Only sent a flush bucket down the chain if buckets where sent down the chain
  before that could still be buffered in the network filter. This is the case
  if we have sent an EOS bucket or if we actually sent buckets with
  data down the chain. In all other cases we either have not sent any
  buckets at all down the chain or we only sent meta buckets that are
  not EOS buckets down the chain. The only meta bucket that remains in
  this case is the flush bucket which would have removed all possibly
  buffered buckets in the network filter.
  If we sent a flush bucket in the case where not ANY buckets were
  sent down the chain, we break error handling which happens AFTER us.

* Using the reslist pool for the proxy_conn_rec structure introduces a memory
  leak when connections get created and destroyed frequently by the reslist
  (e.g.  destroying idle elements of the reslist). So use the subpool
  dedicated for the proxy_conn_rec structure to allocate the memory for the
  structure itself.

PR: 44026, 44543
Submitted by: rpluem
Reviewed by: jim, rpluem, fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@657440 13f79535-47bb-0310-9956-ffa450edef68
2008-05-17 19:42:03 +00:00
Jim Jagielski
58590510ac PR 44165
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@653770 13f79535-47bb-0310-9956-ffa450edef68
2008-05-06 13:37:07 +00:00
Ruediger Pluem
69826c2949 Merge r616517, r617653 from trunk:
* Fix processing of chunked responses if Connection: Transfer-Encoding is
  set in the response of the proxied system.

PR: 44311
Submitted by: rpluem
Reviewed by: jim, rpluem, mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@617686 13f79535-47bb-0310-9956-ffa450edef68
2008-02-01 22:42:08 +00:00
Jim Jagielski
d4283ac1cf * mod_proxy_http: Correctly forward unexpected interim (HTTP 1xx) responses
incorporating ap_send_interim_response core API
          PR 16518



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@602468 13f79535-47bb-0310-9956-ffa450edef68
2007-12-08 14:01:47 +00:00
Jim Jagielski
296439bfa9 mod_proxy canon-tion improvements/fixes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@596712 13f79535-47bb-0310-9956-ffa450edef68
2007-11-20 15:11:39 +00:00
Jim Jagielski
40dbbae3d2 Merge r583813 from trunk:
* modules/proxy/mod_proxy_http.c (ap_proxy_http_register_hook): Fix
  apr_pool_cleanup_register() invocation added in r583202, which was
  causing every apr_proc_create() call to segfault.

Submitted by: jorton
Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@584821 13f79535-47bb-0310-9956-ffa450edef68
2007-10-15 16:53:59 +00:00
Nick Kew
2f1e0d94b3 mod_proxy_http: Remove Warning headers with wrong date
PR 16138


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@583202 13f79535-47bb-0310-9956-ffa450edef68
2007-10-09 15:50:55 +00:00
Nick Kew
d121992ce9 mod_proxy_http: Correctly parse all Connection headers in proxy.
PR 43509


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@583194 13f79535-47bb-0310-9956-ffa450edef68
2007-10-09 15:26:41 +00:00
Jim Jagielski
676390be88 Merge r580060 from trunk:
Fix adding out Via header in proxy response
PR 19439

Submitted by: niq
Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@583155 13f79535-47bb-0310-9956-ffa450edef68
2007-10-09 13:20:36 +00:00
Jim Jagielski
0768a06a70 Merge r580044, r580465 from trunk:
Strip hop-by-hop headers in proxy response


Fix typo in header name "Trailer"

Submitted by: niq
Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@582807 13f79535-47bb-0310-9956-ffa450edef68
2007-10-08 12:47:12 +00:00
Nick Kew
8281650735 Backport r574021
Propagate Proxy-Authorization header correctly
PR 25947


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@578336 13f79535-47bb-0310-9956-ffa450edef68
2007-09-22 00:30:23 +00:00
Ruediger Pluem
423521b1b8 Merge r572000 from trunk:
* Fix proxy-sendchunk(s|ed) problem.

PR: 43183

Submitted by: Brian Rectanus <Brian.Rectanus breach.com>, Vincent Bray
Reviewed by: niq, rpluem, fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@572421 13f79535-47bb-0310-9956-ffa450edef68
2007-09-03 21:07:17 +00:00
Jim Jagielski
9081b5e347 Merge r571002 from trunk:
proxy_http: don't wait for response body in a HEAD
PR 41644 [Stuart Children]

Submitted by: niq
Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@571777 13f79535-47bb-0310-9956-ffa450edef68
2007-09-01 12:11:55 +00:00
Jim Jagielski
7b22fa4ca6 Apply backport
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@570416 13f79535-47bb-0310-9956-ffa450edef68
2007-08-28 13:30:39 +00:00
Jim Jagielski
545f73efeb Merge r527969 from trunk:
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.


Submitted by: trawick
Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@534068 13f79535-47bb-0310-9956-ffa450edef68
2007-05-01 13:22:27 +00:00
Jim Jagielski
f36ff2e8be Merge r486320 from trunk:
* Handle request bodies larger than 2 GB by converting the Content-Length
  header string of the request correctly to apr_off_t.

PR: 40883

Submitted by: rpluem
Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@509665 13f79535-47bb-0310-9956-ffa450edef68
2007-02-20 17:12:55 +00:00
Jim Jagielski
4781747150 Merge r437768 from trunk:
Minor nit: why make the logic more complex than it needs to
be ? :)

Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@437781 13f79535-47bb-0310-9956-ffa450edef68
2006-08-28 18:57:09 +00:00
Roy T. Fielding
ae1748a99f update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@421103 13f79535-47bb-0310-9956-ffa450edef68
2006-07-12 03:38:44 +00:00
Paul Querna
786089eef9 Revert r395231 from the 2.2.x branch. This gets us back to the old place with regard to the copyright statements.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@396056 13f79535-47bb-0310-9956-ffa450edef68
2006-04-22 01:53:06 +00:00
Paul Querna
9deb5258cd Merge r394088 and r395180 from trunk.
PR: 38793
Reviewed By: rpluem, jim, wrowe, trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@396049 13f79535-47bb-0310-9956-ffa450edef68
2006-04-22 01:33:44 +00:00
Colm MacCarthaigh
8ffd8c554b Update the last year of copyright for the 2.2.x branch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@395231 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:33:16 +00:00
Ruediger Pluem
c39b93274c Merge r379237 from trunk:
* 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: jorton
Submitted by: rpluem
Reviewed by: rpluem, trawick, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@390885 13f79535-47bb-0310-9956-ffa450edef68
2006-04-02 19:25:34 +00:00
Paul Querna
40f57ebb46 Merge r377053, r377057 and r377525 from trunk, fixing several issues with mod_proxy_http and keep-alive headers.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@390608 13f79535-47bb-0310-9956-ffa450edef68
2006-04-01 06:54:11 +00:00
Jim Jagielski
2f2d24df6e Merge r378032 from trunk:
*) 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]


Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@390492 13f79535-47bb-0310-9956-ffa450edef68
2006-03-31 20:27:49 +00:00
Jim Jagielski
b2a530354a Merge accepted backport...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@390190 13f79535-47bb-0310-9956-ffa450edef68
2006-03-30 17:46:44 +00:00
Nick Kew
0a64247d6a Backport r366279 (proxy_http patch by rpluem)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@368705 13f79535-47bb-0310-9956-ffa450edef68
2006-01-13 13:14:18 +00:00
Jim Jagielski
b3181bddae No functional change: remove trailing whitespace. This also means
that "blank" lines, which had consisted of just spaces
and/or tabs are now truly blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@332309 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:20:05 +00:00
Ruediger Pluem
96f197db57 Merge r327590 from trunk:
* 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/branches/2.2.x@327592 13f79535-47bb-0310-9956-ffa450edef68
2005-10-21 21:54:27 +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