httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject cvs commit: httpd-2.0/modules/http http_protocol.c
Date Tue, 15 Apr 2003 17:41:34 GMT
minfrin     2003/04/15 10:41:34

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES
               modules/http Tag: APACHE_2_0_BRANCH http_protocol.c
  Log:
  If a Date response header was already set in the headers array,
  this value was ignored in favour of the current time. This meant
  that Date headers on proxied requests where rewritten when they
  should not have been.
  PR:		14376
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.988.2.79 +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.78
  retrieving revision 1.988.2.79
  diff -u -r1.988.2.78 -r1.988.2.79
  --- CHANGES	15 Apr 2003 16:14:33 -0000	1.988.2.78
  +++ CHANGES	15 Apr 2003 17:41:33 -0000	1.988.2.79
  @@ -1,5 +1,10 @@
   Changes with Apache 2.0.46
   
  +  *) If a Date response header was already set in the headers array,
  +     this value was ignored in favour of the current time. This meant
  +     that Date headers on proxied requests where rewritten when they
  +     should not have been. PR: 14376 [Graham Leggett]
  +
     *) Add code to buildconf that produces an httpd.spec file from
        httpd.spec.in, using build/get-version.sh from APR.
        [Graham Leggett]
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.463.2.2 +14 -7     httpd-2.0/modules/http/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
  retrieving revision 1.463.2.1
  retrieving revision 1.463.2.2
  diff -u -r1.463.2.1 -r1.463.2.2
  --- http_protocol.c	3 Feb 2003 17:31:41 -0000	1.463.2.1
  +++ http_protocol.c	15 Apr 2003 17:41:34 -0000	1.463.2.2
  @@ -1240,7 +1240,7 @@
   static void basic_http_header(request_rec *r, apr_bucket_brigade *bb,
                                 const char *protocol)
   {
  -    char *date;
  +    const char *date;
       const char *server;
       header_struct h;
       struct iovec vec[4];
  @@ -1272,12 +1272,19 @@
       apr_brigade_writev(bb, NULL, NULL, vec, 4);
   #endif
   
  -    date = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
  -    ap_recent_rfc822_date(date, r->request_time);
  +    /* keep a previously set date header (possibly from proxy), otherwise
  +     * generate a new date header */
  +    if ((date = apr_table_get(r->headers_out, "Date")) != NULL) {
  +        form_header_field(&h, "Date", date);
  +    }
  +    else {
  +        char *now = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
  +        ap_recent_rfc822_date(now, r->request_time);
   
  -    h.pool = r->pool;
  -    h.bb = bb;
  -    form_header_field(&h, "Date", date);
  +        h.pool = r->pool;
  +        h.bb = bb;
  +        form_header_field(&h, "Date", now);
  +    }
   
       /* keep a previously set server header (possibly from proxy), otherwise
        * generate a new server header */
  @@ -1289,7 +1296,7 @@
       }
   
       /* unset so we don't send them again */
  -    apr_table_unset(r->headers_out, "Date");        /* Avoid bogosity */
  +    apr_table_unset(r->headers_out, "Date");
       apr_table_unset(r->headers_out, "Server");
   }
   
  
  
  

Mime
View raw message