/[Apache-SVN]
ViewVC logotype

Revision 1879401


Jump to revision: Previous Next
Author: ylavic
Date: Wed Jul 1 16:35:48 2020 UTC (3 years, 10 months ago)
Changed paths: 4
Log Message:
mod_proxy: improved and reentrant tunneling loop.

modules/proxy/mod_proxy.h:
    Rename AP_PROXY_TRANSFER_SHOULD_YIELD to AP_PROXY_TRANSFER_YIELD_PENDING
    and add AP_PROXY_TRANSFER_YIELD_MAX_READS.

modules/proxy/mod_proxy_http.c:
modules/proxy/mod_proxy_wstunnel.c:
    Removing of reqtimeout filter is now handled by ap_proxy_tunnel_create().

modules/proxy/proxy_util.c:
    ap_proxy_transfer_between_connections():
        Reorganize loop to break out early.
        When AP_PROXY_TRANSFER_YIELD_PENDING, if !ap_filter_should_yield() we
        still need to run and check ap_filter_output_pending() since it may
        release pending data.
        When AP_PROXY_TRANSFER_YIELD_MAX_READS, stop the loop after too much
        reads (PROXY_TRANSFER_MAX_READS = 10000) to release the thread and
        give the caller a chance to schedule the other direction.
        Don't return APR_INCOMPLETE when it comes from an incomplete body
        detected by ap_http_filter().

    ap_proxy_tunnel_create():
        Start with POLLOUT on both directions so that any pending output data
        is flushed first.

    ap_proxy_tunnel_run():
        Remove re-init/clear of the pollset for each call so that the function
        is reentrant.
        Handle POLLOUT before POLLIN so that we can read in the same pass once
        all buffered output data are flushed, using ap_filter_input_pending()
        to drain buffered input data.

This is preparatory patch for async websocket tunneling is mod_proxy_http.


Changed paths

Path Details
Directoryhttpd/httpd/trunk/modules/proxy/mod_proxy.h modified , text changed
Directoryhttpd/httpd/trunk/modules/proxy/mod_proxy_http.c modified , text changed
Directoryhttpd/httpd/trunk/modules/proxy/mod_proxy_wstunnel.c modified , text changed
Directoryhttpd/httpd/trunk/modules/proxy/proxy_util.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26