From: Jeff Trawick Date: Sat, 26 Apr 2003 02:24:48 +0000 (+0000) Subject: back out a recent change which causes the server to segfault or X-Git-Tag: pre_ajp_proxy~1767 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=491b1348465f0bb0587ad5f9aa77e4afffd78058;p=apache back out a recent change which causes the server to segfault or 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 --- diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 46fa332127..0a86b5f01f 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -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"); }