Hello,

I've found something strange in the mod_proxy (httpd 2.0.63) 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 ?

I attach the patch for 2.0.x and 2.2.x.


Matthieu




Index: modules/proxy/mod_proxy.c
===================================================================
--- modules/proxy/mod_proxy.c	(révision 634609)
+++ modules/proxy/mod_proxy.c	(copie de travail)
@@ -864,7 +864,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;
 }
Index: modules/proxy/mod_proxy.c
===================================================================
--- modules/proxy/mod_proxy.c	(révision 634611)
+++ modules/proxy/mod_proxy.c	(copie de travail)
@@ -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")) {

Reply via email to