]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Glue to deal better with >2GB objects on 32-bit file platforms incapable of storing...
authorhno <>
Thu, 16 Aug 2007 19:46:20 +0000 (19:46 +0000)
committerhno <>
Thu, 16 Aug 2007 19:46:20 +0000 (19:46 +0000)
src/cache_cf.cc
src/store_swapout.cc

index f2cdd3c3d01ef2bd0b91ad51a1d23c5bf5dec1b0..204e2614821d19449703d2117f68735c4bc0f5da 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.517 2007/08/13 18:35:24 hno Exp $
+ * $Id: cache_cf.cc,v 1.518 2007/08/16 13:46:20 hno Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -356,6 +356,12 @@ configDoConfigure(void)
     if (Config.cacheSwap.swapDirs == NULL)
         fatal("No cache_dir's specified in config file");
 
+#if SIZEOF_OFF_T <= 4
+    if (Config.Store.maxObjectSize > 0x7FFF0000) {
+       debugs(3, 0, "WARNING: This Squid binary can not handle files larger than 2GB. Limiting maximum_object_size to just below 2GB");
+       Config.Store.maxObjectSize = 0x7FFF0000;
+    }
+#endif
     if (0 == Store::Root().maxSize())
         /* people might want a zero-sized cache on purpose */
         (void) 0;
index 25fc6a685dc401de234629805bf3adc0ed8ca9c6..ca32fa5a52c18070ab36906357369a08c3bc9155 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapout.cc,v 1.118 2007/08/13 17:20:51 hno Exp $
+ * $Id: store_swapout.cc,v 1.119 2007/08/16 13:46:20 hno Exp $
  *
  * DEBUG: section 20    Storage Manager Swapout Functions
  * AUTHOR: Duane Wessels
@@ -224,10 +224,10 @@ StoreEntry::swapOut()
     }
 
     trimMemory();
-#if SIZEOF_INT64_T == 4
+#if SIZEOF_OFF_T <= 4
 
     if (mem_obj->endOffset() > 0x7FFF0000) {
-        debugs(20, 0, "WARNING: preventing int64_t overflow for %s\n", url());
+        debugs(20, 0, "WARNING: preventing off_t overflow for %s\n", url());
         abort();
         return;
     }