1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

287 Commits

Author SHA1 Message Date
Jean-Frederic Clere
a94b2e9e90 Don't set worker->s if already set (for balancer using slotmem for examples).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@788718 13f79535-47bb-0310-9956-ffa450edef68
2009-06-26 14:26:19 +00:00
Jim Jagielski
13bce6474d Return APR_EGENERAL for the error
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@774423 13f79535-47bb-0310-9956-ffa450edef68
2009-05-13 16:46:59 +00:00
Jean-Frederic Clere
48ae3d9efa Allow the load balancing method to "create" workers.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@774400 13f79535-47bb-0310-9956-ffa450edef68
2009-05-13 15:27:05 +00:00
Ruediger Pluem
124dd1c76f * Fix syntax error
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@772126 13f79535-47bb-0310-9956-ffa450edef68
2009-05-06 10:06:06 +00:00
Jim Jagielski
9399483e16 optimize.... rp! :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771976 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 19:29:04 +00:00
Jean-Frederic Clere
a29e9ec1d5 Change the order of mod_proxy and mod_proxy_balancer child_init().
Change the balancer workers area to the address of workers instead copying the workers.
Arrange lbmethod accordingly.
Move the creation of conf->forward worker to mod_proxy child_init().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771940 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 17:15:48 +00:00
Jim Jagielski
8fa2a05a1d Explain empty code block (empty for now, that is) :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771925 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 16:55:56 +00:00
Ruediger Pluem
9ba4889cc7 * Silence compiler warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771610 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 07:43:14 +00:00
William A. Rowe Jr
ff342e630c As mentioned inline in comments, correctly handle more sophisticated
transformations which currently fail for balancer://foo targets, but
work just fine with other ProxyReverse targets.

  The balancer comparison is a bit trickier.  Given the context

    BalancerMember balancer://alias http://example.com/foo
    ProxyPassReverse /bash balancer://alias/bar

  translate url http://example.com/foo/bar/that to /bash/that

E.g. there may be several different url-suffixes (1st order) of any
particular BalancerMember set e.g. /app1, /app1 and /appbeta while
there may be additional suffixes associated with the actual
ProxyPassReverse directive.  Neither were properly reversed, now
both should be properly handled.

One *critical* assumption;

    BalancerMember balancer://alias/foo http://example.com/bar

should be documented as a meaningless construct, since one cannot
have two members, balancer://alias/foo and balancer://alias/bar,
and the balancer member structures discard this path.

Note one more existing error case as an XXX comment due to invalid
uri comparisons.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771587 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 06:44:02 +00:00
William A. Rowe Jr
6ca2633f75 REVERT 771581 modules/proxy/ changes (miscommitted)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771583 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 06:39:03 +00:00
William A. Rowe Jr
0fe6d791a5 complete r771579, refactoring mod_watchdog as loadable on win32
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771581 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 06:26:24 +00:00
Jim Jagielski
7e145e7312 Fold in initial template for methods to be able to
reset (initialize) and "age" their data, useful when
adding new workers, or when workers come back into
the fold....

Logic and code to come in a bit :)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@769020 13f79535-47bb-0310-9956-ffa450edef68
2009-04-27 15:02:40 +00:00
Jeff Trawick
cb8a82faed remove TPF support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758936 13f79535-47bb-0310-9956-ffa450edef68
2009-03-27 00:05:18 +00:00
Jeff Trawick
2f9b9fdd70 remove BeOS OS support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758891 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 22:23:44 +00:00
Jim Jagielski
77db8b2111 Note for self: PPR drops the path info so we
don't really honor PPR /foo balancer://bar/jimbob
in a way that we would expect.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@752140 13f79535-47bb-0310-9956-ffa450edef68
2009-03-10 15:33:05 +00:00
Ruediger Pluem
4a3c945b14 * Rip out the old flushing approach for solving lifetime issues between the
backend connection bucket allocator and front end connection bucket allocator.
  Instead copy the buckets from the backend over to ones that have been created
  using the front end bucket allocator. For metabucket this is done by recreating
  them, for data buckets this is done by reading them and putting the read data
  in a transient bucket.

PR: 45792


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@712375 13f79535-47bb-0310-9956-ffa450edef68
2008-11-08 11:09:38 +00:00
Ruediger Pluem
c1f881e048 * Improve the way to detect whether buckets in the filter chain need to be
flushed by using the main requests bytes_count field instead of the
  subrequest field.

* Do not reset conn->need_flush. This prevents SegFaults from not flushing
  buckets in the filter chain.

PR: 45792


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@706921 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22 09:34:21 +00:00
Ruediger Pluem
53ddbf41b5 * Revert r703998.
The call to apr_socket_timeout_set before apr_socket_connect already sets the
  socket to non-blocking mode because the timeout of the socket is -1 after creation. A further
  call to apr_socket_timeout_set (after the connect call does not do this, because the old
  and the new timeout are >=0). The further code expects the socket to be in non-blocking
  mode, otherwise we have regressions with ssl. This can be notified by running t/ssl/proxy
  on 2.2.x which runs much much slower with the patch applied. This does not happen
  on trunk because the socket is set back to non blocking by the core output filter
  (async write completion).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@704753 13f79535-47bb-0310-9956-ffa450edef68
2008-10-15 00:53:39 +00:00
Ruediger Pluem
4809b77936 * Make the connection timeout to backends work by temporarily setting the
socket to non blocking mode.

Submitted by: Matt Stevenson <mavricknzwork yahoo.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@703998 13f79535-47bb-0310-9956-ffa450edef68
2008-10-13 10:06:28 +00:00
Jim Jagielski
4a268cc90a Allow for the smax param to be 0, so that all connections
are available to be dropped, should they be idle long
enough.
PR 43371


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@697093 13f79535-47bb-0310-9956-ffa450edef68
2008-09-19 13:43:48 +00:00
Ruediger Pluem
0afe61c5bd * 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@684351 13f79535-47bb-0310-9956-ffa450edef68
2008-08-09 21:33:09 +00:00
Ruediger Pluem
b4e20c8e55 * Add the possibility to set a separate connection timeout for backend
workers.

PR: 45445
Submitted by: rahul <rahul sun.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@684341 13f79535-47bb-0310-9956-ffa450edef68
2008-08-09 20:52:46 +00:00
Ruediger Pluem
f18219717d * Remove call to apr_reslist_destroy. With the latest trunk version of
apr-util this causes a lock during shutdown as at the point of time we would
  execute apr_reslist_destroy the reslist is already destroyed, because we are
  in a cleanup of the same pool where the reslist registered itself as
  precleanup.
  With apr-util 1.3.x calling apr_reslist_destroy is not really useful and
  needed in this case as we are in a cleanup that was registered against the
  same pool that is used by the reslist. As it was registered *after* the
  reslist was created it just runs *before* the reslist cleanup would run. This
  is somewhat pointless here and we could leave the job of destroying the
  reslist to the reslist cleanup.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@682369 13f79535-47bb-0310-9956-ffa450edef68
2008-08-04 12:53:50 +00:00
Jim Jagielski
3cb64b009a Use what we have. This logic belongs here anyway...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645807 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 09:25:57 +00:00
Jim Jagielski
b8f5af8cbe Note why we aren't bothering to check that we have
a valid octet here.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@627740 13f79535-47bb-0310-9956-ffa450edef68
2008-02-14 13:37:18 +00:00
Jim Jagielski
d1858ec213 Add in mod_jk's disablereuse analog for mod_proxy.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@627728 13f79535-47bb-0310-9956-ffa450edef68
2008-02-14 12:55:57 +00:00
Ruediger Pluem
c0ce91dc70 * Fix a typo (timout -> timeout)
PR: 44360
Submitted by: Rainer Jung <rainer.jung kippdata.de>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@619125 13f79535-47bb-0310-9956-ffa450edef68
2008-02-06 19:52:04 +00:00
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