]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Shared Rock::DirMap version 9.
authorDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Tue, 1 Feb 2011 07:14:17 +0000 (10:14 +0300)
committerDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Tue, 1 Feb 2011 07:14:17 +0000 (10:14 +0300)
src/fs/rock/RockSwapDir.cc

index e1779c917c9019aac9b1334635c181d5532be96d..0267721142d565d4b2c1ce27b4349e2363452daa 100644 (file)
@@ -41,6 +41,9 @@ Rock::SwapDir::search(String const url, HttpRequest *)
 StoreEntry *
 Rock::SwapDir::get(const cache_key *key)
 {
+    if (!map)
+        return NULL;
+
     sfileno fileno;
     const StoreEntryBasics *const basics = map->openForReading(key, fileno);
     if (!basics)
@@ -319,6 +322,12 @@ Rock::SwapDir::canStore(const StoreEntry &e) const
     if (EBIT_TEST(e.flags, ENTRY_SPECIAL))
         return -1;
 
+    if (!theFile || !theFile->canRead() || !theFile->canWrite())
+        return -1;
+
+    if (!map)
+        return -1;
+
     if (io->shedLoad())
         return -1;
 
@@ -509,6 +518,9 @@ Rock::SwapDir::diskFull() {
 void
 Rock::SwapDir::maintain()
 {
+    if (!map)
+        return;
+
     debugs(47,3, HERE << "cache_dir[" << index << "] guards: " << 
         StoreController::store_dirs_rebuilding << !repl << !full());