]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
HEAD fixes (damn I hate HEAD)
authorwessels <>
Wed, 16 Sep 1998 04:05:10 +0000 (04:05 +0000)
committerwessels <>
Wed, 16 Sep 1998 04:05:10 +0000 (04:05 +0000)
on the server-side, HEAD transfers are always done soon as we make it
to the end of the reply headers

on the client-side, we can't do IMS for HEAD.  Always return cache HITS,
never a refresh.

httpMaybeRemovePublic() gets bastardized already (thanks henrik).  Also
make it remove HEAD objects for new GET requests.

src/client_side.cc

index 630ebfc16d894e214d495cb8b97ac143bd02bc0e..421a2acb11f02d6cd7435c5c90f47e18c8bb9eb6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.396 1998/09/15 20:24:07 wessels Exp $
+ * $Id: client_side.cc,v 1.397 1998/09/15 22:05:10 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1133,6 +1133,15 @@ clientCacheHit(void *data, char *buf, ssize_t size)
     if (checkNegativeHit(e)) {
        http->log_type = LOG_TCP_NEGATIVE_HIT;
        clientSendMoreData(data, buf, size);
+    } else if (r->method == METHOD_HEAD) {
+       /*
+        * RFC 2068 seems to indicate there is no "conditional HEAD"
+        * request.  We cannot validate a cached object for a HEAD
+        * request, nor can we return 304.
+        */
+       if (e->mem_status == IN_MEMORY)
+           http->log_type = LOG_TCP_MEM_HIT;
+       clientSendMoreData(data, buf, size);
     } else if (refreshCheck(e, r, 0) && !http->flags.internal) {
        /*
         * We hold a stale copy; it needs to be validated