Revision: 14414
Author: adrian.chadd
Date: Tue Feb 16 20:47:04 2010
Log: Migrate clientCheckRangeForceMiss() out of client_side.c


http://code.google.com/p/lusca-cache/source/detail?r=14414

Modified:
 /branches/LUSCA_HEAD/src/client_side.c
 /branches/LUSCA_HEAD/src/client_side_ranges.c
 /branches/LUSCA_HEAD/src/client_side_ranges.h

=======================================
--- /branches/LUSCA_HEAD/src/client_side.c      Tue Feb 16 20:08:37 2010
+++ /branches/LUSCA_HEAD/src/client_side.c      Tue Feb 16 20:47:04 2010
@@ -2396,42 +2396,6 @@
http->entry = clientCreateStoreEntry(http, r->method, null_request_flags);
     errorAppendEntry(http->entry, err);
 }
-
-/*
- * Return true if we should force a cache miss on this range request.
- * entry must be non-NULL.
- */
-static int
-clientCheckRangeForceMiss(StoreEntry * entry, HttpHdrRange * range)
-{
-    /*
-     * If the range_offset_limit is NOT in effect, there
-     * is no reason to force a miss.
-     */
-    if (0 == httpHdrRangeOffsetLimit(range))
-       return 0;
-    /*
-     * Here, we know it's possibly a hit.  If we already have the
-     * whole object cached, we won't force a miss.
-     */
-    if (STORE_OK == entry->store_status)
-       return 0;               /* we have the whole object */
-    /*
-     * Now we have a hit on a PENDING object.  We need to see
-     * if the part we want is already cached.  If so, we don't
-     * force a miss.
-     */
-    assert(NULL != entry->mem_obj);
-    if (httpHdrRangeFirstOffset(range) <= entry->mem_obj->inmem_hi)
-       return 0;
-    /*
-     * Even though we have a PENDING copy of the object, we
-     * don't want to wait to reach the first range offset,
-     * so we force a miss for a new range request to the
-     * origin.
-     */
-    return 1;
-}

 static log_type
 clientProcessRequest2(clientHttpRequest * http)
=======================================
--- /branches/LUSCA_HEAD/src/client_side_ranges.c       Thu Feb 11 08:12:47 2010
+++ /branches/LUSCA_HEAD/src/client_side_ranges.c       Tue Feb 16 20:47:04 2010
@@ -315,3 +315,39 @@
     }
 }

+/*
+ * Return true if we should force a cache miss on this range request.
+ * entry must be non-NULL.
+ */
+int
+clientCheckRangeForceMiss(StoreEntry * entry, HttpHdrRange * range)
+{
+    /*
+     * If the range_offset_limit is NOT in effect, there
+     * is no reason to force a miss.
+     */
+    if (0 == httpHdrRangeOffsetLimit(range))
+        return 0;
+    /*
+     * Here, we know it's possibly a hit.  If we already have the
+     * whole object cached, we won't force a miss.
+     */
+    if (STORE_OK == entry->store_status)
+        return 0;               /* we have the whole object */
+    /*
+     * Now we have a hit on a PENDING object.  We need to see
+     * if the part we want is already cached.  If so, we don't
+     * force a miss.
+     */
+    assert(NULL != entry->mem_obj);
+    if (httpHdrRangeFirstOffset(range) <= entry->mem_obj->inmem_hi)
+        return 0;
+    /*
+     * Even though we have a PENDING copy of the object, we
+     * don't want to wait to reach the first range offset,
+     * so we force a miss for a new range request to the
+     * origin.
+     */
+    return 1;
+}
+
=======================================
--- /branches/LUSCA_HEAD/src/client_side_ranges.h       Thu Feb 11 08:12:47 2010
+++ /branches/LUSCA_HEAD/src/client_side_ranges.h       Tue Feb 16 20:47:04 2010
@@ -8,5 +8,6 @@
extern int clientCanPackMoreRanges(const clientHttpRequest * http, HttpHdrRangeIter * i, size_t size); extern int clientPackMoreRanges(clientHttpRequest * http, const char *buf, size_t size, MemBuf * mb); extern void clientBuildRangeHeader(clientHttpRequest * http, HttpReply * rep); +extern int clientCheckRangeForceMiss(StoreEntry * entry, HttpHdrRange * range);

 #endif

--
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en.

Reply via email to