Commit c346dbe0 authored by Ryan Bloom's avatar Ryan Bloom
Browse files

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
parent ea6349d5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
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]

+0 −13
Original line number Diff line number Diff line
@@ -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.
 *
+13 −0
Original line number Diff line number Diff line
@@ -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,