From: Ryan Bloom Date: Sun, 25 Mar 2001 20:42:47 +0000 (+0000) Subject: Move ap_set_last_modified to the core. This is a potentially X-Git-Tag: 2.0.16~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e845552895f40dd8977ea76fa6f7b45e632b8fda;p=apache Move ap_set_last_modified to the core. This is a potentially controversial change, because this is kind of HTTP specific. However many protocols should be able to take advantage of this kind of information. I expect that headers will need one more layer of indirection for multi-protocol work, but this is a small step in the right direction. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88580 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index ba1932864a..a0dbc83968 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,12 @@ Changes with Apache 2.0.16-dev + *) Move ap_set_last_modified to the core. This is a potentially + controversial change, because this is kind of HTTP specific. However + many protocols should be able to take advantage of this kind of + information. I expect that headers will need one more layer of + indirection for multi-protocol work, but this is a small step in + the right direction. [Ryan Bloom] + *) Enable mod_status by default. This matches what Apache 1.3 does. [Ed Korthof] diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 82e4603a79..f6c75b83a7 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -299,19 +299,6 @@ AP_DECLARE(int) ap_meets_conditions(request_rec *r) return OK; } -/* - * This function sets the Last-Modified output header field to the value - * of the mtime field in the request structure - rationalized to keep it from - * being in the future. - */ -AP_DECLARE(void) ap_set_last_modified(request_rec *r) -{ - apr_time_t mod_time = ap_rationalize_mtime(r, r->mtime); - char *datestr = apr_palloc(r->pool, APR_RFC822_DATE_LEN); - apr_rfc822_date(datestr, mod_time); - apr_table_setn(r->headers_out, "Last-Modified", datestr); -} - /* Get the method number associated with the given string, assumed to * contain an HTTP method. Returns M_INVALID if not recognized. * diff --git a/server/protocol.c b/server/protocol.c index 6f078be14d..b32f651a86 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -1544,6 +1544,19 @@ AP_DECLARE(int) ap_rflush(request_rec *r) return 0; } +/* + * This function sets the Last-Modified output header field to the value + * of the mtime field in the request structure - rationalized to keep it from + * being in the future. + */ +AP_DECLARE(void) ap_set_last_modified(request_rec *r) +{ + apr_time_t mod_time = ap_rationalize_mtime(r, r->mtime); + char *datestr = apr_palloc(r->pool, APR_RFC822_DATE_LEN); + apr_rfc822_date(datestr, mod_time); + apr_table_setn(r->headers_out, "Last-Modified", datestr); +} + AP_IMPLEMENT_HOOK_RUN_ALL(int,post_read_request, (request_rec *r),(r),OK,DECLINED) AP_IMPLEMENT_HOOK_RUN_ALL(int,log_transaction,