1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

672 Commits

Author SHA1 Message Date
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
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