You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2002/03/09 23:25:41 UTC

cvs commit: apache-1.3/src/modules/proxy mod_proxy.c mod_proxy.h proxy_ftp.c proxy_http.c

minfrin     02/03/09 14:25:41

  Modified:    src      CHANGES
               src/modules/proxy mod_proxy.c mod_proxy.h proxy_ftp.c
                        proxy_http.c
  Log:
  Add the ProxyIOBufferSize option. Previously the size of the
  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.
  
  Revision  Changes    Path
  1.1784    +4 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1783
  retrieving revision 1.1784
  diff -u -r1.1783 -r1.1784
  --- CHANGES	8 Mar 2002 18:35:10 -0000	1.1783
  +++ CHANGES	9 Mar 2002 22:25:40 -0000	1.1784
  @@ -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 <ge...@pier64.com>]
   
  
  
  
  1.79      +17 -0     apache-1.3/src/modules/proxy/mod_proxy.c
  
  Index: mod_proxy.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/proxy/mod_proxy.c,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- mod_proxy.c	20 Jan 2002 20:14:37 -0000	1.78
  +++ mod_proxy.c	9 Mar 2002 22:25:40 -0000	1.79
  @@ -424,6 +424,8 @@
       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 @@
       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 @@
       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 @@
        "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,
  
  
  
  1.56      +2 -0      apache-1.3/src/modules/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/proxy/mod_proxy.h,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- mod_proxy.h	26 Feb 2002 18:01:28 -0000	1.55
  +++ mod_proxy.h	9 Mar 2002 22:25:41 -0000	1.56
  @@ -201,6 +201,8 @@
       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 {
  
  
  
  1.95      +1 -1      apache-1.3/src/modules/proxy/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_ftp.c,v
  retrieving revision 1.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- proxy_ftp.c	26 Feb 2002 18:01:28 -0000	1.94
  +++ proxy_ftp.c	9 Mar 2002 22:25:41 -0000	1.95
  @@ -1348,7 +1348,7 @@
   /* 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);
  
  
  
  1.86      +1 -1      apache-1.3/src/modules/proxy/proxy_http.c
  
  Index: proxy_http.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_http.c,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- proxy_http.c	2 Mar 2002 13:08:52 -0000	1.85
  +++ proxy_http.c	9 Mar 2002 22:25:41 -0000	1.86
  @@ -582,7 +582,7 @@
    * 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 */