]> granicus.if.org Git - apache/commitdiff
back out a recent change which causes the server to segfault or
authorJeff Trawick <trawick@apache.org>
Sat, 26 Apr 2003 02:24:48 +0000 (02:24 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 26 Apr 2003 02:24:48 +0000 (02:24 +0000)
otherwise fail, until such time that it can be fixed properly

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99612 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_protocol.c

index 46fa3321278e7464b8eb85091303c26c62eb19cd..0a86b5f01f233dc079ad7ca0d7a68019fb88bfd7 100644 (file)
@@ -1251,7 +1251,7 @@ static void basic_http_header_check(request_rec *r,
 static void basic_http_header(request_rec *r, apr_bucket_brigade *bb,
                               const char *protocol)
 {
-    const char *date;
+    char *date;
     const char *server;
     header_struct h;
     struct iovec vec[4];
@@ -1283,19 +1283,12 @@ static void basic_http_header(request_rec *r, apr_bucket_brigade *bb,
     apr_brigade_writev(bb, NULL, NULL, vec, 4);
 #endif
 
-    /* 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);
+    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", now);
-    }
+    h.pool = r->pool;
+    h.bb = bb;
+    form_header_field(&h, "Date", date);
 
     /* keep a previously set server header (possibly from proxy), otherwise
      * generate a new server header */
@@ -1307,7 +1300,7 @@ static void basic_http_header(request_rec *r, apr_bucket_brigade *bb,
     }
 
     /* unset so we don't send them again */
-    apr_table_unset(r->headers_out, "Date");
+    apr_table_unset(r->headers_out, "Date");        /* Avoid bogosity */
     apr_table_unset(r->headers_out, "Server");
 }