httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r572272 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/http/http_filters.c
Date Mon, 03 Sep 2007 10:05:20 GMT
Author: rpluem
Date: Mon Sep  3 03:05:16 2007
New Revision: 572272

URL: http://svn.apache.org/viewvc?rev=572272&view=rev
Log:
Merge r483633 from trunk:

* Do not replace a Date header set by a proxied backend server.

PR: 40232

Submitted by: rpluem
Reviewed by: rpluem, jim, niq 

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/http/http_filters.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=572272&r1=572271&r2=572272&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Mon Sep  3 03:05:16 2007
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.6
 
+  *) core: Do not replace a Date header set by a proxied backend server.
+     PR 40232. [Ruediger Pluem]
+
   *) mod_proxy: Add a missing assignment in an error checking code path.
      PR 40865. [Andrew Rucker Jones <arjones simultan.dyndns.org>]
 

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=572272&r1=572271&r2=572272&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Mon Sep  3 03:05:16 2007
@@ -79,13 +79,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-    * core: Do not replace a Date header set by a proxied backend server.
-      PR 40232.
-      Trunk version of patch:
-         http://svn.apache.org/viewcvs.cgi?rev=483633&view=rev
-      Backport version for 2.2.x of patch:
-         Trunk version of patch works
-      +1: rpluem, jim, niq
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
 

Modified: httpd/httpd/branches/2.2.x/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/http/http_filters.c?rev=572272&r1=572271&r2=572272&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/http/http_filters.c (original)
+++ httpd/httpd/branches/2.2.x/modules/http/http_filters.c Mon Sep  3 03:05:16 2007
@@ -721,22 +721,37 @@
     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);
-
     h.pool = r->pool;
     h.bb = bb;
-    form_header_field(&h, "Date", date);
 
-    /* keep the set-by-proxy server header, otherwise
-     * generate a new server header */
+    /*
+     * keep the set-by-proxy server and date headers, otherwise
+     * generate a new server header / date header
+     */
     if (r->proxyreq != PROXYREQ_NONE) {
+        const char *proxy_date;
+
+        proxy_date = apr_table_get(r->headers_out, "Date");
+        if (!proxy_date) {
+            /*
+             * proxy_date needs to be const. So use date for the creation of
+             * our own Date header and pass it over to proxy_date later to
+             * avoid a compiler warning.
+             */
+            date = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
+            ap_recent_rfc822_date(date, r->request_time);
+            proxy_date = date;
+        }
+        form_header_field(&h, "Date", proxy_date);
         server = apr_table_get(r->headers_out, "Server");
         if (server) {
             form_header_field(&h, "Server", server);
         }
     }
     else {
+        date = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
+        ap_recent_rfc822_date(date, r->request_time);
+        form_header_field(&h, "Date", date);
         form_header_field(&h, "Server", ap_get_server_banner());
     }
 



Mime
View raw message