DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19954>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19954 [PATCH] HTTP tunneling through reverse proxy does not always work Summary: [PATCH] HTTP tunneling through reverse proxy does not always work Product: Apache httpd-2.0 Version: 2.0.45 Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: mod_proxy AssignedTo: [email protected] ReportedBy: [EMAIL PROTECTED] [PATCH] Enable HTTP tunneling for streaming data where data is less than the buffering size Synopsis: Optionally disable buffering in mod_proxy We ran into a situation where a command-response protocol was being tunneled through HTTP (2 sockets 1 is an HTTP GET, the other an HTTP POST) that failed when passed through an Apache reverse proxy. When the data passing from the server < AP_MIN_BYTES_TO_WRITE (8000 decimal) then the bucket brigade buffers the data instead of passing it on. The guts of the patch are basically appending a flush bucket after every read(unless there is already an EOS) if the ProxyWriteThrough directive is set to On --------------------------------------------------------- Chris Conti [EMAIL PROTECTED] [EMAIL PROTECTED] diff -u \ApacheSrc\httpd-2.0.45\modules\proxy\proxy_http.c \ApacheSrc-orig\httpd-2.0.45\modules\proxy\proxy_http.c --- \ApacheSrc\httpd-2.0.45\modules\proxy\proxy_http.c 2003-05-02 16:22:53.000000000 -0400 +++ \ApacheSrc-orig\httpd-2.0.45\modules\proxy\proxy_http.c 2003-02-03 10:31:50.000000000 -0500 @@ -956,18 +956,6 @@ /* signal that we must leave */ finish = TRUE; } - - /* do we need to always send the data? */ - if (conf->write_through && !finish){ - apr_off_t readbytes; - apr_brigade_length(bb, 0, &readbytes); - - - if(0 != readbytes){ - apr_bucket *e = apr_bucket_flush_create(c->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(bb, e); - } - } /* try send what we read */ if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS) { diff -u \ApacheSrc\httpd-2.0.45\modules\proxy\mod_proxy.h \ApacheSrc-orig\httpd-2.0.45\modules\proxy\mod_proxy.h --- \ApacheSrc\httpd-2.0.45\modules\proxy\mod_proxy.h 2003-04-29 09:20:12.000000000 -0400 +++ \ApacheSrc-orig\httpd-2.0.45\modules\proxy\mod_proxy.h 2003-02-03 10:31:50.000000000 -0500 @@ -201,8 +201,6 @@ bad_body } badopt; /* how to deal with bad headers */ char badopt_set; - int write_through; - char write_through_set; } proxy_server_conf; diff -u \ApacheSrc\httpd-2.0.45\modules\proxy\mod_proxy.c \ApacheSrc-orig\httpd-2.0.45\modules\proxy\mod_proxy.c --- \ApacheSrc\httpd-2.0.45\modules\proxy\mod_proxy.c 2003-04-29 09:20:12.000000000 -0400 +++ \ApacheSrc-orig\httpd-2.0.45\modules\proxy\mod_proxy.c 2003-02-22 11:38:14.000000000 -0500 @@ -503,8 +503,6 @@ ps->timeout_set = 0; ps->badopt = bad_error; ps->badopt_set = 0; - ps->write_through = 0; - ps->write_through_set = 0; return ps; } @@ -532,7 +530,6 @@ ps->preserve_host = (overrides->preserve_host_set == 0) ? base->preserve_host : overrides->preserve_host; ps->timeout= (overrides->timeout_set == 0) ? base->timeout : overrides->timeout; ps->badopt = (overrides->badopt_set == 0) ? base->badopt : overrides->badopt; - ps->write_through = (overrides->write_through_set == 0) ? base->write_through : overrides->write_through; return ps; } @@ -816,16 +813,6 @@ psf->req_set = 1; return NULL; } -static const char* - set_proxy_writethrough(cmd_parms *parms, void *dummy, int flag) -{ - proxy_server_conf *psf = - ap_get_module_config(parms->server->module_config, &proxy_module); - - psf->write_through = flag; - psf->write_through_set = 1; - return NULL; -} static const char * set_proxy_error_override(cmd_parms *parms, void *dummy, int flag) { @@ -1079,8 +1066,6 @@ "This overrides the server timeout"), AP_INIT_TAKE1("ProxyBadHeader", set_bad_opt, NULL, RSRC_CONF, "How to handle bad header line in response: IsError | Ignore | StartBody"), - AP_INIT_FLAG("ProxyWriteThrough", set_proxy_writethrough, NULL, RSRC_CONF, - "on if the data should be not be buffered"), {NULL} }; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
