]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
HTTP Compliance: Send Age:0 header even if it may break IE5.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 4 Oct 2010 15:52:31 +0000 (09:52 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 4 Oct 2010 15:52:31 +0000 (09:52 -0600)
Removed a hack that prevented zero-valued Age header from being sent to HTTP
clients. The hack was added around January 2000 and is related to the
following patch:
    http://devel.squid-cache.org/hno/patches/squid-2.2.STABLE5.age.patch

The above patch sites IE5 as the possible culprit that hangs when processing
zero Age responses.

If we get complaints about broken browsers not being able to handle
zero-valued Age headers, we can make Age:0 header inclusion conditional
on something like SUPPORT_IE5 #define or even on the User-Agent value.

src/client_side_reply.cc

index 4ee5ee6267053d70407d1b0eb89036726a956a57..34e3e29e7c1c15919178c4281c96c91e1945d40f 100644 (file)
@@ -1247,12 +1247,6 @@ clientReplyContext::buildReplyHeader()
          * This adds the calculated object age. Note that the details of the
          * age calculation is performed by adjusting the timestamp in
          * StoreEntry::timestampsSet(), not here.
-         *
-         * BROWSER WORKAROUND: IE sometimes hangs when receiving a 0 Age
-         * header, so don't use it unless there is a age to report. Please
-         * note that Age is only used to make a conservative estimation of
-         * the objects age, so a Age: 0 header does not add any useful
-         * information to the reply in any case.
          */
 #if DEAD_CODE
         // XXX: realy useless? or is there a bug now that this is detatched from the below if-sequence ?
@@ -1266,7 +1260,7 @@ clientReplyContext::buildReplyHeader()
         if (EBIT_TEST(http->storeEntry()->flags, ENTRY_SPECIAL)) {
             hdr->delById(HDR_DATE);
             hdr->insertTime(HDR_DATE, squid_curtime);
-        } else if (http->storeEntry()->timestamp < squid_curtime) {
+        } else if (http->storeEntry()->timestamp <= squid_curtime) {
             hdr->putInt(HDR_AGE,
                         squid_curtime - http->storeEntry()->timestamp);
             /* Signal old objects.  NB: rfc 2616 is not clear,