Hello, I've found something strange in the mod_proxy (httpd 2.0.63 and 2.2.8) setup: The following directive says: http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxyiobuffersize The |ProxyIOBufferSize| directive adjusts the size of the internal buffer, which is used as a scratchpad for the data between input and output. The size must be less or equal |8192|. LESS or EQUAL 8192... And the code in mod_proxy.c is: long s = atol(arg); psf->io_buffer_size = ((s > AP_IOBUFSIZE) ? s : AP_IOBUFSIZE); psf->io_buffer_size_set = 1; should be psf->io_buffer_size = ((s < AP_IOBUFSIZE) ? s : AP_IOBUFSIZE); It's the same in 2.2.x: else if (!strcasecmp(key, "iobuffersize")) { long s = atol(val); worker->io_buffer_size = ((s > AP_IOBUFSIZE) ? s : AP_IOBUFSIZE); worker->io_buffer_size_set = 1; } I actually need this directive to work better with some stream data. Can somebody confirm the modification must be done in the code and not in the documentation ?
Created attachment 21649 [details] Patch for 2.0.63
Created attachment 21650 [details] Patch for 2.2.8
In 2.2.x both proxy_server_conf's and proxy_worker's io_buffer_size need to be fixed, don't they? --- mod_proxy.c.orig +++ mod_proxy.c @@ -148,7 +148,7 @@ } else if (!strcasecmp(key, "iobuffersize")) { long s = atol(val); - worker->io_buffer_size = ((s > AP_IOBUFSIZE) ? s : AP_IOBUFSIZE); + worker->io_buffer_size = ((s < AP_IOBUFSIZE) ? s : AP_IOBUFSIZE); worker->io_buffer_size_set = 1; } else if (!strcasecmp(key, "receivebuffersize")) { @@ -1467,7 +1467,7 @@ ap_get_module_config(parms->server->module_config, &proxy_module); long s = atol(arg); - psf->io_buffer_size = ((s > AP_IOBUFSIZE) ? s : AP_IOBUFSIZE); + psf->io_buffer_size = ((s < AP_IOBUFSIZE) ? s : AP_IOBUFSIZE); psf->io_buffer_size_set = 1; return NULL; }
Does Limitting ProxyIOBufferSize make sense?
io_buffer_size is used by mod_proxy_ajp, mod_proxy_http and mod_proxy_ftp. mod_proxy_http and mod_proxy_ftp just uses io_buffer_size directly. mod_proxy_http.c line 1637: rv = ap_get_brigade(rp->input_filters, bb, AP_MODE_READBYTES, mode, conf->io_buffer_size); Unlike them, mod_proxy_ajp has own limits. mod_proxy_ajp.c line 171: apr_size_t maxsize = AJP_MSG_BUFFER_SZ; if (psf->io_buffer_size_set) maxsize = psf->io_buffer_size; if (maxsize > AJP_MAX_BUFFER_SZ) maxsize = AJP_MAX_BUFFER_SZ; else if (maxsize < AJP_MSG_BUFFER_SZ) maxsize = AJP_MSG_BUFFER_SZ; maxsize = APR_ALIGN(maxsize, 1024); ajp.h line 134: #define AJP_MSG_BUFFER_SZ 8192 #define AJP_MAX_BUFFER_SZ 65536
Created attachment 21697 [details] Remove limit ProxyIOBufferSize (trunk) There's no reason limitting ProxyIOBufferSize in mod_proxy. If needed, protocol providers should.
2.2 doc still says "The size must be less or equal 8192." The 2.2 code says ProxyIOBufferSize must be greater than or equal to 8192. 2.4 doc says "The size must be at least 512." 2.2 doc should be wrong.
found similar discussion: http://www.mail-archive.com/dev@httpd.apache.org/msg41850.html
Docs updated in trunk: http://svn.apache.org/r1476652 In v2.4: http://svn.apache.org/r1476653 In v2.2: http://svn.apache.org/r1476655