--------------------- PatchSet 4281 Date: 2007/04/18 05:02:03 Author: dwsquid Branch: squid3-largeobj Tag: (none) Log: An initial patch that supports proxying large objects. This patch mostly involves replacing various occurences of 'int' and 'size_t' (both 32 bits on FreeBSD5/gcc3) with off_t (64 bits). printf-like functions use %lld to render off_t. In some cases printf-style debugging has been changed to iostream-style debugs. I have not tested whether a large object can be *stored* in the cache yet. At this point I only know that it will be correctly sent to the client, that the Content-length header will be correct, and the size field in access.log will be correct. In fact since, StoreSwapLogData is using a 32-bit size_t for swap_file_sz, the swap.state file format will have to change to support large objects. Members: include/util.h:1.15->1.15.6.1 lib/util.c:1.9->1.9.6.1 src/AccessLogEntry.h:1.7->1.7.10.1 src/HttpHeader.cc:1.40->1.40.6.1 src/HttpHeader.h:1.18->1.18.6.1 src/HttpHeaderTools.cc:1.21->1.21.6.1 src/HttpMsg.cc:1.29->1.29.6.1 src/HttpMsg.h:1.14->1.14.6.1 src/HttpReply.cc:1.38->1.38.6.1 src/HttpReply.h:1.18->1.18.10.1 src/Store.h:1.27->1.27.2.1 src/StoreIOBuffer.h:1.6->1.6.6.1 src/access_log.cc:1.41->1.41.6.1 src/client_side.cc:1.121->1.121.2.1 src/client_side.h:1.18->1.18.6.1 src/client_side_reply.cc:1.91->1.91.2.1 src/client_side_request.h:1.25->1.25.6.1 src/ftp.cc:1.63->1.63.2.1 src/http.cc:1.99->1.99.4.1 src/mem_node.cc:1.10->1.10.6.1 src/mem_node.h:1.10->1.10.14.1 src/protos.h:1.80->1.80.4.1 src/stmem.cc:1.16->1.16.14.1 src/stmem.h:1.9->1.9.14.1 src/store.cc:1.53->1.53.2.1 src/store_client.cc:1.29->1.29.2.1 src/store_dir.cc:1.21->1.21.2.1 src/store_log.cc:1.7->1.7.2.1 src/store_swapout.cc:1.19->1.19.2.1 src/tunnel.cc:1.28->1.28.6.1 src/tests/stub_HttpReply.cc:1.3->1.3.10.1 Index: squid3/include/util.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/include/util.h,v retrieving revision 1.15 retrieving revision 1.15.6.1 diff -u -r1.15 -r1.15.6.1 --- squid3/include/util.h 14 Oct 2006 13:51:15 -0000 1.15 +++ squid3/include/util.h 18 Apr 2007 05:02:03 -0000 1.15.6.1 @@ -1,5 +1,5 @@ /* - * $Id: util.h,v 1.15 2006/10/14 13:51:15 squidadm Exp $ + * $Id: util.h,v 1.15.6.1 2007/04/18 05:02:03 dwsquid Exp $ * * AUTHOR: Harvest Derived * @@ -135,6 +135,7 @@ SQUIDCEXTERN double xdiv(double nom, double denom); SQUIDCEXTERN const char *xitoa(int num); +SQUIDCEXTERN const char *xofftoa(off_t num); #if !HAVE_DRAND48 SQUIDCEXTERN double drand48(void); Index: squid3/lib/util.c =================================================================== RCS file: /cvsroot/squid-sf//squid3/lib/util.c,v retrieving revision 1.9 retrieving revision 1.9.6.1 diff -u -r1.9 -r1.9.6.1 --- squid3/lib/util.c 6 Apr 2007 12:54:12 -0000 1.9 +++ squid3/lib/util.c 18 Apr 2007 05:02:44 -0000 1.9.6.1 @@ -1,6 +1,6 @@ /* - * $Id: util.c,v 1.9 2007/04/06 12:54:12 squidadm Exp $ + * $Id: util.c,v 1.9.6.1 2007/04/18 05:02:44 dwsquid Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -919,6 +919,16 @@ return buf; } +/* ssize_t to string */ +/* what about off_t and size_t? */ +const char * +xofftoa(off_t num) +{ + static char buf[24]; /* 2^64 = 18446744073709551616 */ + snprintf(buf, sizeof(buf), "%lld", num); + return buf; +} + /* A default failure notifier when the main program hasn't installed any */ void default_failure_notify(const char *message) Index: squid3/src/AccessLogEntry.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AccessLogEntry.h,v retrieving revision 1.7 retrieving revision 1.7.10.1 diff -u -r1.7 -r1.7.10.1 --- squid3/src/AccessLogEntry.h 29 May 2006 00:50:18 -0000 1.7 +++ squid3/src/AccessLogEntry.h 18 Apr 2007 05:02:51 -0000 1.7.10.1 @@ -1,6 +1,6 @@ /* - * $Id: AccessLogEntry.h,v 1.7 2006/05/29 00:50:18 squidadm Exp $ + * $Id: AccessLogEntry.h,v 1.7.10.1 2007/04/18 05:02:51 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -95,9 +95,9 @@ } struct IN_ADDR caddr; - size_t size; + off_t size; off_t highOffset; - size_t objectSize; + off_t objectSize; log_type code; int msec; const char *rfc931; Index: squid3/src/HttpHeader.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpHeader.cc,v retrieving revision 1.40 retrieving revision 1.40.6.1 diff -u -r1.40 -r1.40.6.1 --- squid3/src/HttpHeader.cc 2 Oct 2006 10:52:36 -0000 1.40 +++ squid3/src/HttpHeader.cc 18 Apr 2007 05:02:59 -0000 1.40.6.1 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.cc,v 1.40 2006/10/02 10:52:36 squidadm Exp $ + * $Id: HttpHeader.cc,v 1.40.6.1 2007/04/18 05:02:59 dwsquid Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -86,7 +86,7 @@ {"Content-Base", HDR_CONTENT_BASE, ftStr}, {"Content-Encoding", HDR_CONTENT_ENCODING, ftStr}, {"Content-Language", HDR_CONTENT_LANGUAGE, ftStr}, - {"Content-Length", HDR_CONTENT_LENGTH, ftInt}, + {"Content-Length", HDR_CONTENT_LENGTH, ftOffset}, {"Content-Location", HDR_CONTENT_LOCATION, ftStr}, {"Content-MD5", HDR_CONTENT_MD5, ftStr}, /* for now */ {"Content-Range", HDR_CONTENT_RANGE, ftPContRange}, @@ -1008,6 +1008,15 @@ } void +HttpHeader::putOffset(http_hdr_type id, off_t number) +{ + assert_eid(id); + assert(Headers[id].type == ftOffset); /* must be of an appropriate type */ + assert(number >= 0); + addEntry(new HttpHeaderEntry(id, NULL, xofftoa(number))); +} + +void HttpHeader::putTime(http_hdr_type id, time_t htime) { assert_eid(id); @@ -1139,6 +1148,19 @@ return -1; } +off_t +HttpHeader::getOffset(http_hdr_type id) const +{ + assert_eid(id); + assert(Headers[id].type == ftOffset); /* must be of an appropriate type */ + HttpHeaderEntry *e; + + if ((e = findEntry(id))) + return e->getOffset(); + + return -1; +} + time_t HttpHeader::getTime(http_hdr_type id) const { @@ -1494,6 +1516,20 @@ return val; } +off_t +HttpHeaderEntry::getOffset() const +{ + assert_eid (id); + assert (Headers[id].type == ftOffset); + off_t val = -1; + int ok = httpHeaderParseOffset(value.buf(), &val); + httpHeaderNoteParsedEntry(id, value, !ok); + /* XXX: Should we check ok - ie + * return ok ? -1 : value; + */ + return val; +} + static void httpHeaderNoteParsedEntry(http_hdr_type id, String const &context, int error) { Index: squid3/src/HttpHeader.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpHeader.h,v retrieving revision 1.18 retrieving revision 1.18.6.1 diff -u -r1.18 -r1.18.6.1 --- squid3/src/HttpHeader.h 2 Oct 2006 10:52:36 -0000 1.18 +++ squid3/src/HttpHeader.h 18 Apr 2007 05:03:03 -0000 1.18.6.1 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.h,v 1.18 2006/10/02 10:52:36 squidadm Exp $ + * $Id: HttpHeader.h,v 1.18.6.1 2007/04/18 05:03:03 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -124,6 +124,7 @@ typedef enum { ftInvalid = HDR_ENUM_END, /* to catch nasty errors with hdr_id<->fld_type clashes */ ftInt, + ftOffset, ftStr, ftDate_1123, ftETag, @@ -181,6 +182,7 @@ HttpHeaderEntry *clone() const; void packInto(Packer *p) const; int getInt() const; + off_t getOffset() const; MEMPROXY_CLASS(HttpHeaderEntry); http_hdr_type id; String name; @@ -218,6 +220,7 @@ String getListMember(http_hdr_type id, const char *member, const char separator) const; int has(http_hdr_type id) const; void putInt(http_hdr_type id, int number); + void putOffset(http_hdr_type id, off_t number); void putTime(http_hdr_type id, time_t htime); void insertTime(http_hdr_type id, time_t htime); void putStr(http_hdr_type id, const char *str); @@ -228,6 +231,7 @@ void putSc(HttpHdrSc *sc); void putExt(const char *name, const char *value); int getInt(http_hdr_type id) const; + off_t getOffset(http_hdr_type id) const; time_t getTime(http_hdr_type id) const; const char *getStr(http_hdr_type id) const; const char *getLastStr(http_hdr_type id) const; Index: squid3/src/HttpHeaderTools.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpHeaderTools.cc,v retrieving revision 1.21 retrieving revision 1.21.6.1 diff -u -r1.21 -r1.21.6.1 --- squid3/src/HttpHeaderTools.cc 3 Sep 2006 05:50:36 -0000 1.21 +++ squid3/src/HttpHeaderTools.cc 18 Apr 2007 05:03:24 -0000 1.21.6.1 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeaderTools.cc,v 1.21 2006/09/03 05:50:36 squidadm Exp $ + * $Id: HttpHeaderTools.cc,v 1.21.6.1 2007/04/18 05:03:24 dwsquid Exp $ * * DEBUG: section 66 HTTP Header Tools * AUTHOR: Alex Rousskov @@ -359,6 +359,16 @@ return res; } +int +httpHeaderParseOffset(const char *start, off_t * value) +{ + off_t res = strtoll(start, NULL, 10); + if (!res && EINVAL == errno) /* maybe not portable? */ + return 0; + *value = res; + return 1; +} + /* Parses a quoted-string field (RFC 2616 section 2.2), complains if * something went wrong, returns non-zero on success. Index: squid3/src/HttpMsg.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpMsg.cc,v retrieving revision 1.29 retrieving revision 1.29.6.1 diff -u -r1.29 -r1.29.6.1 --- squid3/src/HttpMsg.cc 6 Apr 2007 12:54:12 -0000 1.29 +++ squid3/src/HttpMsg.cc 18 Apr 2007 05:03:27 -0000 1.29.6.1 @@ -1,6 +1,6 @@ /* - * $Id: HttpMsg.cc,v 1.29 2007/04/06 12:54:12 squidadm Exp $ + * $Id: HttpMsg.cc,v 1.29.6.1 2007/04/18 05:03:27 dwsquid Exp $ * * DEBUG: section 74 HTTP Message * AUTHOR: Alex Rousskov @@ -355,7 +355,7 @@ void HttpMsg::hdrCacheInit() { - content_length = header.getInt(HDR_CONTENT_LENGTH); + content_length = header.getOffset(HDR_CONTENT_LENGTH); assert(NULL == cache_control); cache_control = header.getCc(); } Index: squid3/src/HttpMsg.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpMsg.h,v retrieving revision 1.14 retrieving revision 1.14.6.1 diff -u -r1.14 -r1.14.6.1 --- squid3/src/HttpMsg.h 6 Apr 2007 05:52:34 -0000 1.14 +++ squid3/src/HttpMsg.h 18 Apr 2007 05:03:32 -0000 1.14.6.1 @@ -1,6 +1,6 @@ /* - * $Id: HttpMsg.h,v 1.14 2007/04/06 05:52:34 squidadm Exp $ + * $Id: HttpMsg.h,v 1.14.6.1 2007/04/18 05:03:32 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -67,7 +67,7 @@ * Also used to report parsed header size if parse() is successful */ int hdr_sz; - int content_length; + off_t content_length; protocol_t protocol; Index: squid3/src/HttpReply.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpReply.cc,v retrieving revision 1.38 retrieving revision 1.38.6.1 diff -u -r1.38 -r1.38.6.1 --- squid3/src/HttpReply.cc 6 Apr 2007 05:52:34 -0000 1.38 +++ squid3/src/HttpReply.cc 18 Apr 2007 05:03:37 -0000 1.38.6.1 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.cc,v 1.38 2007/04/06 05:52:34 squidadm Exp $ + * $Id: HttpReply.cc,v 1.38.6.1 2007/04/18 05:03:37 dwsquid Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -172,7 +172,7 @@ MemBuf * httpPackedReply(HttpVersion ver, http_status status, const char *ctype, - int clen, time_t lmt, time_t expires) + off_t clen, time_t lmt, time_t expires) { HttpReply *rep = new HttpReply; rep->setHeaders(ver, status, ctype, NULL, clen, lmt, expires); @@ -224,7 +224,7 @@ void HttpReply::setHeaders(HttpVersion ver, http_status status, const char *reason, - const char *ctype, int clen, time_t lmt, time_t expires) + const char *ctype, off_t clen, time_t lmt, time_t expires) { HttpHeader *hdr; httpStatusLineSet(&sline, ver, status, reason); @@ -240,7 +240,7 @@ content_type = String(); if (clen >= 0) - hdr->putInt(HDR_CONTENT_LENGTH, clen); + hdr->putOffset(HDR_CONTENT_LENGTH, clen); if (expires >= 0) hdr->putTime(HDR_EXPIRES, expires); @@ -266,7 +266,7 @@ hdr = &header; hdr->putStr(HDR_SERVER, full_appname_string); hdr->putTime(HDR_DATE, squid_curtime); - hdr->putInt(HDR_CONTENT_LENGTH, 0); + hdr->putOffset(HDR_CONTENT_LENGTH, 0); hdr->putStr(HDR_LOCATION, loc); date = squid_curtime; content_length = 0; @@ -389,7 +389,7 @@ { HttpMsg::hdrCacheInit(); - content_length = header.getInt(HDR_CONTENT_LENGTH); + content_length = header.getOffset(HDR_CONTENT_LENGTH); date = header.getTime(HDR_DATE); last_modified = header.getTime(HDR_LAST_MODIFIED); surrogate_control = header.getSc(); Index: squid3/src/HttpReply.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/HttpReply.h,v retrieving revision 1.18 retrieving revision 1.18.10.1 diff -u -r1.18 -r1.18.10.1 --- squid3/src/HttpReply.h 23 Apr 2006 11:27:37 -0000 1.18 +++ squid3/src/HttpReply.h 18 Apr 2007 05:05:30 -0000 1.18.10.1 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.h,v 1.18 2006/04/23 11:27:37 squidadm Exp $ + * $Id: HttpReply.h,v 1.18.10.1 2007/04/18 05:05:30 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -39,7 +39,7 @@ extern void httpReplyInitModule(void); /* do everything in one call: init, set, pack, clean, return MemBuf */ -extern MemBuf *httpPackedReply(HttpVersion ver, http_status status, const char *ctype, int clen, time_t lmt, time_t expires); +extern MemBuf *httpPackedReply(HttpVersion ver, http_status status, const char *ctype, off_t clen, time_t lmt, time_t expires); /* Sync changes here with HttpReply.cc */ @@ -106,7 +106,7 @@ /* set commonly used info with one call */ void setHeaders(HttpVersion ver, http_status status, - const char *reason, const char *ctype, int clen, time_t lmt, time_t expires); + const char *reason, const char *ctype, off_t clen, time_t lmt, time_t expires); /* mem-pack: returns a ready to use mem buffer with a packed reply */ MemBuf *pack(); Index: squid3/src/Store.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Store.h,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -u -r1.27 -r1.27.2.1 --- squid3/src/Store.h 17 Apr 2007 06:59:30 -0000 1.27 +++ squid3/src/Store.h 18 Apr 2007 05:05:38 -0000 1.27.2.1 @@ -1,6 +1,6 @@ /* - * $Id: Store.h,v 1.27 2007/04/17 06:59:30 squidadm Exp $ + * $Id: Store.h,v 1.27.2.1 2007/04/18 05:05:38 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -151,7 +151,7 @@ virtual int unlock(); /* increate the memory lock count on the entry */ virtual ssize_t objectLen() const; - virtual int contentLen() const; + virtual off_t contentLen() const; virtual void lock() Index: squid3/src/StoreIOBuffer.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/StoreIOBuffer.h,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -u -r1.6 -r1.6.6.1 --- squid3/src/StoreIOBuffer.h 14 Oct 2006 13:51:15 -0000 1.6 +++ squid3/src/StoreIOBuffer.h 18 Apr 2007 05:05:42 -0000 1.6.6.1 @@ -1,6 +1,6 @@ /* - * $Id: StoreIOBuffer.h,v 1.6 2006/10/14 13:51:15 squidadm Exp $ + * $Id: StoreIOBuffer.h,v 1.6.6.1 2007/04/18 05:05:42 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -61,9 +61,9 @@ flags.error = 0; } - Range range() const + Range range() const { - return Range(offset, offset + length); + return Range(offset, offset + length); } void dump() const Index: squid3/src/access_log.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/access_log.cc,v retrieving revision 1.41 retrieving revision 1.41.6.1 diff -u -r1.41 -r1.41.6.1 --- squid3/src/access_log.cc 4 Nov 2006 15:50:51 -0000 1.41 +++ squid3/src/access_log.cc 18 Apr 2007 05:06:18 -0000 1.41.6.1 @@ -1,6 +1,6 @@ /* - * $Id: access_log.cc,v 1.41 2006/11/04 15:50:51 squidadm Exp $ + * $Id: access_log.cc,v 1.41.6.1 2007/04/18 05:06:18 dwsquid Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -526,6 +526,8 @@ long int outint = 0; int doint = 0; int dofree = 0; + off_t outoff = 0; + int dooff = 0; switch (fmt->type) { @@ -774,9 +776,9 @@ /*case LFT_REQUEST_SIZE_BODY_NO_TE: */ case LFT_REPLY_SIZE_TOTAL: - outint = al->cache.size; + outoff = al->cache.size; - doint = 1; + dooff = 1; break; @@ -821,7 +823,11 @@ break; } - if (doint) { + if (dooff) { + snprintf(tmp, sizeof(tmp), "%0*lld", fmt->zero ? (int) fmt->width : 0, outoff); + out = tmp; + + } else if (doint) { snprintf(tmp, sizeof(tmp), "%0*ld", fmt->zero ? (int) fmt->width : 0, outint); out = tmp; } @@ -1277,14 +1283,14 @@ safe_free(user); if (!Config.onoff.log_mime_hdrs) { - logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %ld %s %s %s %s%s/%s %s", + logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %lld %s %s %s %s%s/%s %s", (long int) current_time.tv_sec, (int) current_time.tv_usec / 1000, al->cache.msec, client, log_tags[al->cache.code], al->http.code, - (long int) al->cache.size, + al->cache.size, al->_private.method_str, al->url, user ? user : dash_str, @@ -1295,14 +1301,14 @@ } else { char *ereq = log_quote(al->headers.request); char *erep = log_quote(al->headers.reply); - logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %ld %s %s %s %s%s/%s %s [%s] [%s]", + logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %lld %s %s %s %s%s/%s %s [%s] [%s]", (long int) current_time.tv_sec, (int) current_time.tv_usec / 1000, al->cache.msec, client, log_tags[al->cache.code], al->http.code, - (long int) al->cache.size, + al->cache.size, al->_private.method_str, al->url, user ? user : dash_str, @@ -1335,7 +1341,7 @@ user2 = accessLogFormatName(al->cache.rfc931); - logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %ld %s:%s", + logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %lld %s:%s", client, user2 ? user2 : dash_str, user1 ? user1 : dash_str, @@ -1344,7 +1350,7 @@ al->url, al->http.version.major, al->http.version.minor, al->http.code, - (long int) al->cache.size, + al->cache.size, log_tags[al->cache.code], hier_strings[al->hier.code]); Index: squid3/src/client_side.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side.cc,v retrieving revision 1.121 retrieving revision 1.121.2.1 diff -u -r1.121 -r1.121.2.1 --- squid3/src/client_side.cc 17 Apr 2007 06:59:30 -0000 1.121 +++ squid3/src/client_side.cc 18 Apr 2007 05:06:22 -0000 1.121.2.1 @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.121 2007/04/17 06:59:30 squidadm Exp $ + * $Id: client_side.cc,v 1.121.2.1 2007/04/18 05:06:22 dwsquid Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -757,7 +757,7 @@ } size_t -ClientSocketContext::lengthToSend(Range const &available) +ClientSocketContext::lengthToSend(Range const &available) { size_t maximum = available.size(); @@ -879,7 +879,7 @@ ClientSocketContext::packRange(StoreIOBuffer const &source, MemBuf * mb) { HttpHdrRangeIter * i = &http->range_iter; - Range available (source.range()); + Range available (source.range()); char const *buf = source.data; while (i->currentSpec() && available.size()) { @@ -1122,8 +1122,8 @@ const int spec_count = http->request->range->specs.count; int actual_clen = -1; - debug(33, 3) ("clientBuildRangeHeader: range spec count: %d virgin clen: %d\n", - spec_count, rep->content_length); + debugs(33, 3, "clientBuildRangeHeader: range spec count: " << + spec_count << " virgin clen: " << rep->content_length); assert(spec_count > 0); /* ETags should not be returned with Partial Content replies? */ hdr->delById(HDR_ETAG); @@ -1175,7 +1175,7 @@ hdr->delById(HDR_CONTENT_LENGTH); - hdr->putInt(HDR_CONTENT_LENGTH, actual_clen); + hdr->putOffset(HDR_CONTENT_LENGTH, actual_clen); debug(33, 3) ("clientBuildRangeHeader: actual content length: %d\n", actual_clen); Index: squid3/src/client_side.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side.h,v retrieving revision 1.18 retrieving revision 1.18.6.1 diff -u -r1.18 -r1.18.6.1 --- squid3/src/client_side.h 6 Apr 2007 05:52:35 -0000 1.18 +++ squid3/src/client_side.h 18 Apr 2007 05:06:25 -0000 1.18.6.1 @@ -1,6 +1,6 @@ /* - * $Id: client_side.h,v 1.18 2007/04/06 05:52:35 squidadm Exp $ + * $Id: client_side.h,v 1.18.6.1 2007/04/18 05:06:25 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -101,7 +101,7 @@ clientStream_status_t socketState(); void sendBody(HttpReply * rep, StoreIOBuffer bodyData); void sendStartOfMessage(HttpReply * rep, StoreIOBuffer bodyData); - size_t lengthToSend(Range const &available); + size_t lengthToSend(Range const &available); void noteSentBodyBytes(size_t); void buildRangeHeader(HttpReply * rep); int fd() const; Index: squid3/src/client_side_reply.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side_reply.cc,v retrieving revision 1.91 retrieving revision 1.91.2.1 diff -u -r1.91 -r1.91.2.1 --- squid3/src/client_side_reply.cc 17 Apr 2007 05:57:33 -0000 1.91 +++ squid3/src/client_side_reply.cc 18 Apr 2007 05:06:30 -0000 1.91.2.1 @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.91 2007/04/17 05:57:33 squidadm Exp $ + * $Id: client_side_reply.cc,v 1.91.2.1 2007/04/18 05:06:30 dwsquid Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -989,8 +989,13 @@ int clientReplyContext::storeOKTransferDone() const { - if (http->out.offset >= http->storeEntry()->objectLen() - headers_sz) + if (http->out.offset >= http->storeEntry()->objectLen() - headers_sz) { + debugs(88,3,HERE << "storeOKTransferDone " << + " out.offset=" << http->out.offset << + " objectLen()=" << http->storeEntry()->objectLen() << + " headers_sz=" << headers_sz); return 1; + } return 0; } @@ -1027,12 +1032,16 @@ if (reply->content_length < 0) return 0; - size_t expectedLength = http->out.headers_sz + reply->content_length; + off_t expectedLength = reply->content_length + http->out.headers_sz; if (http->out.size < expectedLength) return 0; - else + else { + debugs(88,3,HERE << "storeNotOKTransferDone " << + " out.size=" << http->out.size << + " expectedLength=" << expectedLength); return 1; + } } @@ -1045,7 +1054,7 @@ int clientHttpRequestStatus(int fd, ClientHttpRequest const *http) { -#if SIZEOF_SIZE_T == 4 +#if SIZEOF_OFF_T == 4 if (http->out.size > 0x7FFF0000) { debug(88, 1) ("WARNING: closing FD %d to prevent counter overflow\n", Index: squid3/src/client_side_request.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side_request.h,v retrieving revision 1.25 retrieving revision 1.25.6.1 diff -u -r1.25 -r1.25.6.1 --- squid3/src/client_side_request.h 6 Apr 2007 05:52:36 -0000 1.25 +++ squid3/src/client_side_request.h 18 Apr 2007 05:06:36 -0000 1.25.6.1 @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.h,v 1.25 2007/04/06 05:52:36 squidadm Exp $ + * $Id: client_side_request.h,v 1.25.6.1 2007/04/18 05:06:36 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -101,7 +101,7 @@ struct { off_t offset; - size_t size; + off_t size; size_t headers_sz; } @@ -195,7 +195,7 @@ /* ones that should be elsewhere */ SQUIDCEXTERN void redirectStart(ClientHttpRequest *, RH *, void *); -SQUIDCEXTERN void sslStart(ClientHttpRequest *, size_t *, int *); +SQUIDCEXTERN void sslStart(ClientHttpRequest *, off_t *, int *); #ifdef _USE_INLINE_ #include "Store.h" Index: squid3/src/ftp.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ftp.cc,v retrieving revision 1.63 retrieving revision 1.63.2.1 diff -u -r1.63 -r1.63.2.1 --- squid3/src/ftp.cc 16 Apr 2007 22:09:50 -0000 1.63 +++ squid3/src/ftp.cc 18 Apr 2007 05:06:46 -0000 1.63.2.1 @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.63 2007/04/16 22:09:50 squidadm Exp $ + * $Id: ftp.cc,v 1.63.2.1 2007/04/18 05:06:46 dwsquid Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -133,12 +133,12 @@ int login_att; ftp_state_t state; time_t mdtm; - int size; + off_t theSize; wordlist *pathcomps; char *filepath; char *dirpath; - int restart_offset; - int restarted_offset; + off_t restart_offset; + off_t restarted_offset; char *proxy_host; size_t list_width; wordlist *cwd_message; @@ -199,7 +199,7 @@ int checkAuth(const HttpHeader * req_hdr); void checkUrlpath(); void buildTitleUrl(); - void writeReplyBody(const char *, int len); + void writeReplyBody(const char *, size_t len); void printfReplyBody(const char *fmt, ...); virtual int dataDescriptor() const; virtual void maybeReadVirginBody(); @@ -381,7 +381,7 @@ statCounter.server.ftp.requests++; ctrl.fd = theFwdState->server_fd; data.fd = -1; - size = -1; + theSize = -1; mdtm = -1; if (Config.Ftp.passive && !theFwdState->ftpPasvFailed()) @@ -728,7 +728,7 @@ if ((copyFrom = strstr(buf, tbuf))) { p->type = *tokens[0]; - p->size = atoi(size); + p->size = strtoll(size, NULL, 10); p->date = xstrdup(tbuf); if (flags.skip_whitespace) { @@ -1720,7 +1720,7 @@ return; } - assert(ftpState->ctrl.offset < (off_t)ftpState->ctrl.size); + assert(ftpState->ctrl.offset < ftpState->ctrl.size); if (errflag == COMM_OK && len > 0) { fd_bytes(fd, len, FD_READ); @@ -1771,7 +1771,7 @@ if (ctrl.message == NULL) { /* didn't get complete reply yet */ - if (ctrl.offset == (off_t)ctrl.size) { + if (ctrl.offset == ctrl.size) { ctrl.buf = (char *)memReallocBuf(ctrl.buf, ctrl.size << 1, &ctrl.size); } @@ -2165,13 +2165,13 @@ if (code == 213) { ftpState->unhack(); - ftpState->size = atoi(ftpState->ctrl.last_reply); + ftpState->theSize = strtoll(ftpState->ctrl.last_reply, NULL, 10); - if (ftpState->size == 0) { + if (ftpState->theSize == 0) { debug(9, 2) ("ftpReadSize: SIZE reported %s on %s\n", ftpState->ctrl.last_reply, ftpState->title_url.buf()); - ftpState->size = -1; + ftpState->theSize = -1; } } else if (code < 0) { ftpFail(ftpState); @@ -2189,7 +2189,7 @@ debugs(9, 3, HERE << "ftpSendPasv started"); - if (ftpState->request->method == METHOD_HEAD && (ftpState->flags.isdir || ftpState->size != -1)) { + if (ftpState->request->method == METHOD_HEAD && (ftpState->flags.isdir || ftpState->theSize != -1)) { /* Terminate here for HEAD requests */ ftpState->appendSuccessHeader(); storeTimestampsSet(ftpState->entry); @@ -2559,7 +2559,7 @@ snprintf(cbuf, 1024, "STOR %s\r\n", ftpState->filepath); ftpState->writeCommand(cbuf); ftpState->state = SENT_STOR; - } else if (ftpState->request->header.getInt(HDR_CONTENT_LENGTH) > 0) { + } else if (ftpState->request->header.getOffset(HDR_CONTENT_LENGTH) > 0) { /* File upload without a filename. use STOU to generate one */ snprintf(cbuf, 1024, "STOU\r\n"); ftpState->writeCommand(cbuf); @@ -2615,7 +2615,7 @@ static void ftpSendRest(FtpStateData * ftpState) { - snprintf(cbuf, 1024, "REST %d\r\n", ftpState->restart_offset); + snprintf(cbuf, 1024, "REST %lld\r\n", ftpState->restart_offset); ftpState->writeCommand(cbuf); ftpState->state = SENT_REST; } @@ -2632,10 +2632,10 @@ if (!flags.binary) return 0; - if (size <= 0) + if (theSize <= 0) return 0; - restart_offset = request->range->lowestOffset((size_t) size); + restart_offset = request->range->lowestOffset(theSize); if (restart_offset <= 0) return 0; @@ -2909,7 +2909,7 @@ if (!ftpState->flags.isdir && /* Not a directory */ !ftpState->flags.try_slash_hack && /* Not in slash hack */ - ftpState->mdtm <= 0 && ftpState->size < 0 && /* Not known as a file */ + ftpState->mdtm <= 0 && ftpState->theSize < 0 && /* Not known as a file */ ftpState->request->urlpath.caseCmp("/%2f", 4) != 0) { /* No slash encoded */ switch (ftpState->state) { @@ -3120,16 +3120,16 @@ /* Partial reply */ HttpHdrRangeSpec range_spec; range_spec.offset = restarted_offset; - range_spec.length = size - restarted_offset; + range_spec.length = theSize - restarted_offset; HttpVersion version(1, 0); reply->setHeaders(version, HTTP_PARTIAL_CONTENT, "Gatewaying", - mime_type, size - restarted_offset, mdtm, -2); - httpHeaderAddContRange(&reply->header, range_spec, size); + mime_type, theSize - restarted_offset, mdtm, -2); + httpHeaderAddContRange(&reply->header, range_spec, theSize); } else { /* Full reply */ HttpVersion version(1, 0); reply->setHeaders(version, HTTP_OK, "Gatewaying", - mime_type, size, mdtm, -2); + mime_type, theSize, mdtm, -2); } /* additional info */ @@ -3236,13 +3236,13 @@ * which should be sent to either StoreEntry, or to ICAP... */ void -FtpStateData::writeReplyBody(const char *data, int len) +FtpStateData::writeReplyBody(const char *data, size_t len) { #if ICAP_CLIENT if (virginBodyDestination != NULL) { debugs(9,5,HERE << "writing " << len << " bytes to ICAP"); const size_t putSize = virginBodyDestination->putMoreData(data, len); - if (putSize != (size_t)len) { + if (putSize != len) { // XXX: FTP writing should be rewritten to avoid temporary buffers // because temporary buffers cannot handle overflows. debugs(0,0,HERE << "ICAP cannot keep up with FTP; lost " << Index: squid3/src/http.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/http.cc,v retrieving revision 1.99 retrieving revision 1.99.4.1 diff -u -r1.99 -r1.99.4.1 --- squid3/src/http.cc 15 Apr 2007 15:00:43 -0000 1.99 +++ squid3/src/http.cc 18 Apr 2007 05:06:49 -0000 1.99.4.1 @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.99 2007/04/15 15:00:43 squidadm Exp $ + * $Id: http.cc,v 1.99.4.1 2007/04/18 05:06:49 dwsquid Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -899,8 +899,7 @@ HttpStateData::persistentConnStatus() const { debug(11, 3) ("persistentConnStatus: FD %d\n", fd); - debug(11, 5) ("persistentConnStatus: content_length=%d\n", - reply->content_length); + debugs(11, 5, "persistentConnStatus: content_length=" << reply->content_length); /* If we haven't seen the end of reply headers, we are not done */ debug(11,5)("persistentConnStatus: flags.headers_parsed=%d\n", flags.headers_parsed); Index: squid3/src/mem_node.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/mem_node.cc,v retrieving revision 1.10 retrieving revision 1.10.6.1 diff -u -r1.10 -r1.10.6.1 --- squid3/src/mem_node.cc 20 Sep 2006 01:50:46 -0000 1.10 +++ squid3/src/mem_node.cc 18 Apr 2007 05:06:53 -0000 1.10.6.1 @@ -1,6 +1,6 @@ /* - * $Id: mem_node.cc,v 1.10 2006/09/20 01:50:46 squidadm Exp $ + * $Id: mem_node.cc,v 1.10.6.1 2007/04/18 05:06:53 dwsquid Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Robert Collins @@ -80,23 +80,23 @@ return Pool().inUseCount(); } -size_t +off_t mem_node::start() const { assert (nodeBuffer.offset >= 0); return nodeBuffer.offset; } -size_t +off_t mem_node::end() const { return nodeBuffer.offset + nodeBuffer.length; } -Range +Range mem_node::dataRange() const { - return Range (start(), end()); + return Range (start(), end()); } size_t @@ -106,7 +106,7 @@ } bool -mem_node::contains (size_t const &location) const +mem_node::contains (off_t const &location) const { if (start() <= location && end() > location) return true; @@ -116,7 +116,7 @@ /* nodes can not be sparse */ bool -mem_node::canAccept (size_t const &location) const +mem_node::canAccept (off_t const &location) const { if (location == end() && space() > 0) return true; Index: squid3/src/mem_node.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/mem_node.h,v retrieving revision 1.10 retrieving revision 1.10.14.1 diff -u -r1.10 -r1.10.14.1 --- squid3/src/mem_node.h 15 Sep 2005 02:12:42 -0000 1.10 +++ squid3/src/mem_node.h 18 Apr 2007 05:06:58 -0000 1.10.14.1 @@ -1,6 +1,6 @@ /* - * $Id: mem_node.h,v 1.10 2005/09/15 02:12:42 squidadm Exp $ + * $Id: mem_node.h,v 1.10.14.1 2007/04/18 05:06:58 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -48,11 +48,11 @@ mem_node(off_t); ~mem_node(); size_t space() const; - size_t start() const; - size_t end() const; - Range dataRange() const; - bool contains (size_t const &location) const; - bool canAccept (size_t const &location) const; + off_t start() const; + off_t end() const; + Range dataRange() const; + bool contains (off_t const &location) const; + bool canAccept (off_t const &location) const; bool operator < (mem_node const & rhs) const; /* public */ StoreIOBuffer nodeBuffer; Index: squid3/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/protos.h,v retrieving revision 1.80 retrieving revision 1.80.4.1 diff -u -r1.80 -r1.80.4.1 --- squid3/src/protos.h 15 Apr 2007 15:01:00 -0000 1.80 +++ squid3/src/protos.h 18 Apr 2007 05:07:01 -0000 1.80.4.1 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.80 2007/04/15 15:01:00 squidadm Exp $ + * $Id: protos.h,v 1.80.4.1 2007/04/18 05:07:01 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -245,6 +245,7 @@ SQUIDCEXTERN const char *getStringPrefix(const char *str, const char *end); SQUIDCEXTERN int httpHeaderParseInt(const char *start, int *val); SQUIDCEXTERN int httpHeaderParseSize(const char *start, ssize_t * sz); +SQUIDCEXTERN int httpHeaderParseOffset(const char *start, off_t * off); #if STDC_HEADERS SQUIDCEXTERN void httpHeaderPutStrf(HttpHeader * hdr, http_hdr_type id, const char *fmt,...) PRINTF_FORMAT_ARG3; Index: squid3/src/stmem.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/stmem.cc,v retrieving revision 1.16 retrieving revision 1.16.14.1 diff -u -r1.16 -r1.16.14.1 --- squid3/src/stmem.cc 15 Sep 2005 02:12:42 -0000 1.16 +++ squid3/src/stmem.cc 18 Apr 2007 05:07:07 -0000 1.16.14.1 @@ -1,6 +1,6 @@ /* - * $Id: stmem.cc,v 1.16 2005/09/15 02:12:42 squidadm Exp $ + * $Id: stmem.cc,v 1.16.14.1 2007/04/18 05:07:07 dwsquid Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Harvest Derived @@ -55,7 +55,7 @@ return aNode->data; } -int +off_t mem_hdr::lowestOffset () const { const SplayNode *theStart = nodes.start(); @@ -100,8 +100,8 @@ return true; } -int -mem_hdr::freeDataUpto(int target_offset) +off_t +mem_hdr::freeDataUpto(off_t target_offset) { /* keep the last one to avoid change to other part of code */ @@ -111,7 +111,7 @@ if (theStart == nodes.finish()) break; - if (theStart->data->end() > (size_t) target_offset ) + if (theStart->data->end() > target_offset ) break; if (!unlink(theStart->data)) @@ -131,7 +131,7 @@ } size_t -mem_hdr::writeAvailable(mem_node *aNode, size_t location, size_t amount, char const *source) +mem_hdr::writeAvailable(mem_node *aNode, off_t location, size_t amount, char const *source) { /* if we attempt to overwrite existing data or leave a gap within a node */ assert (location == aNode->nodeBuffer.offset + aNode->nodeBuffer.length); @@ -194,7 +194,7 @@ * If no node contains the start, it returns NULL. */ mem_node * -mem_hdr::getBlockContainingLocation (size_t location) const +mem_hdr::getBlockContainingLocation (off_t location) const { mem_node target (location); target.nodeBuffer.length = 1; @@ -207,12 +207,12 @@ } size_t -mem_hdr::copyAvailable(mem_node *aNode, size_t location, size_t amount, char *target) const +mem_hdr::copyAvailable(mem_node *aNode, off_t location, size_t amount, char *target) const { - if (aNode->nodeBuffer.offset > (off_t) location) + if (aNode->nodeBuffer.offset > location) return 0; - assert (aNode->nodeBuffer.offset <= (off_t) location); + assert (aNode->nodeBuffer.offset <= location); assert (aNode->end() > location); @@ -246,6 +246,7 @@ mem_hdr::copy(StoreIOBuffer const &target) const { + assert(target.range().end > target.range().start); debugs(19, 6, "memCopy: " << target.range()); /* we shouldn't ever ask for absent offsets */ @@ -261,7 +262,7 @@ assert(target.length > 0); /* Seek our way into store */ - mem_node *p = getBlockContainingLocation((size_t)target.offset); + mem_node *p = getBlockContainingLocation(target.offset); if (!p) { debugs(19, 1, "memCopy: could not find start of " << target.range() << Index: squid3/src/stmem.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/stmem.h,v retrieving revision 1.9 retrieving revision 1.9.14.1 diff -u -r1.9 -r1.9.14.1 --- squid3/src/stmem.h 15 Sep 2005 02:12:42 -0000 1.9 +++ squid3/src/stmem.h 18 Apr 2007 05:07:12 -0000 1.9.14.1 @@ -1,6 +1,6 @@ /* - * $Id: stmem.h,v 1.9 2005/09/15 02:12:42 squidadm Exp $ + * $Id: stmem.h,v 1.9.14.1 2007/04/18 05:07:12 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -49,9 +49,9 @@ mem_hdr(); ~mem_hdr(); void freeContent(); - int lowestOffset () const; + off_t lowestOffset () const; off_t endOffset () const; - int freeDataUpto (int); + off_t freeDataUpto (off_t); ssize_t copy (StoreIOBuffer const &) const; bool hasContigousContentRange(Range const &range) const; /* success or fail */ @@ -60,7 +60,7 @@ size_t size() const; /* Not an iterator - thus the start, not begin() */ mem_node const *start() const; - mem_node *getBlockContainingLocation (size_t location) const; + mem_node *getBlockContainingLocation (off_t location) const; /* access the contained nodes - easier than punning * as a contianer ourselves */ @@ -78,10 +78,10 @@ void makeAppendSpace(); int appendToNode(mem_node *aNode, const char *data, int maxLength); void appendNode (mem_node *aNode); - size_t copyAvailable(mem_node *aNode, size_t location, size_t amount, char *target) const; + size_t copyAvailable(mem_node *aNode, off_t location, size_t amount, char *target) const; bool unionNotEmpty (StoreIOBuffer const &); mem_node *nodeToRecieve(off_t offset); - size_t writeAvailable(mem_node *aNode, size_t location, size_t amount, char const *source); + size_t writeAvailable(mem_node *aNode, off_t location, size_t amount, char const *source); off_t inmem_hi; Splay nodes; }; Index: squid3/src/store.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store.cc,v retrieving revision 1.53 retrieving revision 1.53.2.1 diff -u -r1.53 -r1.53.2.1 --- squid3/src/store.cc 17 Apr 2007 06:59:32 -0000 1.53 +++ squid3/src/store.cc 18 Apr 2007 05:07:16 -0000 1.53.2.1 @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.53 2007/04/17 06:59:32 squidadm Exp $ + * $Id: store.cc,v 1.53.2.1 2007/04/18 05:07:16 dwsquid Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1387,8 +1387,7 @@ objectLen()); debug(20, 5) ("storeEntryValidLength: hdr_sz = %d\n", reply->hdr_sz); - debug(20, 5) ("storeEntryValidLength: content_length = %d\n", - reply->content_length); + debugs(20, 5, "storeEntryValidLength: content_length = " << reply->content_length); if (reply->content_length < 0) { debug(20, 5) ("storeEntryValidLength: Unspecified content length: %s\n", @@ -1716,7 +1715,7 @@ return mem_obj->object_sz; } -int +off_t StoreEntry::contentLen() 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 retrieving revision 1.29.2.1 diff -u -r1.29 -r1.29.2.1 --- squid3/src/store_client.cc 17 Apr 2007 05:57:34 -0000 1.29 +++ squid3/src/store_client.cc 18 Apr 2007 05:07:20 -0000 1.29.2.1 @@ -1,6 +1,6 @@ /* - * $Id: store_client.cc,v 1.29 2007/04/17 05:57:34 squidadm Exp $ + * $Id: store_client.cc,v 1.29.2.1 2007/04/18 05:07:20 dwsquid Exp $ * * DEBUG: section 90 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -341,7 +341,7 @@ flags.store_copying = 1; MemObject *mem = entry->mem_obj; - debug(33, 5)("store_client::doCopy: co: %lu, hi: %ld\n", (unsigned long) copyInto.offset, (long int) mem->endOffset()); + debug(33, 5)("store_client::doCopy: co: %lld, hi: %lld\n", copyInto.offset, mem->endOffset()); if (storeClientNoMoreToSend(entry, this)) { /* There is no more to send! */ Index: squid3/src/store_dir.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store_dir.cc,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -u -r1.21 -r1.21.2.1 --- squid3/src/store_dir.cc 17 Apr 2007 05:57:35 -0000 1.21 +++ squid3/src/store_dir.cc 18 Apr 2007 05:07:47 -0000 1.21.2.1 @@ -1,6 +1,6 @@ /* - * $Id: store_dir.cc,v 1.21 2007/04/17 05:57:35 squidadm Exp $ + * $Id: store_dir.cc,v 1.21.2.1 2007/04/18 05:07:47 dwsquid Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -706,6 +706,8 @@ StoreHashIndex::StoreHashIndex() { + if (store_table) + abort(); assert (store_table == NULL); } Index: squid3/src/store_log.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store_log.cc,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- squid3/src/store_log.cc 17 Apr 2007 06:59:32 -0000 1.7 +++ squid3/src/store_log.cc 18 Apr 2007 05:08:28 -0000 1.7.2.1 @@ -1,6 +1,6 @@ /* - * $Id: store_log.cc,v 1.7 2007/04/17 06:59:32 squidadm Exp $ + * $Id: store_log.cc,v 1.7.2.1 2007/04/18 05:08:28 dwsquid Exp $ * * DEBUG: section 20 Storage Manager Logging Functions * AUTHOR: Duane Wessels @@ -83,7 +83,7 @@ * Because if we print it before the swap file number, it'll break * the existing log format. */ - logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s %4d %9d %9d %9d %s %d/%d %s %s\n", + logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s %4d %9d %9d %9d %s %lld/%lld %s %s\n", (int) current_time.tv_sec, (int) current_time.tv_usec / 1000, storeLogTags[tag], Index: squid3/src/store_swapout.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/store_swapout.cc,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -u -r1.19 -r1.19.2.1 --- squid3/src/store_swapout.cc 17 Apr 2007 05:57:35 -0000 1.19 +++ squid3/src/store_swapout.cc 18 Apr 2007 05:08:30 -0000 1.19.2.1 @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.cc,v 1.19 2007/04/17 05:57:35 squidadm Exp $ + * $Id: store_swapout.cc,v 1.19.2.1 2007/04/18 05:08:30 dwsquid Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -204,7 +204,7 @@ debug(20, 7) ("storeSwapOut: storeOffset() = %d\n", (int) mem->swapout.sio->offset()); - ssize_t swapout_maxsize = (ssize_t) (mem->endOffset() - mem->swapout.queue_offset); + off_t swapout_maxsize = mem->endOffset() - mem->swapout.queue_offset; assert(swapout_maxsize >= 0); @@ -248,8 +248,7 @@ if (!storeSwapOutAble(e)) return; - debug(20, 7) ("storeSwapOut: swapout_size = %d\n", - (int) swapout_maxsize); + debugs(20, 7, "storeSwapOut: swapout_size = " << swapout_maxsize); if (swapout_maxsize == 0) { if (e->store_status == STORE_OK) Index: squid3/src/tunnel.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tunnel.cc,v retrieving revision 1.28 retrieving revision 1.28.6.1 diff -u -r1.28 -r1.28.6.1 --- squid3/src/tunnel.cc 12 Apr 2007 14:52:32 -0000 1.28 +++ squid3/src/tunnel.cc 18 Apr 2007 05:08:32 -0000 1.28.6.1 @@ -1,6 +1,6 @@ /* - * $Id: tunnel.cc,v 1.28 2007/04/12 14:52:32 squidadm Exp $ + * $Id: tunnel.cc,v 1.28.6.1 2007/04/18 05:08:32 dwsquid Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -90,7 +90,7 @@ void dataSent (size_t amount); int len; char *buf; - size_t *size_ptr; /* pointer to size in an ConnStateData for logging */ + off_t *size_ptr; /* pointer to size in an ConnStateData for logging */ private: int fd_; @@ -575,7 +575,7 @@ } void -sslStart(ClientHttpRequest * http, size_t * size_ptr, int *status_ptr) +sslStart(ClientHttpRequest * http, off_t * size_ptr, int *status_ptr) { /* Create state structure. */ SslStateData *sslState = NULL; Index: squid3/src/tests/stub_HttpReply.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tests/stub_HttpReply.cc,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -u -r1.3 -r1.3.10.1 --- squid3/src/tests/stub_HttpReply.cc 27 May 2006 00:50:33 -0000 1.3 +++ squid3/src/tests/stub_HttpReply.cc 18 Apr 2007 05:08:40 -0000 1.3.10.1 @@ -1,5 +1,5 @@ /* - * $Id: stub_HttpReply.cc,v 1.3 2006/05/27 00:50:33 squidadm Exp $ + * $Id: stub_HttpReply.cc,v 1.3.10.1 2007/04/18 05:08:40 dwsquid Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Robert Collins @@ -53,7 +53,7 @@ void HttpReply::setHeaders(HttpVersion ver, http_status status, const char *reason, - const char *ctype, int clen, time_t lmt, time_t expires) + const char *ctype, off_t clen, time_t lmt, time_t expires) { fatal ("Not implemented"); }