httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@decus.org (Rodent of Unusual Size)
Subject [PATCH] for 1.3: Last-Modified from scripts
Date Thu, 14 Aug 1997 11:17:51 GMT
    This is for Dean's PR#894.  It allows a "Last-Modified" header field
    emitted by a script to be used for If-* request header processing
    (and etag generation, btw).

    #ken    :-)}

Index: core/util_script.c
===================================================================
RCS file: /export/home/cvs/apachen/src/core/util_script.c,v
retrieving revision 1.69
diff -u -r1.69 util_script.c
--- util_script.c	1997/08/05 06:33:26	1.69
+++ util_script.c	1997/08/14 12:02:01
@@ -399,6 +399,21 @@
         else if(!strcasecmp(w,"Transfer-Encoding")) {
 	    table_set (r->headers_out, w, l);
         }   
+/*
+ * If the script gave us a Last-Modified header, run it through the checks
+ * which work against it [done in set_last_modified()].  Any conditional
+ * failures in those will cause us to bail out.  Success means all the
+ * conditions were satisfied and the appropriate response header fields have
+ * been set - so we don't need to do anything else.
+ */
+        else if (!strcasecmp(w, "Last-Modified")) {
+	    time_t mtime = parseHTTPdate(l);
+	    int slm_status = set_last_modified(r, mtime);
+
+	    if (slm_status != OK) {
+		return slm_status;
+	    }
+        }   
 
 /* The HTTP specification says that it is legal to merge duplicate
  * headers into one.  Some browsers that support Cookies don't like

Mime
View raw message