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:39:43 GMT
minfrin     2003/04/15 10:39:43

  Modified:    .        CHANGES
               modules/http 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
  1.1144    +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1143
  retrieving revision 1.1144
  diff -u -r1.1143 -r1.1144
  --- CHANGES	15 Apr 2003 16:33:11 -0000	1.1143
  +++ CHANGES	15 Apr 2003 17:39:43 -0000	1.1144
  @@ -159,6 +159,11 @@
   
   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]
  
  
  
  1.466     +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.465
  retrieving revision 1.466
  diff -u -r1.465 -r1.466
  --- http_protocol.c	19 Feb 2003 06:50:10 -0000	1.465
  +++ http_protocol.c	15 Apr 2003 17:39:43 -0000	1.466
  @@ -1251,7 +1251,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];
  @@ -1283,12 +1283,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 */
  @@ -1300,7 +1307,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