--------------------- PatchSet 4747 Date: 2007/06/18 20:59:33 Author: chtsanti Branch: squid3-largeobj Tag: (none) Log: This patch adds the required changes to suppport (1) range requests and headers for large objects (2) storing of large objects in cache (using the "--with-large-files" configuration option) - It is to difficult to explain all changes in details. All changes are type conversions from 32bit integers to 64bit integers - Added functions are: StringToInt64a (Parsing.cc file) parseBytesLine64, dump_b_int64_t, parse_b_int64_t, free_b_int64_t (cache_cf.cc file) - Also the size method of Range template class changed from: size_t Range::size() to C Range::size() This is because it is used in range headers in which the size can be bigger than the maximum value of size_t. It also make sense the size of a range of 32bit integers to be 32bit integer and the range of 64bit integers to be a 64bit integer Members: include/Range.h:1.7->1.7.10.1 src/BodyPipe.cc:1.2.10.1->1.2.10.2 src/BodyPipe.h:1.2->1.2.10.1 src/HttpHdrContRange.cc:1.3.26.3->1.3.26.4 src/HttpHdrContRange.h:1.4->1.4.10.1 src/HttpHdrRange.cc:1.13.10.2->1.13.10.3 src/HttpHeaderRange.h:1.9->1.9.10.1 src/HttpHeaderTools.cc:1.21.6.5->1.21.6.6 src/HttpMsg.h:1.14.6.2->1.14.6.3 src/HttpReply.cc:1.38.6.4->1.38.6.5 src/HttpReply.h:1.18.10.2->1.18.10.3 src/HttpRequest.cc:1.38.2.1->1.38.2.2 src/HttpRequest.h:1.26->1.26.2.1 src/MemObject.h:1.13.10.2->1.13.10.3 src/Parsing.cc:1.3->1.3.6.1 src/Parsing.h:1.3->1.3.6.1 src/Server.cc:1.6.6.3->1.6.6.4 src/Store.h:1.27.2.5->1.27.2.6 src/StoreHashIndex.h:1.2->1.2.16.1 src/StoreSwapLogData.h:1.3->1.3.22.1 src/SwapDir.cc:1.8.2.3->1.8.2.4 src/SwapDir.h:1.12->1.12.10.1 src/cache_cf.cc:1.79.4.2->1.79.4.3 src/cf.data.pre:1.117->1.117.2.1 src/client_side.cc:1.121.2.8->1.121.2.9 src/fde.cc:1.6.6.2->1.6.6.3 src/globals.h:1.31->1.31.4.1 src/http.cc:1.99.4.7->1.99.4.8 src/peer_digest.cc:1.27.6.3->1.27.6.4 src/store.cc:1.53.2.7->1.53.2.8 src/store_client.cc:1.29.2.7->1.29.2.8 src/store_digest.cc:1.18.10.4->1.18.10.5 src/store_dir.cc:1.21.2.2->1.21.2.3 src/structs.h:1.106->1.106.2.1 src/ICAP/ChunkedCodingParser.cc:1.4->1.4.6.1 src/ICAP/ChunkedCodingParser.h:1.2->1.2.20.1 src/ICAP/ICAPModXact.cc:1.19.6.3->1.19.6.4 src/ICAP/ICAPModXact.h:1.6.6.1->1.6.6.2 src/fs/coss/CossSwapDir.h:1.6->1.6.10.1 src/fs/coss/store_coss.h:1.14->1.14.6.1 src/fs/coss/store_dir_coss.cc:1.30.6.3->1.30.6.4 src/fs/coss/store_io_coss.cc:1.12.10.3->1.12.10.4 src/fs/ufs/store_dir_ufs.cc:1.28.6.3->1.28.6.4 src/fs/ufs/ufscommon.cc:1.8.6.2->1.8.6.3 src/fs/ufs/ufscommon.h:1.9->1.9.6.1 src/tests/stub_HttpReply.cc:1.3.10.2->1.3.10.3 src/tests/stub_HttpRequest.cc:1.3->1.3.10.1 Index: squid3/include/Range.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/include/Range.h,v retrieving revision 1.7 retrieving revision 1.7.10.1 diff -u -r1.7 -r1.7.10.1 --- squid3/include/Range.h 23 Apr 2006 11:27:37 -0000 1.7 +++ squid3/include/Range.h 18 Jun 2007 20:59:33 -0000 1.7.10.1 @@ -1,6 +1,6 @@ /* - * $Id: Range.h,v 1.7 2006/04/23 11:27:37 squidadm Exp $ + * $Id: Range.h,v 1.7.10.1 2007/06/18 20:59:33 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -50,7 +50,7 @@ C start; C end; Range intersection (Range const &) const; - size_t size() const; + C size() const; }; template @@ -75,7 +75,7 @@ } template -size_t +C Range::size() const { return end > start ? end - start : 0; Index: squid3/src/BodyPipe.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/BodyPipe.cc,v retrieving revision 1.2.10.1 retrieving revision 1.2.10.2 diff -u -r1.2.10.1 -r1.2.10.2 --- squid3/src/BodyPipe.cc 9 May 2007 07:36:17 -0000 1.2.10.1 +++ squid3/src/BodyPipe.cc 18 Jun 2007 20:59:34 -0000 1.2.10.2 @@ -43,7 +43,7 @@ theBuf.clean(); } -void BodyPipe::setBodySize(size_t aBodySize) +void BodyPipe::setBodySize(uint64_t aBodySize) { assert(!bodySizeKnown()); assert(aBodySize >= 0); @@ -58,13 +58,13 @@ debugs(91,7, HERE << "set body size" << status()); } -size_t BodyPipe::bodySize() const +uint64_t BodyPipe::bodySize() const { assert(bodySizeKnown()); - return static_cast(theBodySize); + return static_cast(theBodySize); } -bool BodyPipe::expectMoreAfter(size_t offset) const +bool BodyPipe::expectMoreAfter(uint64_t offset) const { assert(theGetSize <= offset); return offset < thePutSize || // buffer has more now or @@ -290,9 +290,9 @@ buf.append(" [", 2); - buf.Printf("%d<=%d", (int)theGetSize, (int)thePutSize); + buf.Printf("%"PRId64"<=%"PRId64, (int64_t)theGetSize, (int64_t)thePutSize); if (theBodySize >= 0) - buf.Printf("<=%d", (int)theBodySize); + buf.Printf("<=%"PRId64, theBodySize); else buf.append("<=?", 3); Index: squid3/src/BodyPipe.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/BodyPipe.h,v retrieving revision 1.2 retrieving revision 1.2.10.1 diff -u -r1.2 -r1.2.10.1 --- squid3/src/BodyPipe.h 6 Apr 2007 04:50:40 -0000 1.2 +++ squid3/src/BodyPipe.h 18 Jun 2007 20:59:34 -0000 1.2.10.1 @@ -52,7 +52,7 @@ public: BodyPipe &pipe; MemBuf &buf; - const size_t offset; // of current content, relative to the body start + const uint64_t offset; // of current content, relative to the body start protected: const size_t checkedOutSize; @@ -81,10 +81,10 @@ BodyPipe(Producer *aProducer); ~BodyPipe(); // asserts that producer and consumer are cleared - void setBodySize(size_t aSize); // set body size + void setBodySize(uint64_t aSize); // set body size bool bodySizeKnown() const { return theBodySize >= 0; } - size_t bodySize() const; - size_t consumedSize() const { return theGetSize; } + uint64_t bodySize() const; + uint64_t consumedSize() const { return theGetSize; } bool productionEnded() const { return !theProducer; } // called by producers @@ -99,7 +99,7 @@ void clearConsumer(); // aborts if still piping size_t getMoreData(MemBuf &buf); void consume(size_t size); - bool expectMoreAfter(size_t offset) const; + bool expectMoreAfter(uint64_t offset) const; bool exhausted() const; // saw eof/abort and all data consumed // start or continue consuming when there is no consumer @@ -140,12 +140,12 @@ AsyncCallWrapper(91,5, BodyPipe, tellBodyProducerAborted); private: - ssize_t theBodySize; // expected total content length, if known + int64_t theBodySize; // expected total content length, if known Producer *theProducer; // content producer, if any Consumer *theConsumer; // content consumer, if any - size_t thePutSize; // ever-increasing total - size_t theGetSize; // ever-increasing total + uint64_t thePutSize; // ever-increasing total + uint64_t theGetSize; // ever-increasing total MemBuf theBuf; // produced but not yet consumed content, if any Index: squid3/src/HttpHdrContRange.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpHdrContRange.cc,v retrieving revision 1.3.26.3 retrieving revision 1.3.26.4 diff -u -r1.3.26.3 -r1.3.26.4 --- squid3/src/HttpHdrContRange.cc 7 May 2007 17:06:13 -0000 1.3.26.3 +++ squid3/src/HttpHdrContRange.cc 18 Jun 2007 20:59:34 -0000 1.3.26.4 @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrContRange.cc,v 1.3.26.3 2007/05/07 17:06:13 dwsquid Exp $ + * $Id: HttpHdrContRange.cc,v 1.3.26.4 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: section 68 HTTP Content-Range Header * AUTHOR: Alex Rousskov @@ -81,16 +81,16 @@ } /* parse offset */ - if (!httpHeaderParseSize(field, &spec->offset)) + if (!httpHeaderParseOffset(field, &spec->offset)) return 0; p++; /* do we have last-pos ? */ if (p - field < flen) { - ssize_t last_pos; + int64_t last_pos; - if (!httpHeaderParseSize(p, &last_pos)) + if (!httpHeaderParseOffset(p, &last_pos)) return 0; spec->length = size_diff(last_pos + 1, spec->offset); @@ -100,7 +100,7 @@ assert (spec->length >= 0); /* we managed to parse, check if the result makes sence */ - if (known_spec((size_t)spec->length) && spec->length == 0) { + if (known_spec(spec->length) && spec->length == 0) { debugs(68, 2, "invalid range (" << spec->offset << " += " << (long int) spec->length << ") in resp-range-spec near: '" << field << "'"); return 0; @@ -115,11 +115,11 @@ /* Ensure typecast is safe */ assert (spec->length >= 0); - if (!known_spec((size_t)spec->offset) || !known_spec((size_t)spec->length)) + if (!known_spec(spec->offset) || !known_spec(spec->length)) packerPrintf(p, "*"); else - packerPrintf(p, "bytes %ld-%ld", - (long int) spec->offset, (long int) spec->offset + spec->length - 1); + packerPrintf(p, "bytes %"PRId64"-%"PRId64, + spec->offset, spec->offset + spec->length - 1); } /* @@ -175,7 +175,7 @@ if (*p == '*') range->elength = range_spec_unknown; - else if (!httpHeaderParseSize(p, &range->elength)) + else if (!httpHeaderParseOffset(p, &range->elength)) return 0; debugs(68, 8, "parsed content-range field: " << @@ -211,14 +211,14 @@ /* Ensure typecast is safe */ assert (range->elength >= 0); - if (!known_spec((size_t)range->elength)) + if (!known_spec(range->elength)) packerPrintf(p, "/*"); else - packerPrintf(p, "/%ld", (long int) range->elength); + packerPrintf(p, "/%"PRId64, range->elength); } void -httpHdrContRangeSet(HttpHdrContRange * cr, HttpHdrRangeSpec spec, ssize_t ent_len) +httpHdrContRangeSet(HttpHdrContRange * cr, HttpHdrRangeSpec spec, int64_t ent_len) { assert(cr && ent_len >= 0); cr->spec = spec; Index: squid3/src/HttpHdrContRange.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpHdrContRange.h,v retrieving revision 1.4 retrieving revision 1.4.10.1 diff -u -r1.4 -r1.4.10.1 --- squid3/src/HttpHdrContRange.h 23 Apr 2006 11:27:37 -0000 1.4 +++ squid3/src/HttpHdrContRange.h 18 Jun 2007 20:59:34 -0000 1.4.10.1 @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrContRange.h,v 1.4 2006/04/23 11:27:37 squidadm Exp $ + * $Id: HttpHdrContRange.h,v 1.4.10.1 2007/06/18 20:59:34 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -43,7 +43,7 @@ public: HttpHdrRangeSpec spec; - ssize_t elength; /* entity length, not content length */ + int64_t elength; /* entity length, not content length */ }; /* Http Content Range Header Field */ @@ -55,9 +55,9 @@ SQUIDCEXTERN HttpHdrContRange *httpHdrContRangeDup(const HttpHdrContRange * crange); SQUIDCEXTERN void httpHdrContRangePackInto(const HttpHdrContRange * crange, Packer * p); /* inits with given spec */ -SQUIDCEXTERN void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, ssize_t); +SQUIDCEXTERN void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, int64_t); ; -SQUIDCEXTERN void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, ssize_t); +SQUIDCEXTERN void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, int64_t); #endif /* SQUID_HTTPHDRCONTRANGE_H */ Index: squid3/src/HttpHdrRange.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpHdrRange.cc,v retrieving revision 1.13.10.2 retrieving revision 1.13.10.3 diff -u -r1.13.10.2 -r1.13.10.3 --- squid3/src/HttpHdrRange.cc 1 May 2007 21:03:42 -0000 1.13.10.2 +++ squid3/src/HttpHdrRange.cc 18 Jun 2007 20:59:34 -0000 1.13.10.3 @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrRange.cc,v 1.13.10.2 2007/05/01 21:03:42 dwsquid Exp $ + * $Id: HttpHdrRange.cc,v 1.13.10.3 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: section 64 HTTP Range Header * AUTHOR: Alex Rousskov @@ -63,7 +63,7 @@ /* globals */ size_t HttpHdrRange::ParsedCount = 0; -ssize_t const HttpHdrRangeSpec::UnknownPosition = -1; +int64_t const HttpHdrRangeSpec::UnknownPosition = -1; /* * Range-Spec @@ -93,7 +93,7 @@ /* is it a suffix-byte-range-spec ? */ if (*field == '-') { - if (!httpHeaderParseSize(field + 1, &length)) + if (!httpHeaderParseOffset(field + 1, &length)) return false; } else /* must have a '-' somewhere in _this_ field */ @@ -101,16 +101,16 @@ debugs(64, 2, "ignoring invalid (missing '-') range-spec near: '" << field << "'"); return false; } else { - if (!httpHeaderParseSize(field, &offset)) + if (!httpHeaderParseOffset(field, &offset)) return false; p++; /* do we have last-pos ? */ if (p - field < flen) { - ssize_t last_pos; + int64_t last_pos; - if (!httpHeaderParseSize(p, &last_pos)) + if (!httpHeaderParseOffset(p, &last_pos)) return false; HttpHdrRangeSpec::HttpRange aSpec (offset, last_pos + 1); @@ -132,20 +132,20 @@ HttpHdrRangeSpec::packInto(Packer * packer) const { if (!known_spec(offset)) /* suffix */ - packerPrintf(packer, "-%ld", (long int) length); + packerPrintf(packer, "-%"PRId64, length); else if (!known_spec(length)) /* trailer */ - packerPrintf(packer, "%ld-", (long int) offset); + packerPrintf(packer, "%"PRId64"-", offset); else /* range */ - packerPrintf(packer, "%ld-%ld", - (long int) offset, (long int) offset + length - 1); + packerPrintf(packer, "%"PRId64"-%"PRId64, + offset, offset + length - 1); } void HttpHdrRangeSpec::outputInfo( char const *note) const { debugs(64, 5, "HttpHdrRangeSpec::canonize: " << note << ": [" << - (long int) offset << ", " << (long int) offset + length << - ") len: " << (long int) length); + offset << ", " << offset + length << + ") len: " << length); } /* fills "absent" positions in range specification based on response body size @@ -153,7 +153,7 @@ * range is valid if its intersection with [0,length-1] is not empty */ int -HttpHdrRangeSpec::canonize(size_t clen) +HttpHdrRangeSpec::canonize(int64_t clen) { outputInfo ("have"); HttpRange object(0, clen); @@ -190,8 +190,8 @@ bool merged (false); #if MERGING_BREAKS_NOTHING /* Note: this code works, but some clients may not like its effects */ - size_t rhs = offset + length; /* no -1 ! */ - const size_t donor_rhs = donor->offset + donor->length; /* no -1 ! */ + uint64_t rhs = offset + length; /* no -1 ! */ + const uint64_t donor_rhs = donor->offset + donor->length; /* no -1 ! */ assert(known_spec(offset)); assert(known_spec(donor->offset)); assert(length > 0); @@ -402,7 +402,7 @@ } int -HttpHdrRange::canonize (size_t newClen) +HttpHdrRange::canonize (int64_t newClen) { clen = newClen; debugs(64, 3, "HttpHdrRange::canonize: started with " << specs.count << @@ -420,7 +420,7 @@ bool HttpHdrRange::isComplex() const { - size_t offset = 0; + uint64_t offset = 0; assert(this); /* check that all rangers are in "strong" order */ const_iterator pos (begin()); @@ -429,7 +429,7 @@ /* Ensure typecasts is safe */ assert ((*pos)->offset >= 0); - if ((unsigned int)(*pos)->offset < offset) + if ((uint64_t)(*pos)->offset < offset) return 1; offset = (*pos)->offset + (*pos)->length; @@ -450,7 +450,7 @@ assert(this); /* check that all rangers are in "strong" order, */ /* as far as we can tell without the content length */ - size_t offset = 0; + uint64_t offset = 0; for (const_iterator pos (begin()); pos != end(); ++pos) { if (!known_spec((*pos)->offset)) /* ignore unknowns */ @@ -459,7 +459,7 @@ /* Ensure typecasts is safe */ assert ((*pos)->offset >= 0); - if ((size_t) (*pos)->offset < offset) + if ((uint64_t) (*pos)->offset < offset) return true; offset = (*pos)->offset; @@ -476,10 +476,10 @@ * or HttpHdrRangeSpec::UnknownPosition * this is used for size limiting */ -ssize_t +int64_t HttpHdrRange::firstOffset() const { - ssize_t offset = HttpHdrRangeSpec::UnknownPosition; + int64_t offset = HttpHdrRangeSpec::UnknownPosition; assert(this); const_iterator pos = begin(); @@ -499,15 +499,15 @@ * ranges are combined into one, for example FTP REST. * Use 0 for size if unknown */ -ssize_t -HttpHdrRange::lowestOffset(ssize_t size) const +int64_t +HttpHdrRange::lowestOffset(int64_t size) const { - ssize_t offset = HttpHdrRangeSpec::UnknownPosition; + int64_t offset = HttpHdrRangeSpec::UnknownPosition; const_iterator pos = begin(); assert(this); while (pos != end()) { - ssize_t current = (*pos)->offset; + int64_t current = (*pos)->offset; if (!known_spec(current)) { if ((*pos)->length > size || !known_spec((*pos)->length)) @@ -546,7 +546,7 @@ /* tail request */ return true; - if ((ssize_t)Config.rangeOffsetLimit >= firstOffset()) + if ((int64_t)Config.rangeOffsetLimit >= firstOffset()) /* below the limit */ return false; @@ -590,14 +590,14 @@ } } -ssize_t +int64_t HttpHdrRangeIter::debt() const { debugs(64, 3, "HttpHdrRangeIter::debt: debt is " << debt_size); return debt_size; } -void HttpHdrRangeIter::debt(ssize_t newDebt) +void HttpHdrRangeIter::debt(int64_t newDebt) { debugs(64, 3, "HttpHdrRangeIter::debt: was " << debt_size << " now " << newDebt); debt_size = newDebt; Index: squid3/src/HttpHeaderRange.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpHeaderRange.h,v retrieving revision 1.9 retrieving revision 1.9.10.1 diff -u -r1.9 -r1.9.10.1 --- squid3/src/HttpHeaderRange.h 6 Jun 2006 19:50:39 -0000 1.9 +++ squid3/src/HttpHeaderRange.h 18 Jun 2007 20:59:34 -0000 1.9.10.1 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeaderRange.h,v 1.9 2006/06/06 19:50:39 squidadm Exp $ + * $Id: HttpHeaderRange.h,v 1.9.10.1 2007/06/18 20:59:34 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -48,19 +48,19 @@ public: MEMPROXY_CLASS(HttpHdrRangeSpec); - typedef Range HttpRange; - static ssize_t const UnknownPosition; + typedef Range HttpRange; + static int64_t const UnknownPosition; HttpHdrRangeSpec(); static HttpHdrRangeSpec *Create(const char *field, int fieldLen); bool parseInit(const char *field, int flen); - int canonize(size_t clen); + int canonize(int64_t clen); void outputInfo( char const *note) const; void packInto(Packer * p) const; bool mergeWith(const HttpHdrRangeSpec * donor); - ssize_t offset; - ssize_t length; + int64_t offset; + int64_t length; }; MEMPROXY_CLASS_INLINE(HttpHdrRangeSpec) @@ -93,7 +93,7 @@ const_iterator end() const; /* adjust specs after the length is known */ - int canonize(size_t); + int canonize(int64_t); int canonize(HttpReply *rep); /* returns true if ranges are valid; inits HttpHdrRange */ bool parseInit(const String * range_spec); @@ -101,8 +101,8 @@ /* other */ bool isComplex() const; bool willBeComplex() const; - ssize_t firstOffset() const; - ssize_t lowestOffset(ssize_t) const; + int64_t firstOffset() const; + int64_t lowestOffset(int64_t) const; bool offsetLimitExceeded() const; bool contains(HttpHdrRangeSpec& r) const; Vector specs; @@ -110,7 +110,7 @@ private: void getCanonizedSpecs (Vector ©); void merge (Vector &basis); - ssize_t clen; + int64_t clen; }; MEMPROXY_CLASS_INLINE(HttpHdrRange) @@ -124,9 +124,9 @@ HttpHdrRange::iterator pos; const HttpHdrRangeSpec *currentSpec() const; void updateSpec(); - ssize_t debt() const; - void debt(ssize_t); - ssize_t debt_size; /* bytes left to send from the current spec */ + int64_t debt() const; + void debt(int64_t); + int64_t debt_size; /* bytes left to send from the current spec */ String boundary; /* boundary for multipart responses */ bool valid; }; Index: squid3/src/HttpHeaderTools.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpHeaderTools.cc,v retrieving revision 1.21.6.5 retrieving revision 1.21.6.6 diff -u -r1.21.6.5 -r1.21.6.6 --- squid3/src/HttpHeaderTools.cc 9 May 2007 07:36:17 -0000 1.21.6.5 +++ squid3/src/HttpHeaderTools.cc 18 Jun 2007 20:59:34 -0000 1.21.6.6 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeaderTools.cc,v 1.21.6.5 2007/05/09 07:36:17 dwsquid Exp $ + * $Id: HttpHeaderTools.cc,v 1.21.6.6 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: section 66 HTTP Header Tools * AUTHOR: Alex Rousskov @@ -143,7 +143,7 @@ /* wrapper arrounf PutContRange */ void -httpHeaderAddContRange(HttpHeader * hdr, HttpHdrRangeSpec spec, ssize_t ent_len) +httpHeaderAddContRange(HttpHeader * hdr, HttpHdrRangeSpec spec, int64_t ent_len) { HttpHdrContRange *cr = httpHdrContRangeCreate(); assert(hdr && ent_len >= 0); Index: squid3/src/HttpMsg.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpMsg.h,v retrieving revision 1.14.6.2 retrieving revision 1.14.6.3 diff -u -r1.14.6.2 -r1.14.6.3 --- squid3/src/HttpMsg.h 19 Apr 2007 04:43:38 -0000 1.14.6.2 +++ squid3/src/HttpMsg.h 18 Jun 2007 20:59:34 -0000 1.14.6.3 @@ -1,6 +1,6 @@ /* - * $Id: HttpMsg.h,v 1.14.6.2 2007/04/19 04:43:38 dwsquid Exp $ + * $Id: HttpMsg.h,v 1.14.6.3 2007/06/18 20:59:34 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -86,7 +86,7 @@ virtual int httpMsgParseError(); - virtual bool expectingBody(method_t, ssize_t&) const = 0; + virtual bool expectingBody(method_t, int64_t&) const = 0; void firstLineBuf(MemBuf&); Index: squid3/src/HttpReply.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpReply.cc,v retrieving revision 1.38.6.4 retrieving revision 1.38.6.5 diff -u -r1.38.6.4 -r1.38.6.5 --- squid3/src/HttpReply.cc 20 Apr 2007 22:53:46 -0000 1.38.6.4 +++ squid3/src/HttpReply.cc 18 Jun 2007 20:59:34 -0000 1.38.6.5 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.cc,v 1.38.6.4 2007/04/20 22:53:46 dwsquid Exp $ + * $Id: HttpReply.cc,v 1.38.6.5 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -414,7 +414,7 @@ /* * Returns the body size of a HTTP response */ -int +int64_t HttpReply::bodySize(method_t method) const { if (sline.version.major < 1) @@ -469,7 +469,7 @@ * along with this response */ bool -HttpReply::expectingBody(method_t req_method, ssize_t& theSize) const +HttpReply::expectingBody(method_t req_method, int64_t& theSize) const { bool expectBody = true; Index: squid3/src/HttpReply.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpReply.h,v retrieving revision 1.18.10.2 retrieving revision 1.18.10.3 diff -u -r1.18.10.2 -r1.18.10.3 --- squid3/src/HttpReply.h 19 Apr 2007 04:45:16 -0000 1.18.10.2 +++ squid3/src/HttpReply.h 18 Jun 2007 20:59:34 -0000 1.18.10.3 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.h,v 1.18.10.2 2007/04/19 04:45:16 dwsquid Exp $ + * $Id: HttpReply.h,v 1.18.10.3 2007/06/18 20:59:34 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -97,7 +97,7 @@ public: virtual int httpMsgParseError(); - virtual bool expectingBody(method_t, ssize_t&) const; + virtual bool expectingBody(method_t, int64_t&) const; void updateOnNotModified(HttpReply const *other); @@ -116,7 +116,7 @@ void redirect(http_status, const char *); - int bodySize(method_t) const; + int64_t bodySize(method_t) const; int validatorsMatch (HttpReply const *other) const; Index: squid3/src/HttpRequest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpRequest.cc,v retrieving revision 1.38.2.1 retrieving revision 1.38.2.2 diff -u -r1.38.2.1 -r1.38.2.2 --- squid3/src/HttpRequest.cc 30 Apr 2007 17:08:09 -0000 1.38.2.1 +++ squid3/src/HttpRequest.cc 18 Jun 2007 20:59:34 -0000 1.38.2.2 @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.cc,v 1.38.2.1 2007/04/30 17:08:09 dwsquid Exp $ + * $Id: HttpRequest.cc,v 1.38.2.2 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: section 73 HTTP Request * AUTHOR: Duane Wessels @@ -373,7 +373,7 @@ * along with this request */ bool -HttpRequest::expectingBody(method_t unused, ssize_t& theSize) const +HttpRequest::expectingBody(method_t unused, int64_t& theSize) const { bool expectBody = false; Index: squid3/src/HttpRequest.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpRequest.h,v retrieving revision 1.26 retrieving revision 1.26.2.1 diff -u -r1.26 -r1.26.2.1 --- squid3/src/HttpRequest.h 16 Apr 2007 18:04:49 -0000 1.26 +++ squid3/src/HttpRequest.h 18 Jun 2007 20:59:34 -0000 1.26.2.1 @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.h,v 1.26 2007/04/16 18:04:49 squidadm Exp $ + * $Id: HttpRequest.h,v 1.26.2.1 2007/06/18 20:59:34 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -135,7 +135,7 @@ int parseHeader(const char *parse_start, int len); - virtual bool expectingBody(method_t unused, ssize_t&) const; + virtual bool expectingBody(method_t unused, int64_t&) const; bool bodyNibbled() const; // the request has a [partially] consumed body Index: squid3/src/MemObject.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/MemObject.h,v retrieving revision 1.13.10.2 retrieving revision 1.13.10.3 diff -u -r1.13.10.2 -r1.13.10.3 --- squid3/src/MemObject.h 20 Apr 2007 22:53:46 -0000 1.13.10.2 +++ squid3/src/MemObject.h 18 Jun 2007 20:59:34 -0000 1.13.10.3 @@ -1,6 +1,6 @@ /* - * $Id: MemObject.h,v 1.13.10.2 2007/04/20 22:53:46 dwsquid Exp $ + * $Id: MemObject.h,v 1.13.10.3 2007/06/18 20:59:34 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -130,7 +130,7 @@ char *log_url; RemovalPolicyNode repl; int id; - ssize_t object_sz; + int64_t object_sz; size_t swap_hdr_sz; #if URL_CHECKSUM_DEBUG Index: squid3/src/Parsing.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Parsing.cc,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -r1.3 -r1.3.6.1 --- squid3/src/Parsing.cc 8 Oct 2006 13:51:46 -0000 1.3 +++ squid3/src/Parsing.cc 18 Jun 2007 20:59:34 -0000 1.3.6.1 @@ -1,6 +1,6 @@ /* - * $Id: Parsing.cc,v 1.3 2006/10/08 13:51:46 squidadm Exp $ + * $Id: Parsing.cc,v 1.3.6.1 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -125,3 +125,23 @@ return false; } + +bool +StringToInt64(const char *s, int64_t &result, const char **p, int base) +{ + if (s) { + char *ptr = 0; + const int64_t h = (int64_t) strtoll(s, &ptr, base); + + if (ptr != s && ptr) { + result = h; + + if (p) + *p = ptr; + + return true; + } + } + + return false; +} Index: squid3/src/Parsing.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Parsing.h,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -r1.3 -r1.3.6.1 --- squid3/src/Parsing.h 8 Oct 2006 13:51:46 -0000 1.3 +++ squid3/src/Parsing.h 18 Jun 2007 20:59:34 -0000 1.3.6.1 @@ -1,6 +1,6 @@ /* - * $Id: Parsing.h,v 1.3 2006/10/08 13:51:46 squidadm Exp $ + * $Id: Parsing.h,v 1.3.6.1 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -47,5 +47,6 @@ // on success, returns true and sets *p (if any) to the end of the integer extern bool StringToInt(const char *str, int &result, const char **p, int base); +extern bool StringToInt64(const char *str, int64_t &result, const char **p, int base); #endif /* SQUID_PARSING_H */ Index: squid3/src/Server.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Server.cc,v retrieving revision 1.6.6.3 retrieving revision 1.6.6.4 diff -u -r1.6.6.3 -r1.6.6.4 --- squid3/src/Server.cc 9 May 2007 07:36:17 -0000 1.6.6.3 +++ squid3/src/Server.cc 18 Jun 2007 20:59:34 -0000 1.6.6.4 @@ -1,5 +1,5 @@ /* - * $Id: Server.cc,v 1.6.6.3 2007/05/09 07:36:17 dwsquid Exp $ + * $Id: Server.cc,v 1.6.6.4 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: * AUTHOR: Duane Wessels @@ -316,7 +316,7 @@ assert(!virginBodyDestination); assert(!reply->body_pipe); // start body pipe to feed ICAP transaction if needed - ssize_t size = 0; + int64_t size = 0; if (reply->expectingBody(cause->method, size) && size) { virginBodyDestination = new BodyPipe(this); reply->body_pipe = virginBodyDestination; Index: squid3/src/Store.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Store.h,v retrieving revision 1.27.2.5 retrieving revision 1.27.2.6 diff -u -r1.27.2.5 -r1.27.2.6 --- squid3/src/Store.h 23 Apr 2007 06:19:30 -0000 1.27.2.5 +++ squid3/src/Store.h 18 Jun 2007 20:59:34 -0000 1.27.2.6 @@ -1,6 +1,6 @@ /* - * $Id: Store.h,v 1.27.2.5 2007/04/23 06:19:30 dwsquid Exp $ + * $Id: Store.h,v 1.27.2.6 2007/06/18 20:59:34 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -127,7 +127,7 @@ time_t lastref; time_t expires; time_t lastmod; - size_t swap_file_sz; + uint64_t swap_file_sz; u_short refcount; u_short flags; /* END OF ON-DISK STORE_META_STD */ @@ -178,7 +178,7 @@ /* reduce the memory lock count on the entry */ virtual int unlock(); /* increate the memory lock count on the entry */ - virtual ssize_t objectLen() const; + virtual int64_t objectLen() const; virtual int64_t contentLen() const; virtual void lock() @@ -292,7 +292,7 @@ virtual void maintain() = 0; /* perform regular maintenance should be private and self registered ... */ /* These should really be private */ - virtual void updateSize(size_t size, int sign) = 0; + virtual void updateSize(int64_t size, int sign) = 0; private: static RefCount CurrentRoot; Index: squid3/src/StoreHashIndex.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/StoreHashIndex.h,v retrieving revision 1.2 retrieving revision 1.2.16.1 diff -u -r1.2 -r1.2.16.1 --- squid3/src/StoreHashIndex.h 4 Jul 2005 02:14:11 -0000 1.2 +++ squid3/src/StoreHashIndex.h 18 Jun 2007 20:59:34 -0000 1.2.16.1 @@ -1,6 +1,6 @@ /* - * $Id: StoreHashIndex.h,v 1.2 2005/07/04 02:14:11 squidadm Exp $ + * $Id: StoreHashIndex.h,v 1.2.16.1 2007/06/18 20:59:34 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -75,7 +75,7 @@ virtual void maintain(); - virtual void updateSize(size_t, int); + virtual void updateSize(int64_t, int); virtual StoreSearch *search(String const url, HttpRequest *); Index: squid3/src/StoreSwapLogData.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/StoreSwapLogData.h,v retrieving revision 1.3 retrieving revision 1.3.22.1 diff -u -r1.3 -r1.3.22.1 --- squid3/src/StoreSwapLogData.h 31 Aug 2004 02:14:26 -0000 1.3 +++ squid3/src/StoreSwapLogData.h 18 Jun 2007 20:59:34 -0000 1.3.22.1 @@ -1,6 +1,6 @@ /* - * $Id: StoreSwapLogData.h,v 1.3 2004/08/31 02:14:26 squidadm Exp $ + * $Id: StoreSwapLogData.h,v 1.3.22.1 2007/06/18 20:59:34 chtsanti Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -57,7 +57,7 @@ time_t lastref; time_t expires; time_t lastmod; - size_t swap_file_sz; + uint64_t swap_file_sz; u_short refcount; u_short flags; unsigned char key[MD5_DIGEST_CHARS]; Index: squid3/src/SwapDir.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/SwapDir.cc,v retrieving revision 1.8.2.3 retrieving revision 1.8.2.4 diff -u -r1.8.2.3 -r1.8.2.4 --- squid3/src/SwapDir.cc 1 May 2007 21:03:42 -0000 1.8.2.3 +++ squid3/src/SwapDir.cc 18 Jun 2007 20:59:34 -0000 1.8.2.4 @@ -1,6 +1,6 @@ /* - * $Id: SwapDir.cc,v 1.8.2.3 2007/05/01 21:03:42 dwsquid Exp $ + * $Id: SwapDir.cc,v 1.8.2.4 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: section 20 Swap Dir base object * AUTHOR: Robert Collins @@ -245,7 +245,7 @@ if (!value) self_destruct(); - ssize_t size = xatoi(value); + int64_t size = strtoll(value, NULL, 10); if (reconfiguring && max_objsize != size) debugs(3, 1, "Cache dir '" << path << "' max object size now " << size); @@ -259,7 +259,7 @@ SwapDir::optionMaxSizeDump(StoreEntry * e) const { if (max_objsize != -1) - storeAppendPrintf(e, " max-size=%ld", (long int) max_objsize); + storeAppendPrintf(e, " max-size=%"PRId64, max_objsize); } /* Swapdirs do not have an index of their own - thus they ask their parent.. Index: squid3/src/SwapDir.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/SwapDir.h,v retrieving revision 1.12 retrieving revision 1.12.10.1 diff -u -r1.12 -r1.12.10.1 --- squid3/src/SwapDir.h 21 Aug 2006 01:51:49 -0000 1.12 +++ squid3/src/SwapDir.h 18 Jun 2007 20:59:34 -0000 1.12.10.1 @@ -1,6 +1,6 @@ /* - * $Id: SwapDir.h,v 1.12 2006/08/21 01:51:49 squidadm Exp $ + * $Id: SwapDir.h,v 1.12.10.1 2007/06/18 20:59:34 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -80,7 +80,7 @@ virtual void dereference(StoreEntry &); /* Unreference this object */ - virtual void updateSize(size_t size, int sign); + virtual void updateSize(int64_t size, int sign); /* the number of store dirs being rebuilt. */ static int store_dirs_rebuilding; @@ -142,7 +142,7 @@ virtual void stat (StoreEntry &anEntry) const; virtual StoreSearch *search(String const url, HttpRequest *) = 0; - virtual void updateSize(size_t size, int sign); + virtual void updateSize(int64_t size, int sign); /* migrated from store_dir.cc */ bool objectSizeIsAcceptable(ssize_t objsize) const; @@ -164,7 +164,7 @@ int max_size; char *path; int index; /* This entry's index into the swapDirs array */ - ssize_t max_objsize; + int64_t max_objsize; RemovalPolicy *repl; int removals; int scanned; Index: squid3/src/cache_cf.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/cache_cf.cc,v retrieving revision 1.79.4.2 retrieving revision 1.79.4.3 diff -u -r1.79.4.2 -r1.79.4.3 --- squid3/src/cache_cf.cc 30 Apr 2007 17:08:10 -0000 1.79.4.2 +++ squid3/src/cache_cf.cc 18 Jun 2007 20:59:34 -0000 1.79.4.3 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.79.4.2 2007/04/30 17:08:10 dwsquid Exp $ + * $Id: cache_cf.cc,v 1.79.4.3 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -144,6 +144,7 @@ #endif #endif /* USE_SSL */ static void parse_b_size_t(size_t * var); +static void parse_b_int64_t(int64_t * var); /* * LegacyParser is a parser for legacy code that uses the global @@ -163,7 +164,7 @@ update_maxobjsize(void) { int i; - ssize_t ms = -1; + int64_t ms = -1; for (i = 0; i < Config.cacheSwap.n_configured; i++) { assert (Config.cacheSwap.swapDirs[i].getRaw()); @@ -172,7 +173,6 @@ max_objsize > ms) ms = dynamic_cast(Config.cacheSwap.swapDirs[i].getRaw())->max_objsize; } - store_maxobjsize = ms; } @@ -701,12 +701,51 @@ } static void +parseBytesLine64(int64_t * bptr, const char *units) +{ + char *token; + double d; + int64_t m; + int64_t u; + + if ((u = parseBytesUnits(units)) == 0) + self_destruct(); + + if ((token = strtok(NULL, w_space)) == NULL) + self_destruct(); + + if (strcmp(token, "none") == 0 || strcmp(token, "-1") == 0) { + *bptr = static_cast(-1); + return; + } + + d = xatof(token); + + m = u; /* default to 'units' if none specified */ + + if (0.0 == d) + (void) 0; + else if ((token = strtok(NULL, w_space)) == NULL) + debugs(3, 0, "WARNING: No units on '" << + config_input_line << "', assuming " << + d << " " << units ); + else if ((m = parseBytesUnits(token)) == 0) + self_destruct(); + + *bptr = static_cast(m * d / u); + + if (static_cast(*bptr) * 2 != m * d / u * 2) + self_destruct(); +} + + +static void parseBytesLine(size_t * bptr, const char *units) { char *token; double d; - size_t m; - size_t u; + int m; + int u; if ((u = parseBytesUnits(units)) == 0) self_destruct(); @@ -1029,7 +1068,7 @@ l = cbdataAlloc(acl_size_t); - parse_b_size_t(&l->size); + parse_b_int64_t(&l->size); aclParseAclList(LegacyParser, &l->aclList); @@ -2287,6 +2326,12 @@ } static void +dump_b_int64_t(StoreEntry * entry, const char *name, int64_t var) +{ + storeAppendPrintf(entry, "%s %"PRId64" %s\n", name, var, B_BYTES_STR); +} + +static void parse_size_t(size_t * var) { int i; @@ -2301,6 +2346,12 @@ } static void +parse_b_int64_t(int64_t * var) +{ + parseBytesLine64(var, B_BYTES_STR); +} + +static void parse_kb_size_t(size_t * var) { parseBytesLine(var, B_KBYTES_STR); @@ -2312,6 +2363,12 @@ *var = 0; } +static void +free_b_int64_t(int64_t * var) +{ + *var = 0; +} + #define free_b_size_t free_size_t #define free_kb_size_t free_size_t #define free_mb_size_t free_size_t Index: squid3/src/cf.data.pre =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/cf.data.pre,v retrieving revision 1.117 retrieving revision 1.117.2.1 diff -u -r1.117 -r1.117.2.1 --- squid3/src/cf.data.pre 16 Apr 2007 23:06:16 -0000 1.117 +++ squid3/src/cf.data.pre 18 Jun 2007 20:59:34 -0000 1.117.2.1 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.117 2007/04/16 23:06:16 squidadm Exp $ +# $Id: cf.data.pre,v 1.117.2.1 2007/06/18 20:59:34 chtsanti Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -936,7 +936,7 @@ NAME: maximum_object_size COMMENT: (bytes) -TYPE: b_size_t +TYPE: b_int64_t DEFAULT: 4096 KB LOC: Config.Store.maxObjectSize DOC_START @@ -954,7 +954,7 @@ NAME: minimum_object_size COMMENT: (bytes) -TYPE: b_size_t +TYPE: b_int64_t DEFAULT: 0 KB LOC: Config.Store.minObjectSize DOC_START Index: squid3/src/client_side.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side.cc,v retrieving revision 1.121.2.8 retrieving revision 1.121.2.9 diff -u -r1.121.2.8 -r1.121.2.9 --- squid3/src/client_side.cc 1 May 2007 21:03:42 -0000 1.121.2.8 +++ squid3/src/client_side.cc 18 Jun 2007 20:59:34 -0000 1.121.2.9 @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.121.2.8 2007/05/01 21:03:42 dwsquid Exp $ + * $Id: client_side.cc,v 1.121.2.9 2007/06/18 20:59:34 chtsanti Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -755,7 +755,8 @@ size_t ClientSocketContext::lengthToSend(Range const &available) { - size_t maximum = available.size(); + /*the size of available range can always fit in a size_t type*/ + size_t maximum = (size_t)available.size(); if (!http->request->range) return maximum; @@ -768,10 +769,10 @@ assert (http->range_iter.debt() > 0); /* TODO this + the last line could be a range intersection calculation */ - if ((ssize_t)available.start < http->range_iter.currentSpec()->offset) + if (available.start < http->range_iter.currentSpec()->offset) return 0; - return XMIN(http->range_iter.debt(), (ssize_t)maximum); + return XMIN(http->range_iter.debt(), (int64_t)maximum); } void @@ -965,7 +966,7 @@ int ClientHttpRequest::mRangeCLen() { - int clen = 0; + int64_t clen = 0; MemBuf mb; assert(memObject()); @@ -1115,7 +1116,7 @@ request->range->contains(rep->content_range->spec) : true; const int spec_count = http->request->range->specs.count; - int actual_clen = -1; + int64_t actual_clen = -1; debugs(33, 3, "clientBuildRangeHeader: range spec count: " << spec_count << " virgin clen: " << rep->content_length); Index: squid3/src/fde.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fde.cc,v retrieving revision 1.6.6.2 retrieving revision 1.6.6.3 diff -u -r1.6.6.2 -r1.6.6.3 --- squid3/src/fde.cc 1 May 2007 16:31:53 -0000 1.6.6.2 +++ squid3/src/fde.cc 18 Jun 2007 20:59:35 -0000 1.6.6.3 @@ -1,6 +1,6 @@ /* - * $Id: fde.cc,v 1.6.6.2 2007/05/01 16:31:53 dwsquid Exp $ + * $Id: fde.cc,v 1.6.6.3 2007/06/18 20:59:35 chtsanti Exp $ * * DEBUG: none FDE * AUTHOR: Robert Collins @@ -60,7 +60,7 @@ fdNumber, win32.handle, #else - storeAppendPrintf(&dumpEntry, "%4d %-6.6s %4d %"PRId64"%c %"PRId64"%c %-21s %s\n", + storeAppendPrintf(&dumpEntry, "%4d %-6.6s %4d %7"PRId64"%c %7"PRId64"%c %-21s %s\n", fdNumber, #endif fdTypeStr[type], Index: squid3/src/globals.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/globals.h,v retrieving revision 1.31 retrieving revision 1.31.4.1 diff -u -r1.31 -r1.31.4.1 --- squid3/src/globals.h 15 Apr 2007 15:00:41 -0000 1.31 +++ squid3/src/globals.h 18 Jun 2007 20:59:35 -0000 1.31.4.1 @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.31 2007/04/15 15:00:41 squidadm Exp $ + * $Id: globals.h,v 1.31.4.1 2007/06/18 20:59:35 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -156,7 +156,7 @@ extern int store_swap_low; /* 0 */ extern int store_swap_high; /* 0 */ extern size_t store_pages_max; /* 0 */ - extern ssize_t store_maxobjsize; /* -1 */ + extern int64_t store_maxobjsize; /* -1 */ extern hash_table *proxy_auth_username_cache; /* NULL */ extern int incoming_sockets_accepted; #ifdef _SQUID_MSWIN_ Index: squid3/src/http.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/http.cc,v retrieving revision 1.99.4.7 retrieving revision 1.99.4.8 diff -u -r1.99.4.7 -r1.99.4.8 --- squid3/src/http.cc 9 May 2007 07:36:18 -0000 1.99.4.7 +++ squid3/src/http.cc 18 Jun 2007 20:59:35 -0000 1.99.4.8 @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.99.4.7 2007/05/09 07:36:18 dwsquid Exp $ + * $Id: http.cc,v 1.99.4.8 2007/06/18 20:59:35 chtsanti Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -920,7 +920,7 @@ if (!flags.headers_parsed) return INCOMPLETE_MSG; - const int clen = reply->bodySize(request->method); + const int64_t clen = reply->bodySize(request->method); debugs(11, 5, "persistentConnStatus: clen=" << clen); @@ -932,7 +932,7 @@ if (clen > 0) { // old technique: // if (entry->mem_obj->endOffset() < reply->content_length + reply->hdr_sz) - const int body_bytes_read = reply_bytes_read - header_bytes_read; + const int64_t body_bytes_read = reply_bytes_read - header_bytes_read; debugs(11,5, "persistentConnStatus: body_bytes_read=" << body_bytes_read << " content_length=" << reply->content_length); Index: squid3/src/peer_digest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/peer_digest.cc,v retrieving revision 1.27.6.3 retrieving revision 1.27.6.4 diff -u -r1.27.6.3 -r1.27.6.4 --- squid3/src/peer_digest.cc 1 May 2007 21:03:43 -0000 1.27.6.3 +++ squid3/src/peer_digest.cc 18 Jun 2007 20:59:35 -0000 1.27.6.4 @@ -1,6 +1,6 @@ /* - * $Id: peer_digest.cc,v 1.27.6.3 2007/05/01 21:03:43 dwsquid Exp $ + * $Id: peer_digest.cc,v 1.27.6.4 2007/06/18 20:59:35 chtsanti Exp $ * * DEBUG: section 72 Peer Digest Routines * AUTHOR: Alex Rousskov @@ -787,7 +787,7 @@ if (!reason && !size) { if (!pd->cd) reason = "null digest?!"; - else if (fetch->mask_offset != (off_t)pd->cd->mask_size) + else if (fetch->mask_offset != (int)pd->cd->mask_size) reason = "premature end of digest?!"; else if (!peerDigestUseful(pd)) reason = "useless digest"; Index: squid3/src/store.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store.cc,v retrieving revision 1.53.2.7 retrieving revision 1.53.2.8 diff -u -r1.53.2.7 -r1.53.2.8 --- squid3/src/store.cc 9 May 2007 07:36:19 -0000 1.53.2.7 +++ squid3/src/store.cc 18 Jun 2007 20:59:35 -0000 1.53.2.8 @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.53.2.7 2007/05/09 07:36:19 dwsquid Exp $ + * $Id: store.cc,v 1.53.2.8 2007/06/18 20:59:35 chtsanti Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -940,11 +940,10 @@ if (STORE_OK == store_status) if (mem_obj->object_sz < 0 || - static_cast(mem_obj->object_sz) - < Config.Store.minObjectSize) + mem_obj->object_sz < Config.Store.minObjectSize) return 1; if (getReply()->content_length > -1) - if (getReply()->content_length < (int) Config.Store.minObjectSize) + if (getReply()->content_length < Config.Store.minObjectSize) return 1; return 0; } @@ -970,12 +969,12 @@ store_check_cachable_hist.no.negative_cached++; return 0; /* avoid release call below */ } else if ((getReply()->content_length > 0 && - static_cast(getReply()->content_length) + getReply()->content_length > Config.Store.maxObjectSize) || - static_cast(mem_obj->endOffset()) > Config.Store.maxObjectSize) { + mem_obj->endOffset() > Config.Store.maxObjectSize) { debugs(20, 2, "StoreEntry::checkCachable: NO: too big"); store_check_cachable_hist.no.too_big++; - } else if (getReply()->content_length > (int) Config.Store.maxObjectSize) { + } else if (getReply()->content_length > Config.Store.maxObjectSize) { debugs(20, 2, "StoreEntry::checkCachable: NO: too big"); store_check_cachable_hist.no.too_big++; } else if (checkTooSmall()) { @@ -1356,7 +1355,7 @@ bool StoreEntry::validLength() const { - int diff; + int64_t diff; const HttpReply *reply; assert(mem_obj != NULL); reply = getReply(); @@ -1659,7 +1658,7 @@ } } -ssize_t +int64_t StoreEntry::objectLen() const { assert(mem_obj != NULL); Index: squid3/src/store_client.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store_client.cc,v retrieving revision 1.29.2.7 retrieving revision 1.29.2.8 diff -u -r1.29.2.7 -r1.29.2.8 --- squid3/src/store_client.cc 1 May 2007 21:03:44 -0000 1.29.2.7 +++ squid3/src/store_client.cc 18 Jun 2007 20:59:35 -0000 1.29.2.8 @@ -1,6 +1,6 @@ /* - * $Id: store_client.cc,v 1.29.2.7 2007/05/01 21:03:44 dwsquid Exp $ + * $Id: store_client.cc,v 1.29.2.8 2007/06/18 20:59:35 chtsanti Exp $ * * DEBUG: section 90 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -229,7 +229,7 @@ assert (data); assert(!EBIT_TEST(entry->flags, ENTRY_ABORTED)); debugs(90, 3, "store_client::copy: " << entry->getMD5Text() << ", from " << - (unsigned long) copyRequest.offset << ", for length " << + copyRequest.offset << ", for length " << (int) copyRequest.length << ", cb " << callback_fn << ", cbdata " << data); @@ -341,8 +341,8 @@ MemObject *mem = entry->mem_obj; debugs(33, 5, "store_client::doCopy: co: " << - (unsigned long) copyInto.offset << ", hi: " << - (long int) mem->endOffset()); + copyInto.offset << ", hi: " << + mem->endOffset()); if (storeClientNoMoreToSend(entry, this)) { /* There is no more to send! */ @@ -581,7 +581,7 @@ */ size_t body_sz = len - mem->swap_hdr_sz; - if (static_cast(copyInto.offset) < body_sz) { + if (copyInto.offset < static_cast(body_sz)) { /* * we have (part of) what they want */ @@ -837,8 +837,8 @@ output->Printf("\tClient #%d, %p\n", clientNumber, _callback.callback_data); - output->Printf("\t\tcopy_offset: %lu\n", - (unsigned long) copyInto.offset); + output->Printf("\t\tcopy_offset: %"PRId64"\n", + copyInto.offset); output->Printf("\t\tcopy_size: %d\n", (int) copyInto.length); Index: squid3/src/store_digest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store_digest.cc,v retrieving revision 1.18.10.4 retrieving revision 1.18.10.5 diff -u -r1.18.10.4 -r1.18.10.5 --- squid3/src/store_digest.cc 1 May 2007 21:03:44 -0000 1.18.10.4 +++ squid3/src/store_digest.cc 18 Jun 2007 20:59:35 -0000 1.18.10.5 @@ -1,6 +1,6 @@ /* - * $Id: store_digest.cc,v 1.18.10.4 2007/05/01 21:03:44 dwsquid Exp $ + * $Id: store_digest.cc,v 1.18.10.5 2007/06/18 20:59:35 chtsanti Exp $ * * DEBUG: section 71 Store Digest Manager * AUTHOR: Alex Rousskov @@ -247,7 +247,7 @@ } /* do not digest huge objects */ - if (e->swap_file_sz > Config.Store.maxObjectSize) { + if (e->swap_file_sz > (uint64_t )Config.Store.maxObjectSize) { debugs(71, 6, "storeDigestAddable: NO: too big"); return 0; } Index: squid3/src/store_dir.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store_dir.cc,v retrieving revision 1.21.2.2 retrieving revision 1.21.2.3 diff -u -r1.21.2.2 -r1.21.2.3 --- squid3/src/store_dir.cc 30 Apr 2007 17:08:17 -0000 1.21.2.2 +++ squid3/src/store_dir.cc 18 Jun 2007 20:59:36 -0000 1.21.2.3 @@ -1,6 +1,6 @@ /* - * $Id: store_dir.cc,v 1.21.2.2 2007/04/30 17:08:17 dwsquid Exp $ + * $Id: store_dir.cc,v 1.21.2.3 2007/06/18 20:59:36 chtsanti Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -330,13 +330,13 @@ } void -StoreController::updateSize(size_t size, int sign) +StoreController::updateSize(int64_t size, int sign) { fatal("StoreController has no independent size\n"); } void -SwapDir::updateSize(size_t size, int sign) +SwapDir::updateSize(int64_t size, int sign) { int blks = (size + fs.blksize - 1) / fs.blksize; int k = (blks * fs.blksize >> 10) * sign; @@ -882,7 +882,7 @@ } void -StoreHashIndex::updateSize(size_t, int) +StoreHashIndex::updateSize(int64_t, int) {} void Index: squid3/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/structs.h,v retrieving revision 1.106 retrieving revision 1.106.2.1 diff -u -r1.106 -r1.106.2.1 --- squid3/src/structs.h 16 Apr 2007 18:05:01 -0000 1.106 +++ squid3/src/structs.h 18 Jun 2007 20:59:36 -0000 1.106.2.1 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.106 2007/04/16 18:05:01 squidadm Exp $ + * $Id: structs.h,v 1.106.2.1 2007/06/18 20:59:36 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -107,7 +107,7 @@ { acl_size_t *next; acl_list *aclList; - size_t size; + int64_t size; }; struct _ushortlist @@ -476,8 +476,8 @@ { int objectsPerBucket; size_t avgObjectSize; - size_t maxObjectSize; - size_t minObjectSize; + int64_t maxObjectSize; + int64_t minObjectSize; size_t maxInMemObjSize; } Index: squid3/src/ICAP/ChunkedCodingParser.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ChunkedCodingParser.cc,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -r1.4 -r1.4.6.1 --- squid3/src/ICAP/ChunkedCodingParser.cc 6 Apr 2007 12:54:14 -0000 1.4 +++ squid3/src/ICAP/ChunkedCodingParser.cc 18 Jun 2007 20:59:36 -0000 1.4.6.1 @@ -66,10 +66,10 @@ if (findCrlf(crlfBeg, crlfEnd)) { debugs(93,7, "found chunk-size end: " << crlfBeg << "-" << crlfEnd); - int size = -1; + int64_t size = -1; const char *p = 0; - if (StringToInt(theIn->content(), size, &p, 16)) { + if (StringToInt64(theIn->content(), size, &p, 16)) { if (size < 0) { throw TexcHere("negative chunk size"); return; @@ -104,7 +104,7 @@ { Must(theLeftBodySize > 0); // Should, really - const size_t availSize = XMIN(theLeftBodySize, (size_t)theIn->contentSize()); + const size_t availSize = XMIN(theLeftBodySize, (uint64_t)theIn->contentSize()); const size_t safeSize = XMIN(availSize, (size_t)theOut->potentialSpaceSize()); doNeedMoreData = availSize < theLeftBodySize; Index: squid3/src/ICAP/ChunkedCodingParser.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ChunkedCodingParser.h,v retrieving revision 1.2 retrieving revision 1.2.20.1 diff -u -r1.2 -r1.2.20.1 --- squid3/src/ICAP/ChunkedCodingParser.h 22 Nov 2005 03:13:08 -0000 1.2 +++ squid3/src/ICAP/ChunkedCodingParser.h 18 Jun 2007 20:59:36 -0000 1.2.20.1 @@ -1,6 +1,6 @@ /* - * $Id: ChunkedCodingParser.h,v 1.2 2005/11/22 03:13:08 squidadm Exp $ + * $Id: ChunkedCodingParser.h,v 1.2.20.1 2007/06/18 20:59:36 chtsanti Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -82,8 +82,8 @@ MemBuf *theOut; Step theStep; - size_t theChunkSize; - size_t theLeftBodySize; + uint64_t theChunkSize; + uint64_t theLeftBodySize; bool doNeedMoreData; }; Index: squid3/src/ICAP/ICAPModXact.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPModXact.cc,v retrieving revision 1.19.6.3 retrieving revision 1.19.6.4 diff -u -r1.19.6.3 -r1.19.6.4 --- squid3/src/ICAP/ICAPModXact.cc 9 May 2007 07:36:19 -0000 1.19.6.3 +++ squid3/src/ICAP/ICAPModXact.cc 18 Jun 2007 20:59:36 -0000 1.19.6.4 @@ -330,20 +330,20 @@ { Must(act.active()); // asbolute start of unprocessed data - const size_t start = act.offset(); + const uint64_t start = act.offset(); // absolute end of buffered data - const size_t end = virginConsumed + virgin.body_pipe->buf().contentSize(); + const uint64_t end = virginConsumed + virgin.body_pipe->buf().contentSize(); Must(virginConsumed <= start && start <= end); - return end - start; + return static_cast(end - start); } // pointer to buffered virgin body data available for the specified activity const char *ICAPModXact::virginContentData(const VirginBodyAct &act) const { Must(act.active()); - const size_t start = act.offset(); + const uint64_t start = act.offset(); Must(virginConsumed <= start); - return virgin.body_pipe->buf().content() + (start-virginConsumed); + return virgin.body_pipe->buf().content() + static_cast(start-virginConsumed); } void ICAPModXact::virginConsume() @@ -356,8 +356,8 @@ BodyPipe &bp = *virgin.body_pipe; const size_t have = static_cast(bp.buf().contentSize()); - const size_t end = virginConsumed + have; - size_t offset = end; + const uint64_t end = virginConsumed + have; + uint64_t offset = end; if (virginBodyWriting.active()) offset = XMIN(virginBodyWriting.offset(), offset); @@ -367,7 +367,7 @@ Must(virginConsumed <= offset && offset <= end); - if (const size_t size = offset - virginConsumed) { + if (const size_t size = static_cast(offset - virginConsumed)) { debugs(93, 8, HERE << "consuming " << size << " out of " << have << " virgin body bytes"); bp.consume(size); @@ -1109,7 +1109,7 @@ ad = 0; else if (virginBody.knownSize()) - ad = XMIN(ad, virginBody.size()); // not more than we have + ad = XMIN(static_cast(ad), virginBody.size()); // not more than we have debugs(93, 5, "ICAPModXact should offer " << ad << "-byte preview " << "(service wanted " << wantedSize << ")"); @@ -1261,7 +1261,7 @@ else method = METHOD_NONE; - ssize_t size; + int64_t size; // expectingBody returns true for zero-sized bodies, but we will not // get a pipe for that body, so we treat the message as bodyless if (method != METHOD_NONE && msg->expectingBody(method, size) && size) { @@ -1301,9 +1301,9 @@ : theData(dtUnexpected) {} -void SizedEstimate::expect(ssize_t aSize) +void SizedEstimate::expect(int64_t aSize) { - theData = (aSize >= 0) ? aSize : (ssize_t)dtUnknown; + theData = (aSize >= 0) ? aSize : (int64_t)dtUnknown; } bool SizedEstimate::expected() const @@ -1317,10 +1317,10 @@ return theData != dtUnknown; } -size_t SizedEstimate::size() const +uint64_t SizedEstimate::size() const { Must(knownSize()); - return static_cast(theData); + return static_cast(theData); } @@ -1343,13 +1343,13 @@ { Must(active()); Must(size >= 0); - theStart += static_cast(size); + theStart += static_cast(size); } -size_t VirginBodyAct::offset() const +uint64_t VirginBodyAct::offset() const { Must(active()); - return static_cast(theStart); + return static_cast(theStart); } Index: squid3/src/ICAP/ICAPModXact.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPModXact.h,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.2 diff -u -r1.6.6.1 -r1.6.6.2 --- squid3/src/ICAP/ICAPModXact.h 9 May 2007 07:36:19 -0000 1.6.6.1 +++ squid3/src/ICAP/ICAPModXact.h 18 Jun 2007 20:59:36 -0000 1.6.6.2 @@ -1,6 +1,6 @@ /* - * $Id: ICAPModXact.h,v 1.6.6.1 2007/05/09 07:36:19 dwsquid Exp $ + * $Id: ICAPModXact.h,v 1.6.6.2 2007/06/18 20:59:36 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -59,17 +59,17 @@ public: SizedEstimate(); // not expected by default - void expect(ssize_t aSize); // expect with any, even unknown size + void expect(int64_t aSize); // expect with any, even unknown size bool expected() const; /* other members can be accessed iff expected() */ bool knownSize() const; - size_t size() const; // can be accessed iff knownSize() + uint64_t size() const; // can be accessed iff knownSize() private: enum { dtUnexpected = -2, dtUnknown = -1 }; - ssize_t theData; // combines expectation and size info to save RAM + int64_t theData; // combines expectation and size info to save RAM }; // Virgin body may be used for two activities: (a) writing preview or prime @@ -89,11 +89,11 @@ // methods below require active() - size_t offset() const; // the absolute beginning of not-yet-acted-on data + uint64_t offset() const; // the absolute beginning of not-yet-acted-on data void progress(size_t size); // note processed body bytes private: - ssize_t theStart; // offset, unless negative. + int64_t theStart; // offset, unless negative. }; @@ -240,7 +240,7 @@ SizedEstimate virginBody; VirginBodyAct virginBodyWriting; // virgin body writing state VirginBodyAct virginBodySending; // virgin body sending state - size_t virginConsumed; // virgin data consumed so far + uint64_t virginConsumed; // virgin data consumed so far ICAPPreview preview; // use for creating (writing) the preview ChunkedCodingParser *bodyParser; // ICAP response body parser Index: squid3/src/fs/coss/CossSwapDir.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/CossSwapDir.h,v retrieving revision 1.6 retrieving revision 1.6.10.1 diff -u -r1.6 -r1.6.10.1 --- squid3/src/fs/coss/CossSwapDir.h 23 May 2006 00:45:42 -0000 1.6 +++ squid3/src/fs/coss/CossSwapDir.h 18 Jun 2007 20:59:36 -0000 1.6.10.1 @@ -73,9 +73,9 @@ unsigned int blksz_mask; /* just 1< theFile; - char *storeCossMemPointerFromDiskOffset(size_t offset, CossMemBuf ** mb); + char *storeCossMemPointerFromDiskOffset(off_t offset, CossMemBuf ** mb); void storeCossMemBufUnlock(StoreIOState::Pointer); - CossMemBuf *createMemBuf(size_t start, sfileno curfn, int *collision); + CossMemBuf *createMemBuf(off_t start, sfileno curfn, int *collision); sfileno allocate(const StoreEntry * e, int which); void startMembuf(); Index: squid3/src/fs/coss/store_coss.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_coss.h,v retrieving revision 1.14 retrieving revision 1.14.6.1 diff -u -r1.14 -r1.14.6.1 --- squid3/src/fs/coss/store_coss.h 19 Sep 2006 08:52:40 -0000 1.14 +++ squid3/src/fs/coss/store_coss.h 18 Jun 2007 20:59:36 -0000 1.14.6.1 @@ -24,8 +24,8 @@ void maybeWrite(CossSwapDir * SD); void write(CossSwapDir * SD); dlink_node node; - size_t diskstart; /* in blocks */ - size_t diskend; /* in blocks */ + off_t diskstart; /* in blocks */ + off_t diskend; /* in blocks */ CossSwapDir *SD; int lockcount; char buffer[COSS_MEMBUF_SZ]; @@ -61,7 +61,7 @@ char *requestbuf; size_t requestlen; size_t requestoffset; /* in blocks */ - sfileno reqdiskoffset; /* in blocks */ + int64_t reqdiskoffset; /* in blocks */ struct { @@ -76,7 +76,7 @@ flags; CossMemBuf *locked_membuf; - size_t st_size; + off_t st_size; void read_(char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data); void write(char const *buf, size_t size, off_t offset, FREE * free_func); void close(); Index: squid3/src/fs/coss/store_dir_coss.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_dir_coss.cc,v retrieving revision 1.30.6.3 retrieving revision 1.30.6.4 diff -u -r1.30.6.3 -r1.30.6.4 --- squid3/src/fs/coss/store_dir_coss.cc 1 May 2007 21:03:44 -0000 1.30.6.3 +++ squid3/src/fs/coss/store_dir_coss.cc 18 Jun 2007 20:59:36 -0000 1.30.6.4 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.30.6.3 2007/05/01 21:03:44 dwsquid Exp $ + * $Id: store_dir_coss.cc,v 1.30.6.4 2007/06/18 20:59:36 chtsanti Exp $ * vim: set et : * * DEBUG: section 47 Store COSS Directory Routines @@ -81,7 +81,7 @@ static EVH storeCossRebuildFromSwapLog; static StoreEntry *storeCossAddDiskRestore(CossSwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + uint64_t swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -514,7 +514,7 @@ static StoreEntry * storeCossAddDiskRestore(CossSwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + uint64_t swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -1034,7 +1034,7 @@ { unsigned int i; unsigned int size; - unsigned long max_offset; + off_t max_offset; i = GetInteger(); size = i << 10; /* Mbytes to Kbytes */ @@ -1066,9 +1066,9 @@ * largest possible sfileno, assuming sfileno is a 25-bit * signed integer, as defined in structs.h. */ - max_offset = (unsigned long) 0xFFFFFF << blksz_bits; + max_offset = (off_t) 0xFFFFFF << blksz_bits; - if ((unsigned long)max_size > (unsigned long)(max_offset>>10)) { + if ((off_t)max_size > (max_offset>>10)) { debugs(47, 0, "COSS block-size = " << (1<swap_dirn = index; sio->swap_filen = allocate(&e, COSS_ALLOC_ALLOCATE); debugs(79, 3, "storeCossCreate: offset " << - (long int) storeCossFilenoToDiskOffset(sio->swap_filen) << + storeCossFilenoToDiskOffset(sio->swap_filen) << ", size " << (long int) cstate->st_size << ", end " << - (long int) (sio->swap_filen + cstate->st_size)); + (sio->swap_filen + cstate->st_size)); /* assume allocate() always succeeds */ assert(-1 != sio->swap_filen); @@ -431,7 +431,7 @@ } char * -CossSwapDir::storeCossMemPointerFromDiskOffset(size_t offset, CossMemBuf ** mb) +CossSwapDir::storeCossMemPointerFromDiskOffset(off_t offset, CossMemBuf ** mb) { CossMemBuf *t; dlink_node *m; @@ -539,7 +539,7 @@ } CossMemBuf * -CossSwapDir::createMemBuf(size_t start, sfileno curfn, int *collision) +CossSwapDir::createMemBuf(off_t start, sfileno curfn, int *collision) { CossMemBuf *newmb; CossMemBuf *t; Index: squid3/src/fs/ufs/store_dir_ufs.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/ufs/store_dir_ufs.cc,v retrieving revision 1.28.6.3 retrieving revision 1.28.6.4 diff -u -r1.28.6.3 -r1.28.6.4 --- squid3/src/fs/ufs/store_dir_ufs.cc 1 May 2007 21:03:44 -0000 1.28.6.3 +++ squid3/src/fs/ufs/store_dir_ufs.cc 18 Jun 2007 20:59:36 -0000 1.28.6.4 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.28.6.3 2007/05/01 21:03:44 dwsquid Exp $ + * $Id: store_dir_ufs.cc,v 1.28.6.4 2007/06/18 20:59:36 chtsanti Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -682,7 +682,7 @@ StoreEntry * UFSSwapDir::addDiskRestore(const cache_key * key, sfileno file_number, - size_t swap_file_sz, + uint64_t swap_file_sz, time_t expires, time_t timestamp, time_t lastref, Index: squid3/src/fs/ufs/ufscommon.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/ufs/ufscommon.cc,v retrieving revision 1.8.6.2 retrieving revision 1.8.6.3 diff -u -r1.8.6.2 -r1.8.6.3 --- squid3/src/fs/ufs/ufscommon.cc 30 Apr 2007 17:08:20 -0000 1.8.6.2 +++ squid3/src/fs/ufs/ufscommon.cc 18 Jun 2007 20:59:37 -0000 1.8.6.3 @@ -1,5 +1,5 @@ /* - * $Id: ufscommon.cc,v 1.8.6.2 2007/04/30 17:08:20 dwsquid Exp $ + * $Id: ufscommon.cc,v 1.8.6.3 2007/06/18 20:59:37 chtsanti Exp $ * vim: set et : * * DEBUG: section 47 Store Directory Routines @@ -230,13 +230,13 @@ /* check sizes */ if (tmpe.swap_file_sz == 0) { - tmpe.swap_file_sz = (size_t) sb.st_size; - } else if (tmpe.swap_file_sz == (size_t)(sb.st_size - swap_hdr_len)) { - tmpe.swap_file_sz = (size_t) sb.st_size; - } else if (tmpe.swap_file_sz != (size_t)sb.st_size) { + tmpe.swap_file_sz = (uint64_t) sb.st_size; + } else if (tmpe.swap_file_sz == (uint64_t)(sb.st_size - swap_hdr_len)) { + tmpe.swap_file_sz = (uint64_t) sb.st_size; + } else if (tmpe.swap_file_sz != (uint64_t)sb.st_size) { debugs(47, 1, "commonUfsDirRebuildFromDirectory: SIZE MISMATCH " << - (long int) tmpe.swap_file_sz << "!=" << - (long int) sb.st_size); + tmpe.swap_file_sz << "!=" << + sb.st_size); sd->unlinkFile(filn); continue; Index: squid3/src/fs/ufs/ufscommon.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/ufs/ufscommon.h,v retrieving revision 1.9 retrieving revision 1.9.6.1 diff -u -r1.9 -r1.9.6.1 --- squid3/src/fs/ufs/ufscommon.h 14 Sep 2006 01:50:33 -0000 1.9 +++ squid3/src/fs/ufs/ufscommon.h 18 Jun 2007 20:59:37 -0000 1.9.6.1 @@ -1,6 +1,6 @@ /* - * $Id: ufscommon.h,v 1.9 2006/09/14 01:50:33 squidadm Exp $ + * $Id: ufscommon.h,v 1.9.6.1 2007/06/18 20:59:37 chtsanti Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -97,7 +97,7 @@ void mapBitSet(sfileno filn); StoreEntry *addDiskRestore(const cache_key * key, sfileno file_number, - size_t swap_file_sz, + uint64_t swap_file_sz, time_t expires, time_t timestamp, time_t lastref, Index: squid3/src/tests/stub_HttpReply.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/stub_HttpReply.cc,v retrieving revision 1.3.10.2 retrieving revision 1.3.10.3 diff -u -r1.3.10.2 -r1.3.10.3 --- squid3/src/tests/stub_HttpReply.cc 19 Apr 2007 04:46:38 -0000 1.3.10.2 +++ squid3/src/tests/stub_HttpReply.cc 18 Jun 2007 20:59:37 -0000 1.3.10.3 @@ -1,5 +1,5 @@ /* - * $Id: stub_HttpReply.cc,v 1.3.10.2 2007/04/19 04:46:38 dwsquid Exp $ + * $Id: stub_HttpReply.cc,v 1.3.10.3 2007/06/18 20:59:37 chtsanti Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Robert Collins @@ -90,7 +90,7 @@ } bool -HttpReply::expectingBody(method_t, ssize_t&) const +HttpReply::expectingBody(method_t, int64_t&) const { fatal ("Not implemented"); return false; Index: squid3/src/tests/stub_HttpRequest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/stub_HttpRequest.cc,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -u -r1.3 -r1.3.10.1 --- squid3/src/tests/stub_HttpRequest.cc 18 Apr 2006 13:50:53 -0000 1.3 +++ squid3/src/tests/stub_HttpRequest.cc 18 Jun 2007 20:59:37 -0000 1.3.10.1 @@ -1,5 +1,5 @@ /* - * $Id: stub_HttpRequest.cc,v 1.3 2006/04/18 13:50:53 squidadm Exp $ + * $Id: stub_HttpRequest.cc,v 1.3.10.1 2007/06/18 20:59:37 chtsanti Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Robert Collins @@ -75,7 +75,7 @@ } bool -HttpRequest::expectingBody(method_t unused, ssize_t&) const +HttpRequest::expectingBody(method_t unused, int64_t&) const { fatal("Not implemented"); return false;