mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879401 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1667,11 +1667,6 @@ int ap_proxy_http_process_response(proxy_http_req_t *req)
|
||||
tunnel->timeout = client_timeout;
|
||||
}
|
||||
|
||||
/* Bidirectional non-HTTP stream will confuse mod_reqtimeoout, we
|
||||
* use a single idle timeout from now on.
|
||||
*/
|
||||
ap_remove_input_filter_byhandle(c->input_filters, "reqtimeout");
|
||||
|
||||
/* Let proxy tunnel forward everything */
|
||||
status = ap_proxy_tunnel_run(tunnel);
|
||||
if (ap_is_HTTP_ERROR(status)) {
|
||||
|
Reference in New Issue
Block a user