]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
storeTimestampsSet(): don't clobber entry->lastmod. require that
authorwessels <>
Wed, 27 May 1998 05:04:13 +0000 (05:04 +0000)
committerwessels <>
Wed, 27 May 1998 05:04:13 +0000 (05:04 +0000)
reply->last_modified be > -1 first.

new_StoreEntry(): initialize timestamps to -1

src/http.cc
src/store.cc

index 0fbf51a9077adbf30932b6b6d24cdb3fcc205f82..7553e7c85ec26cb2f55f16620cc8da306e972f58 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.274 1998/05/22 23:44:12 wessels Exp $
+ * $Id: http.cc,v 1.275 1998/05/26 23:04:13 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -623,7 +623,7 @@ httpBuildRequestHeader(request_t * request,
     httpHeaderInit(hdr_out);
 
     /* append our IMS header */
-    if (entry && entry->lastmod && request->method == METHOD_GET)
+    if (entry && entry->lastmod > -1 && request->method == METHOD_GET)
        httpHeaderPutTime(hdr_out, HDR_IF_MODIFIED_SINCE, entry->lastmod);
 
     strConnection = httpHeaderGetList(hdr_in, HDR_CONNECTION);
index 9dcce759ad015be7b9a4292fe7be293c1c176624..5f1d15427e1c038baccda065e7a3b58e2282764e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.418 1998/05/26 15:48:28 wessels Exp $
+ * $Id: store.cc,v 1.419 1998/05/26 23:04:15 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -194,6 +194,7 @@ new_StoreEntry(int mem_obj_flag, const char *url, const char *log_url)
     if (mem_obj_flag)
        e->mem_obj = new_MemObject(url, log_url);
     debug(20, 3) ("new_StoreEntry: returning %p\n", e);
+    e->expires = e->lastmod = e->lastref = e->timestamp = -1;
     return e;
 }
 
@@ -991,7 +992,8 @@ storeTimestampsSet(StoreEntry * entry)
     if (served_date < 0)
        served_date = squid_curtime;
     entry->expires = reply->expires;
-    entry->lastmod = reply->last_modified;
+    if (reply->last_modified > -1)
+        entry->lastmod = reply->last_modified;
     if (entry->lastmod < 0)
        entry->lastmod = served_date;
     entry->timestamp = served_date;