mod_proxy.h

Checkout Tools
  • last updated 5 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix spelling errors found by codespell. [skip ci]

  1. … 100 more files in changeset.
mod_proxy: Improve tunneling loop.

Support half closed connections and pending data draining (for protocols like

rsync). PR 61616.

When reading on one side goes faster than writing on the other side, the output

filters chain may start buffering data and finally block, which will break

bidirectional tunneling for some protocols.

To avoid this, proxy_tunnel_run() now stops polling/reading until pending data

are drained, and recovers appropriately.

  1. … 5 more files in changeset.
mod_proxy: Add proxy check_trans hook.

This allows proxy modules to decline request handling at early stage.

Then mod_proxy_wstunnel can implement that hook to verify that an Upgrade

is requested, and otherwise hand over to mod_proxy_http.

  1. … 4 more files in changeset.
mod_proxy: factorize mod_proxy_{connect,wstunnel} tunneling code in proxy_util.

This commit adds struct proxy_tunnel_rec that contains the fields needed for a

poll() loop through the filters chains, plus functions ap_proxy_tunnel_create()

and ap_proxy_tunnel_run() to respectively initialize a tunnel and (re)start it.

Proxy connect and wstunnel modules now make use of this new API to avoid

duplicating logic and code.

  1. … 6 more files in changeset.
Fix pool concurrency problems

Create a subpool of the connection pool for worker scoped DNS resolutions.

This is needed to avoid race conditions in using the connection pool by multiple

threads during ramp up.

Recheck after obtaining the lock if we still need to do things or if they

were already done by another thread while we were waiting on the lock.

* modules/proxy/proxy_util.c: Create a subpool of the connection pool for worker

scoped DNS resolutions and use it.

* modules/proxy/mod_proxy.h: Define AP_VOLATILIZE_T and add dns_pool to

struct proxy_conn_pool.

* modules/proxy/mod_proxy_ftp.c: Use dns_pool and consider that

worker->cp->addr is volatile in this location of the code.

PR: 63503

  1. … 4 more files in changeset.
restore use of global mutex under !APR_HAS_THREADS

followup to r1852442 which appears to have been too agressive in wrapping

blocks with #if APR_HAS_THREADS. With !APR_HAS_THREADS a global mutex

is a proc mutex.

  1. … 2 more files in changeset.
no-op PROXY_THREAD_LOCK if !APR_HAS_THREADS

... instead of wrapping them in #if themselves in the C code.

r1852442 is a trunk-only change to make mod_proxy compile with !APR_HAS_THREADS.

mod_proxy: follow up to r1836588: configurable Proxy100Continue.

Add Proxy100Continue directive to allow for 100-continue forwarding opt-out.

  1. … 4 more files in changeset.
Make proxy modules compile if APR_HAS_THREADS is not defined.

  1. … 3 more files in changeset.
better struct layout ...
optimize struct layout
update field comment
* ap_proxy_balancer_get_best_worker cannot be exported and used as an optional

function at the same time. So rename ap_proxy_balancer_get_best_worker to

proxy_balancer_get_best_worker and make it static which is then used as an

optional function and recreate ap_proxy_balancer_get_best_worker as an

exported thin wrapper of proxy_balancer_get_best_worker.

  1. … 4 more files in changeset.
* mod_proxy: Remove load order and link dependency between mod_lbmethod_*

modules and mod_proxy by providing mod_proxy's ap_proxy_balancer_get_best_worker

as an optional function.

PR: 62557

  1. … 6 more files in changeset.
PR62199: add worker parameter ResponseFieldSize to mod_proxy

Submitted By: Hank Ibell

Committed By: covener

  1. … 5 more files in changeset.
mod_proxy_balancer: Add hot spare member type and corresponding flag (R). Hot spare members are

used as drop-in replacements for unusable workers in the same load balancer set. This differs

from hot standbys which are only used when all workers in a set are unusable. PR 61140.

  1. … 10 more files in changeset.
mod_proxy: Provide an RFC1035 compliant version of the hostname in the

proxy_worker_shared structure. PR62085

  1. … 8 more files in changeset.
Fix ProxyAddHeaders merging.

* modules/proxy/mod_proxy.h:

Add add_forwarded_headers_set field to proxy_dir_conf.

* modules/proxy/mod_proxy.c (create_proxy_dir_config, ):

Initialize add_forwarded_headers_set.

(add_proxy_http_headers): Set it.

(merge_proxy_dir_config): Merge add_forwarded_headers correctly.

  1. … 2 more files in changeset.
unused now
Add upgrade parameter to mod_proxy_wstunnel.

That allows to upgrade to jboss-remoting for example

or to run an HTTP/1.1 backend that needs to upgrade to

WebSocket.

See also:

https://issues.jboss.org/browse/JBCS-254

https://issues.jboss.org/browse/JBCS-291

  1. … 5 more files in changeset.
[mod_proxy_]http: follow up to r1750392.

Export [ap_]check_pipeline() and use it also for ap_proxy_check_connection(),

so that all the necessary checks on the connection are done before reusing it.

  1. … 7 more files in changeset.
Revert r1756064 and r1756060 until fixed (tests framework passes).
  1. … 7 more files in changeset.
[mod_proxy_]http: follow up to r1750392.

Export [ap_]check_pipeline() and use it also for ap_proxy_check_connection().

[Reverted by r1756065]

  1. … 7 more files in changeset.
Fix spelling in comments and text files.

No functional change.

PR 59990

  1. … 69 more files in changeset.
mod_proxy: follow up to r1750392: comment on proxy_conn_rec->tmp_bb.
mod_proxy: follow up to r1750392.

Avoid double checking the connection in ap_proxy_connect_backend() when

ap_proxy_check_backend() says it is up and good to go.

This can be done by moving the PROXY_WORKER_IS_USABLE() check in

ap_proxy_check_backend(), since it is called by ap_proxy_connect_backend(),

and not calling the latter if the former succeeded (for the modules using it).

  1. … 4 more files in changeset.
mod_proxy: we don't need ap_proxy_ssl_connection_cleanup() anymore with

ap_proxy_check_backend() used at connection reuse time, so remove its last call and deprecate it.

  1. … 2 more files in changeset.
mod_proxy_{http,ajp,fcgi}}: don't reuse backend connections with data available

before the request is sent. PR 57832.

ap_proxy_check_backend() can be used before ap_proxy_connect_backend() to try

to read available data (including from the filters), and is called by

ap_proxy_connect_backend() to check the socket state only (as before, still

relevant after ap_proxy_check_backend() due to filter data which may not have

triggered a real socket operation).

  1. … 7 more files in changeset.
mod_proxy: revert r1750301, r1750305 and r1750311.

Rework needed.

  1. … 4 more files in changeset.
mod_proxy: don't reuse backend connections with data available before the

request is sent. PR 57832.

[Reverted by r1750376]

  1. … 1 more file in changeset.