From e17dc75c42a1781e755b69bcaba709acc58e36f3 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 27 May 1998 05:04:13 +0000 Subject: [PATCH] storeTimestampsSet(): don't clobber entry->lastmod. require that reply->last_modified be > -1 first. new_StoreEntry(): initialize timestamps to -1 --- src/http.cc | 4 ++-- src/store.cc | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/http.cc b/src/http.cc index 0fbf51a907..7553e7c85e 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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); diff --git a/src/store.cc b/src/store.cc index 9dcce759ad..5f1d15427e 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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; -- 2.47.3