]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add the ProxyIOBufferSize option. Previously the size of the
authorGraham Leggett <minfrin@apache.org>
Sat, 9 Mar 2002 22:25:41 +0000 (22:25 +0000)
committerGraham Leggett <minfrin@apache.org>
Sat, 9 Mar 2002 22:25:41 +0000 (22:25 +0000)
buffer used while reading from the remote server in proxy was
taken from ProxyReceiveBufferSize. These two functions were
similar but not the same, thus the need for the split.
PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@93821 13f79535-47bb-0310-9956-ffa450edef68

src/CHANGES
src/modules/proxy/mod_proxy.c
src/modules/proxy/mod_proxy.h
src/modules/proxy/proxy_ftp.c
src/modules/proxy/proxy_http.c

index e7275d5f7633883a1ed9b544999ad65f4890c13c..ca77fe4084d78daf574ee4f35fa58bf9ed56decc 100644 (file)
@@ -1,5 +1,9 @@
 Changes with Apache 1.3.24
 
+  *) Add the ProxyIOBufferSize option. Previously the size of the
+     buffer used while reading from the remote server in proxy was
+     taken from ProxyReceiveBufferSize. [Graham Leggett]
+
   *) Fix a NULL variable check in proxy where we were checking the
      wrong variable. [Geff Hanoian <geff@pier64.com>]
 
index eb1fcb1bcd8a0ae296eb825bdf01ab2658a45510..4975d72448ddea6fc2e761a1edcd35d741b64963 100644 (file)
@@ -424,6 +424,8 @@ static void *
     ps->req_set = 0;
     ps->recv_buffer_size = 0; /* this default was left unset for some reason */
     ps->recv_buffer_size_set = 0;
+    ps->io_buffer_size = IOBUFSIZE;
+    ps->io_buffer_size_set = 0;
 
     ps->cache.root = NULL;
     ps->cache.space = DEFAULT_CACHE_SPACE;
@@ -467,6 +469,7 @@ static void *
     ps->viaopt = (overrides->viaopt_set == 0) ? base->viaopt : overrides->viaopt;
     ps->req = (overrides->req_set == 0) ? base->req : overrides->req;
     ps->recv_buffer_size = (overrides->recv_buffer_size_set == 0) ? base->recv_buffer_size : overrides->recv_buffer_size;
+    ps->io_buffer_size = (overrides->io_buffer_size_set == 0) ? base->io_buffer_size : overrides->io_buffer_size;
 
     ps->cache.root = (overrides->cache.root == NULL) ? base->cache.root : overrides->cache.root;
     ps->cache.space = (overrides->cache.space_set == 0) ? base->cache.space : overrides->cache.space;
@@ -843,6 +846,18 @@ static const char *
     return NULL;
 }
 
+static const char *
+     set_io_buffer_size(cmd_parms *parms, void *dummy, char *arg)
+{
+    proxy_server_conf *psf =
+    ap_get_module_config(parms->server->module_config, &proxy_module);
+    long s = atol(arg);
+
+    psf->io_buffer_size = ((s > IOBUFSIZE) ? s : IOBUFSIZE);
+    psf->io_buffer_size_set = 1;
+    return NULL;
+}
+
 static const char*
     set_cache_completion(cmd_parms *parms, void *dummy, char *arg)
 {
@@ -904,6 +919,8 @@ static const command_rec proxy_cmds[] =
      "A list of names, hosts or domains to which the proxy will not connect"},
     {"ProxyReceiveBufferSize", set_recv_buffer_size, NULL, RSRC_CONF, TAKE1,
      "Receive buffer size for outgoing HTTP and FTP connections in bytes"},
+    {"ProxyIOBufferSize", set_io_buffer_size, NULL, RSRC_CONF, TAKE1,
+     "IO buffer size for outgoing HTTP and FTP connections in bytes"},
     {"NoProxy", set_proxy_dirconn, NULL, RSRC_CONF, ITERATE,
      "A list of domains, hosts, or subnets to which the proxy will connect directly"},
     {"ProxyDomain", set_proxy_domain, NULL, RSRC_CONF, TAKE1,
index 618b68418ec61e81d87274f8869698a28be958cd..20eeee2772eec5a326b462f7a7b8594ba826c0c4 100644 (file)
@@ -201,6 +201,8 @@ typedef struct {
     char viaopt_set;
     size_t recv_buffer_size;
     char recv_buffer_size_set;
+    size_t io_buffer_size;
+    char io_buffer_size_set;
 } proxy_server_conf;
 
 struct hdr_entry {
index 1eb0b3b9c4935ac28cff7ce901782d3727bce1b5..659ee0428faaa5b219164101a4f8735aa0ef3406 100644 (file)
@@ -1348,7 +1348,7 @@ int ap_proxy_ftp_handler(request_rec *r, cache_req *c, char *url)
 /* we need to set this for ap_proxy_send_fb()... */
             if (c != NULL)
                 c->cache_completion = 0;
-            ap_proxy_send_fb(data, r, c, -1, 0, conf->recv_buffer_size);
+            ap_proxy_send_fb(data, r, c, -1, 0, conf->io_buffer_size);
         }
         else {
             send_dir(data, r, c, cwd);
index 0e3e9651371fe9942a43c185d813339c8fc38f53..ac411419b0e1b22d098d094722fc168fb5827e94 100644 (file)
@@ -582,7 +582,7 @@ int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url,
  * content length is not known. We need to make 100% sure c->len is always
  * set correctly before we get here to correctly do keepalive.
  */
-        ap_proxy_send_fb(f, r, c, c->len, 0, conf->recv_buffer_size);
+        ap_proxy_send_fb(f, r, c, c->len, 0, conf->io_buffer_size);
     }
 
     /* ap_proxy_send_fb() closes the socket f for us */