httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: httpd-2.0/modules/proxy proxy_http.c
Date Mon, 10 May 2004 13:58:56 GMT
jim         2004/05/10 06:58:56

  Modified:    .        CHANGES
               modules/proxy proxy_http.c
  Log:
  
  
  Revision  Changes    Path
  1.1476    +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1475
  retrieving revision 1.1476
  diff -u -r1.1475 -r1.1476
  --- CHANGES	3 May 2004 22:22:50 -0000	1.1475
  +++ CHANGES	10 May 2004 13:58:56 -0000	1.1476
  @@ -2,6 +2,10 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Proxy server was deleting cookies that Apache had already
  +     assigned if the origin server had set any cookies. PR 27023.
  +     [Jim Jagielski]
  +
     *) Prevent Win32 pool corruption at startup [Allan Edwards]
   
     *) Removed old and unmaintained ap_add_named_module API and changed
  
  
  
  1.185     +29 -1     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.184
  retrieving revision 1.185
  diff -u -r1.184 -r1.185
  --- proxy_http.c	11 Mar 2004 17:21:47 -0000	1.184
  +++ proxy_http.c	10 May 2004 13:58:56 -0000	1.185
  @@ -745,6 +745,12 @@
       return APR_SUCCESS;
   }
   
  +static int addit_dammit(void *v, const char *key, const char *val)
  +{
  +    apr_table_addn(v, key, val);
  +    return 1;
  +}
  +
   static
   apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                                               proxy_http_conn_t *p_conn,
  @@ -761,6 +767,7 @@
       int len, backasswards;
       int interim_response; /* non-zero whilst interim 1xx responses
                              * are being read. */
  +    apr_table_t *save_table;
   
       bb = apr_brigade_create(p, c->bucket_alloc);
   
  @@ -834,8 +841,16 @@
               /* N.B. for HTTP/1.0 clients, we have to fold line-wrapped headers*/
               /* Also, take care with headers with multiple occurences. */
   
  +            /* First, tuck away all already existing cookies */
  +            save_table = apr_table_make(r->pool, 2);
  +            apr_table_do(addit_dammit, save_table, r->err_headers_out,
  +                         "Set-Cookie", NULL);
  +            apr_table_do(addit_dammit, save_table, r->headers_out,
  +                         "Set-Cookie", NULL);
  +
               r->headers_out = ap_proxy_read_headers(r, rp, buffer,
                                                      sizeof(buffer), origin);
  +
               if (r->headers_out == NULL) {
                   ap_log_error(APLOG_MARK, APLOG_WARNING, 0,
                                r->server, "proxy: bad HTTP/%d.%d header "
  @@ -853,8 +868,21 @@
                   return r->status;
   
               } else {
  -                /* strip connection listed hop-by-hop headers from response */
                   const char *buf;
  +
  +                /* Now, add in the just read cookies */
  +                apr_table_do(addit_dammit, save_table, r->headers_out,
  +        	             "Set-Cookie", NULL);
  +
  +                /* and now load 'em all in */
  +                if (!apr_is_empty_table(save_table)) {
  +                    apr_table_unset(r->headers_out, "Set-Cookie");
  +                    r->headers_out = apr_table_overlay(r->pool,
  +                                                       r->headers_out,
  +                                                       save_table);
  +                }
  +                
  +                /* strip connection listed hop-by-hop headers from response */
                   p_conn->close += ap_proxy_liststr(apr_table_get(r->headers_out,
                                                                   "Connection"),
                                                     "close");
  
  
  

Mime
View raw message