Skip to content
Commit 463e509c authored by Ruediger Pluem's avatar Ruediger Pluem
Browse files

* 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
parent bc7b01b7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment