From: hno <> Date: Thu, 16 Aug 2007 19:46:20 +0000 (+0000) Subject: Glue to deal better with >2GB objects on 32-bit file platforms incapable of storing... X-Git-Tag: SQUID_3_0_PRE7~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5aecb102c37f94bade22b1018e21fa20021360c6;p=thirdparty%2Fsquid.git Glue to deal better with >2GB objects on 32-bit file platforms incapable of storing them --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index f2cdd3c3d0..204e261482 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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; diff --git a/src/store_swapout.cc b/src/store_swapout.cc index 25fc6a685d..ca32fa5a52 100644 --- a/src/store_swapout.cc +++ b/src/store_swapout.cc @@ -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; }