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

360 Commits

Author SHA1 Message Date
Jim Jagielski
406500fe39 Now let things like
ProxyPassReverse /foo balancer://bar

work "as expected" :) :)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@616335 13f79535-47bb-0310-9956-ffa450edef68
2008-01-29 14:26:20 +00:00
Ruediger Pluem
78f70660d1 * 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@605838 13f79535-47bb-0310-9956-ffa450edef68
2007-12-20 08:57:23 +00:00
Ruediger Pluem
4a595ca19b * 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@605314 13f79535-47bb-0310-9956-ffa450edef68
2007-12-18 20:03:01 +00:00
Ruediger Pluem
8d25ecd1a8 * Tag the pools appropriately to ease memory debugging.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@604449 13f79535-47bb-0310-9956-ffa450edef68
2007-12-15 16:19:36 +00:00
Ruediger Pluem
d2a1cf5f8c * Fix a SEGFAULT by ensuring that buckets that may have been buffered in the
network filters get flushed to the network. This is needed since
  these buckets have been created with the bucket allocator of the
  backend connection. This allocator either gets destroyed if
  conn->close is set or the worker address is not reusable which
  causes the connection to the backend to be closed or it will be used
  again by another frontend connection that wants to recycle the
  backend connection.
  In this case we could run into nasty race conditions (e.g. if the
  next user of the backend connection destroys the allocator before we
  sent the buckets to the network).

  Remark 1: Doing a setaside does not help here as the buckets remain
  created by the wrong allocator in this case.

  Remark 2: Yes, this creates a possible performance penalty in the case
  of pipelined requests as we may send only a small amount of data over
  the wire.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@604447 13f79535-47bb-0310-9956-ffa450edef68
2007-12-15 16:15:04 +00:00
Ruediger Pluem
033055ec4a * 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@603543 13f79535-47bb-0310-9956-ffa450edef68
2007-12-12 10:38:19 +00:00
Ruediger Pluem
43b6edd52f * 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@603502 13f79535-47bb-0310-9956-ffa450edef68
2007-12-12 07:44:02 +00:00
Ruediger Pluem
0ae93ad6f9 * 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.

PR: 44026


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@603237 13f79535-47bb-0310-9956-ffa450edef68
2007-12-11 13:27:21 +00:00
Ruediger Pluem
bd49c01685 * 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@602542 13f79535-47bb-0310-9956-ffa450edef68
2007-12-08 20:10:29 +00:00
Jim Jagielski
e883a58cf6 Semi-revert 583466; just remove the ap_proxy_isvalidenc()
function until we canonically set the "allowed" list.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583802 13f79535-47bb-0310-9956-ffa450edef68
2007-10-11 12:37:09 +00:00
Jim Jagielski
2349488a44 Abstract out "verification of valid encoding" via
ap_proxy_isvalidenc(). Now we can use it in other
proxy protocols.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583466 13f79535-47bb-0310-9956-ffa450edef68
2007-10-10 13:16:56 +00:00
Nick Kew
a153ecd496 Fix keepalive to proxy backend
PR 43472


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580466 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 19:30:37 +00:00
Jean-Frederic Clere
cb6949285d lb_score is bigger proxy_worker_stat. Prevent wasting space.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@574843 13f79535-47bb-0310-9956-ffa450edef68
2007-09-12 08:34:40 +00:00
Ruediger Pluem
e931c04100 * This check is now part of the PROXY_WORKER_IS_INITIALIZED macro.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@574486 13f79535-47bb-0310-9956-ffa450edef68
2007-09-11 06:40:11 +00:00
Jim Jagielski
5437e234f7 Maintain the illusion. It's not worth my time or
energy to care about this anymore.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@574269 13f79535-47bb-0310-9956-ffa450edef68
2007-09-10 14:54:01 +00:00
Nick Kew
982a8e3feb Escape error-notes correctly
PR 40952


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@573939 13f79535-47bb-0310-9956-ffa450edef68
2007-09-09 01:13:38 +00:00
Nick Kew
6c763f831e Check all IP addresses listed in ProxyBlock
PR 36987


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@573911 13f79535-47bb-0310-9956-ffa450edef68
2007-09-08 21:43:47 +00:00
Nick Kew
8d329cde45 mod_proxy: Don't lose bytes when a response line arrives in small chunks.
PR 40894


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@573903 13f79535-47bb-0310-9956-ffa450edef68
2007-09-08 20:29:14 +00:00
Jim Jagielski
0703f437c0 Reinstate the lb_score patch, but, protect against
conflicting leakage as per jfc proposal.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@573569 13f79535-47bb-0310-9956-ffa450edef68
2007-09-07 13:13:37 +00:00
Jim Jagielski
d7e5be074a *) mod_proxy: Improve network performance by setting APR_TCP_NODELAY
(disable Nagle algorithm) on sockets if implemented.
     PR 42871 [Christian BOITEL <christian_boitel yahoo.fr>, Jim Jagielski]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@562510 13f79535-47bb-0310-9956-ffa450edef68
2007-08-03 15:57:27 +00:00
Nick Kew
5e206de8a2 Improvement suggested by rpluem to proxy_date fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@562069 13f79535-47bb-0310-9956-ffa450edef68
2007-08-02 10:17:25 +00:00
Nick Kew
139f41aa75 Fix buffer overflow in date handling
PR 41144 (Davi Arnaut)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@561616 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 00:58:20 +00:00
Jean-Frederic Clere
55bb4fbe30 Fix the timeout logic. The order is now:
1 - worker->timeout
2 - proxy_conf->timeout
3 - server->timeout.
ap_get_module_config() is not perfect by that is easy to port back to 2.2.x.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@550514 13f79535-47bb-0310-9956-ffa450edef68
2007-06-25 14:29:54 +00:00
Jean-Frederic Clere
4751c3aa1f Arrange the proxy timeout behaviour.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@546128 13f79535-47bb-0310-9956-ffa450edef68
2007-06-11 12:40:37 +00:00
Jim Jagielski
1c8f89ea65 Abstract out (kinda) MSG_PEEK. This way when we
actually update APR and apr_socket_recvfrom()
to know about APR_MSG_OOB, APR_MSG_PEEK, etc...
this code won't need to be adjusted. Also,
make nicer for 2.2 backport.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@535354 13f79535-47bb-0310-9956-ffa450edef68
2007-05-04 19:12:38 +00:00
Jim Jagielski
e4c8e34188 Isolate the unlock return vals
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@484978 13f79535-47bb-0310-9956-ffa450edef68
2006-12-09 13:47:56 +00:00
Jim Jagielski
3b5d5bf319 Failure to unlock is very nasty, so log it to help
with troubleshooting.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@484792 13f79535-47bb-0310-9956-ffa450edef68
2006-12-08 21:37:08 +00:00
Ruediger Pluem
27f7eda663 * Ensure that at least scheme://hostname[:port] matches between worker and URL
when trying to find the worker that fits best to the given URL.

PR: 40910


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@481901 13f79535-47bb-0310-9956-ffa450edef68
2006-12-03 21:24:43 +00:00
Mladen Turk
3d180c45a6 Add alternate is_socket_connected by using APR functions.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@473278 13f79535-47bb-0310-9956-ffa450edef68
2006-11-10 09:15:21 +00:00
Mladen Turk
e22c26b53b Remove alternate is_socket_connected detection.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@473276 13f79535-47bb-0310-9956-ffa450edef68
2006-11-10 09:12:57 +00:00
Ruediger Pluem
196a6e711e * Assign rv in the if statement to return the correct error code and
more important an error code at all, as currently APR_SUCCESS is returned
  in the error case.

PR: 40865
Submitted by: Andrew Rucker Jones <arjones simultan.dyndns.org>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@470076 13f79535-47bb-0310-9956-ffa450edef68
2006-11-01 20:20:42 +00:00
Mladen Turk
29bb9d02c7 Add missing include for experimental is_connected.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@452327 13f79535-47bb-0310-9956-ffa450edef68
2006-10-03 07:15:46 +00:00
Mladen Turk
93146d3b40 Cleanup alternate is_connected method.
It works for sure on win32,linux and solaris.
I do not have access to other platforms so can not
verify it works on them.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@451896 13f79535-47bb-0310-9956-ffa450edef68
2006-10-02 07:06:24 +00:00
Mladen Turk
907c904bc6 Add alternative is_socket_connected implementation.
It works on win32 and linux for sure, so that's why
I put it inside the #ifdef.
Of course something like that needs APR abstraction.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@451580 13f79535-47bb-0310-9956-ffa450edef68
2006-09-30 11:04:46 +00:00
Mladen Turk
6a68c112dc Enable retry=0 for the worker.
This allows to have an option to always retry
the workers in error state instead using a
specified time.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@451575 13f79535-47bb-0310-9956-ffa450edef68
2006-09-30 10:41:51 +00:00
Ruediger Pluem
7361c75b95 * PROXY_WORKER_IS_INITIALIZED checks if PROXY_WORKER_INITIALIZED is set in
worker->s->status, but we need to check here if it is set in worker->status.

  As PROXY_WORKER_INITIALIZED is set in worker->s->status in
  ap_proxy_initialize_worker_share, which is called just before
  ap_proxy_initialize_worker we never initialize the worker. This is very bad
  as we create no reslist for the pool in this case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@443503 13f79535-47bb-0310-9956-ffa450edef68
2006-09-14 22:34:34 +00:00
Nick Kew
3b19271873 PR#37770: Don't try to use dead backend connection in proxy
(Patch from Olivier BOEL)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@431339 13f79535-47bb-0310-9956-ffa450edef68
2006-08-14 13:26:07 +00:00
Nick Kew
d160248d92 Fix tabs introduced in r429875
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@429890 13f79535-47bb-0310-9956-ffa450edef68
2006-08-08 23:50:33 +00:00
Nick Kew
047253e8a8 PR#38448: don't URLencode tilde in path component
On reflection, this patch makes sense (since the URL spec got updated), and it's trivial.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@429879 13f79535-47bb-0310-9956-ffa450edef68
2006-08-08 23:27:25 +00:00
Nick Kew
537844367d Fix style (indentation at least) to apache style rules before reviewing top of this.
No functional change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@429875 13f79535-47bb-0310-9956-ffa450edef68
2006-08-08 23:18:23 +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
Mladen Turk
0658003dba Cleanup: Remove checking for pre 2.0.46 MMN. It is
obvious that the new mod_proxy will never be
backported to the 2.0 branch.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@427055 13f79535-47bb-0310-9956-ffa450edef68
2006-07-31 09:33:28 +00:00
Nick Kew
346c6c3e76 Support environment variable interpolation in reverse proxy configuration
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@421686 13f79535-47bb-0310-9956-ffa450edef68
2006-07-13 19:00:26 +00:00
Jim Jagielski
3e2c97f512 It never fails. I sit on a patch for awhile and
it's not until almost right after I commit it that
I think "hey, there's a better way to do that."
Anyway, I was never happy about the code
duplication of the primary/standby checks...
This fixes that.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@421283 13f79535-47bb-0310-9956-ffa450edef68
2006-07-12 15:01:15 +00:00
Jim Jagielski
0b80babf0b Add in hot-standby balancer member. If all other members
are disabled or not-usable, ONLY THEN will the hot
standby's be used.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420986 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:39:38 +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
Jim Jagielski
7b9391e010 Clean up some proxy macros. Avoid the use of magic
numbers, and instead use pre-defined defines. Also,
ensure that usable workers have been initialized :)

Allocate a bit for hot standbys. Adjust so that
normal "usable" workers don't count these.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420954 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 19:32:36 +00:00
Joe Orton
5c7b0ad30c * modules/proxy/proxy_util.c (ap_proxy_initialize_worker): Fix
gcc strict-aliasing warning.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395552 13f79535-47bb-0310-9956-ffa450edef68
2006-04-20 10:35:41 +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
Martin Kraemer
fcfc9fd022 Fix for platforms without threads: inreslist exists only if APR_HAS_THREADS is set
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395180 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 08:56:59 +00:00