]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make client attaching while an object is being swapped in disk clients
authorHenrik Nordstrom <henrik@henriknordstrom.net>
Mon, 27 Jul 2009 22:03:12 +0000 (00:03 +0200)
committerHenrik Nordstrom <henrik@henriknordstrom.net>
Mon, 27 Jul 2009 22:03:12 +0000 (00:03 +0200)
so they can do the swapin if needed.

src/store.cc

index ca7f0565595af87584d6e9186516bf8e626d3a55..dc3b80bdaa0bf1aa74b43ab4d374004e7b7825d6 100644 (file)
@@ -313,11 +313,18 @@ StoreEntry::storeClientType() const
     if (store_status == STORE_OK) {
         /* the object has completed. */
 
-        if (mem_obj->inmem_lo == 0 && !isEmpty())
-            /* hot object */
-            return STORE_MEM_CLIENT;
-        else
-            return STORE_DISK_CLIENT;
+        if (mem_obj->inmem_lo == 0 && !isEmpty()) {
+           if (swap_status == SWAPOUT_DONE) {
+               if (mem_obj->endOffset() == mem_obj->object_sz) {
+                   /* hot object fully swapped in */
+                   return STORE_MEM_CLIENT;
+               }
+           } else {
+               /* Memory-only, or currently being swapped out */
+               return STORE_MEM_CLIENT;
+           }
+       }
+       return STORE_DISK_CLIENT;
     }
 
     /* here and past, entry is STORE_PENDING */