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/21 13:05:45 UTC

cvs commit: httpd-2.0/modules/proxy mod_proxy.c proxy_http.c proxy_util.c

minfrin     02/03/21 04:05:45

  Modified:    .        CHANGES
               modules/proxy mod_proxy.c proxy_http.c proxy_util.c
  Log:
  Change the header merging behaviour in proxy, as some headers
  (like Set-Cookie) cannot be unmerged due to stray commas in
  dates.
  
  Revision  Changes    Path
  1.650     +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.649
  retrieving revision 1.650
  diff -u -r1.649 -r1.650
  --- CHANGES	20 Mar 2002 16:44:12 -0000	1.649
  +++ CHANGES	21 Mar 2002 12:05:45 -0000	1.650
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0.34-dev
   
  +  *) Change the header merging behaviour in proxy, as some headers
  +     (like Set-Cookie) cannot be unmerged due to stray commas in
  +     dates. [Graham Leggett]
  +
     *) Be more vocal about what AcceptMutex values we allow, to make
        us closer to how 1.3 does it. [Jim Jagielski]
   
  
  
  
  1.76      +1 -1      httpd-2.0/modules/proxy/mod_proxy.c
  
  Index: mod_proxy.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/mod_proxy.c,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- mod_proxy.c	13 Mar 2002 20:47:53 -0000	1.75
  +++ mod_proxy.c	21 Mar 2002 12:05:45 -0000	1.76
  @@ -854,7 +854,7 @@
       ap_get_module_config(parms->server->module_config, &proxy_module);
       long s = atol(arg);
   
  -    psf->io_buffer_size = MAX(s, AP_IOBUFSIZE);
  +    psf->io_buffer_size = ((s > AP_IOBUFSIZE) ? s : AP_IOBUFSIZE);
       psf->io_buffer_size_set = 1;
       return NULL;
   }
  
  
  
  1.138     +0 -4      httpd-2.0/modules/proxy/proxy_http.c
  
  Index: proxy_http.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_http.c,v
  retrieving revision 1.137
  retrieving revision 1.138
  diff -u -r1.137 -r1.138
  --- proxy_http.c	20 Mar 2002 17:41:55 -0000	1.137
  +++ proxy_http.c	21 Mar 2002 12:05:45 -0000	1.138
  @@ -781,10 +781,6 @@
               }
           }
   
  -        /* cookies are special: they must not be merged (stupid browsers) */
  -        ap_proxy_table_unmerge(r->pool, r->headers_out, "Set-Cookie");
  -        ap_proxy_table_unmerge(r->pool, r->headers_out, "Set-Cookie2");
  -
           r->sent_bodyct = 1;
           /* Is it an HTTP/0.9 response? If so, send the extra data */
           if (backasswards) {
  
  
  
  1.86      +7 -4      httpd-2.0/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_util.c,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- proxy_util.c	13 Mar 2002 20:47:54 -0000	1.85
  +++ proxy_util.c	21 Mar 2002 12:05:45 -0000	1.86
  @@ -392,8 +392,11 @@
    * Reads headers from a buffer and returns an array of headers.
    * Returns NULL on file error
    * This routine tries to deal with too long lines and continuation lines.
  - * @@@: XXX: FIXME: currently the headers are passed thru un-merged. 
  - * Is that okay, or should they be collapsed where possible?
  + *
  + * Note: Currently the headers are passed through unmerged. This has to be
  + * done so that headers which react badly to merging (such as Set-Cookie
  + * headers, which contain commas within the date field) do not get stuffed
  + * up.
    */
   PROXY_DECLARE(apr_table_t *)ap_proxy_read_headers(request_rec *r, request_rec *rr, char *buffer, int size, conn_rec *c)
   {
  @@ -441,8 +444,8 @@
   	for (end = &value[strlen(value)-1]; end > value && apr_isspace(*end); --end)
   	    *end = '\0';
   
  -        /* make sure we merge so as not to destroy duplicated headers */
  -        apr_table_merge(headers_out, buffer, value);
  +        /* make sure we add so as not to destroy duplicated headers */
  +        apr_table_add(headers_out, buffer, value);
   
   	/* the header was too long; at the least we should skip extra data */
   	if (len >= size - 1) {