--------------------- PatchSet 6464 Date: 2005/03/03 03:44:01 Author: hno Branch: lfs-2_5 Tag: (none) Log: Substitute off_t by squid_off_t, a platform neutral type supporting large transfers without relying on large file support in the OS Members: src/HttpHdrContRange.c:1.5.74.1->1.5.74.2 src/HttpHdrRange.c:1.7.74.1->1.7.74.2 src/HttpHeader.c:1.10.6.19.2.2->1.10.6.19.2.3 src/HttpHeaderTools.c:1.7.12.3.8.2->1.7.12.3.8.3 src/HttpReply.c:1.10.6.4.6.1->1.10.6.4.6.2 src/MemPool.c:1.6.6.1.34.1->1.6.6.1.34.2 src/asn.c:1.15.6.1->1.15.6.1.20.1 src/cache_cf.c:1.38.6.18.2.2->1.38.6.18.2.3 src/cachemgr.c:1.6.6.5->1.6.6.5.26.1 src/client.c:1.8.6.5.10.3->1.8.6.5.10.4 src/client_db.c:1.6.54.4.8.1->1.6.54.4.8.2 src/client_side.c:1.47.2.56.2.2->1.47.2.56.2.3 src/defines.h:1.15.6.3.26.1->1.15.6.3.26.2 src/disk.c:1.8.14.2->1.8.14.2.8.1 src/dns_internal.c:1.15.6.5.8.1->1.15.6.5.8.2 src/ftp.c:1.18.6.18.2.3->1.18.6.18.2.4 src/globals.h:1.14.6.4.6.1->1.14.6.4.6.2 src/htcp.c:1.9.2.5.2.1->1.9.2.5.2.2 src/http.c:1.17.6.26.2.2->1.17.6.26.2.3 src/net_db.c:1.11.22.3.2.1->1.11.22.3.2.2 src/peer_digest.c:1.10.6.1.16.1->1.10.6.1.16.2 src/protos.h:1.41.6.22.2.3->1.41.6.22.2.4 src/ssl.c:1.13.6.7.8.1->1.13.6.7.8.2 src/stmem.c:1.7.66.3->1.7.66.4 src/store.c:1.16.6.7.6.2->1.16.6.7.6.3 src/store_client.c:1.9.6.2.16.1->1.9.6.2.16.2 src/store_dir.c:1.19.6.2.16.1->1.19.6.2.16.2 src/store_io.c:1.3->1.3.74.1 src/store_swapmeta.c:1.8->1.8.74.1 src/store_swapout.c:1.11.2.1.30.1->1.11.2.1.30.2 src/structs.h:1.48.2.33.2.4->1.48.2.33.2.5 src/tools.c:1.19.6.10.2.1->1.19.6.10.2.2 src/typedefs.h:1.25.6.6.8.2->1.25.6.6.8.3 src/fs/aufs/aiops.c:1.11.6.7->1.11.6.7.16.1 src/fs/aufs/async_io.c:1.7.6.4->1.7.6.4.22.1 src/fs/aufs/store_asyncufs.h:1.6.14.2->1.6.14.2.16.1 src/fs/aufs/store_dir_aufs.c:1.23.6.9->1.23.6.9.8.1 src/fs/aufs/store_io_aufs.c:1.13.2.11.8.1->1.13.2.11.8.2 src/fs/coss/async_io.c:1.3.28.3->1.3.28.3.16.1 src/fs/coss/async_io.h:1.2->1.2.110.1 src/fs/coss/store_dir_coss.c:1.17.6.9->1.17.6.9.16.1 src/fs/coss/store_io_coss.c:1.9.6.6->1.9.6.6.16.1 src/fs/diskd/diskd.c:1.6->1.6.122.1 src/fs/diskd/store_dir_diskd.c:1.32.6.8->1.32.6.8.16.1 src/fs/diskd/store_diskd.h:1.5->1.5.64.1 src/fs/diskd/store_io_diskd.c:1.8.22.3->1.8.22.3.26.1 src/fs/ufs/store_dir_ufs.c:1.21.6.10->1.21.6.10.8.1 src/fs/ufs/store_io_ufs.c:1.7.6.3.8.1->1.7.6.3.8.2 Index: squid/src/HttpHdrContRange.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpHdrContRange.c,v retrieving revision 1.5.74.1 retrieving revision 1.5.74.2 diff -u -r1.5.74.1 -r1.5.74.2 --- squid/src/HttpHdrContRange.c 25 Feb 2005 10:48:45 -0000 1.5.74.1 +++ squid/src/HttpHdrContRange.c 3 Mar 2005 03:44:01 -0000 1.5.74.2 @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrContRange.c,v 1.5.74.1 2005/02/25 10:48:45 hno Exp $ + * $Id: HttpHdrContRange.c,v 1.5.74.2 2005/03/03 03:44:01 hno Exp $ * * DEBUG: section 68 HTTP Content-Range Header * AUTHOR: Alex Rousskov @@ -81,7 +81,7 @@ p++; /* do we have last-pos ? */ if (p - field < flen) { - off_t last_pos; + squid_off_t last_pos; if (!httpHeaderParseSize(p, &last_pos)) return 0; spec->length = size_diff(last_pos + 1, spec->offset); @@ -187,7 +187,7 @@ } void -httpHdrContRangeSet(HttpHdrContRange * cr, HttpHdrRangeSpec spec, off_t ent_len) +httpHdrContRangeSet(HttpHdrContRange * cr, HttpHdrRangeSpec spec, squid_off_t ent_len) { assert(cr && ent_len >= 0); cr->spec = spec; Index: squid/src/HttpHdrRange.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpHdrRange.c,v retrieving revision 1.7.74.1 retrieving revision 1.7.74.2 diff -u -r1.7.74.1 -r1.7.74.2 --- squid/src/HttpHdrRange.c 25 Feb 2005 10:48:45 -0000 1.7.74.1 +++ squid/src/HttpHdrRange.c 3 Mar 2005 03:44:01 -0000 1.7.74.2 @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrRange.c,v 1.7.74.1 2005/02/25 10:48:45 hno Exp $ + * $Id: HttpHdrRange.c,v 1.7.74.2 2005/03/03 03:44:01 hno Exp $ * * DEBUG: section 64 HTTP Range Header * AUTHOR: Alex Rousskov @@ -55,7 +55,7 @@ /* local constants */ -#define range_spec_unknown ((off_t)-1) +#define range_spec_unknown ((squid_off_t)-1) /* local routines */ #define known_spec(s) ((s) != range_spec_unknown) @@ -102,7 +102,7 @@ p++; /* do we have last-pos ? */ if (p - field < flen) { - off_t last_pos; + squid_off_t last_pos; if (!httpHeaderParseSize(p, &last_pos)) return NULL; spec.length = size_diff(last_pos + 1, spec.offset); @@ -303,7 +303,7 @@ * - there is at least one range spec */ int -httpHdrRangeCanonize(HttpHdrRange * range, off_t clen) +httpHdrRangeCanonize(HttpHdrRange * range, squid_off_t clen) { int i; HttpHdrRangeSpec *spec; @@ -415,10 +415,10 @@ * Returns lowest known offset in range spec(s), or range_spec_unknown * this is used for size limiting */ -off_t +squid_off_t httpHdrRangeFirstOffset(const HttpHdrRange * range) { - off_t offset = range_spec_unknown; + squid_off_t offset = range_spec_unknown; HttpHdrRangePos pos = HttpHdrRangeInitPos; const HttpHdrRangeSpec *spec; assert(range); @@ -435,11 +435,11 @@ * ranges are combined into one, for example FTP REST. * Use 0 for size if unknown */ -off_t -httpHdrRangeLowestOffset(const HttpHdrRange * range, off_t size) +squid_off_t +httpHdrRangeLowestOffset(const HttpHdrRange * range, squid_off_t size) { - off_t offset = range_spec_unknown; - off_t current; + squid_off_t offset = range_spec_unknown; + squid_off_t current; HttpHdrRangePos pos = HttpHdrRangeInitPos; const HttpHdrRangeSpec *spec; assert(range); Index: squid/src/HttpHeader.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpHeader.c,v retrieving revision 1.10.6.19.2.2 retrieving revision 1.10.6.19.2.3 diff -u -r1.10.6.19.2.2 -r1.10.6.19.2.3 --- squid/src/HttpHeader.c 3 Mar 2005 00:11:55 -0000 1.10.6.19.2.2 +++ squid/src/HttpHeader.c 3 Mar 2005 03:44:01 -0000 1.10.6.19.2.3 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.c,v 1.10.6.19.2.2 2005/03/03 00:11:55 hno Exp $ + * $Id: HttpHeader.c,v 1.10.6.19.2.3 2005/03/03 03:44:01 hno Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -807,7 +807,7 @@ } void -httpHeaderPutSize(HttpHeader * hdr, http_hdr_type id, off_t number) +httpHeaderPutSize(HttpHeader * hdr, http_hdr_type id, squid_off_t number) { char size[64]; assert_eid(id); @@ -923,11 +923,11 @@ return value; } -off_t +squid_off_t httpHeaderGetSize(const HttpHeader * hdr, http_hdr_type id) { HttpHeaderEntry *e; - off_t value = -1; + squid_off_t value = -1; int ok; assert_eid(id); assert(Headers[id].type == ftSize); /* must be of an appropriate type */ Index: squid/src/HttpHeaderTools.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpHeaderTools.c,v retrieving revision 1.7.12.3.8.2 retrieving revision 1.7.12.3.8.3 diff -u -r1.7.12.3.8.2 -r1.7.12.3.8.3 --- squid/src/HttpHeaderTools.c 3 Mar 2005 02:00:35 -0000 1.7.12.3.8.2 +++ squid/src/HttpHeaderTools.c 3 Mar 2005 03:44:01 -0000 1.7.12.3.8.3 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeaderTools.c,v 1.7.12.3.8.2 2005/03/03 02:00:35 hno Exp $ + * $Id: HttpHeaderTools.c,v 1.7.12.3.8.3 2005/03/03 03:44:01 hno Exp $ * * DEBUG: section 66 HTTP Header Tools * AUTHOR: Alex Rousskov @@ -138,7 +138,7 @@ /* wrapper arrounf PutContRange */ void -httpHeaderAddContRange(HttpHeader * hdr, HttpHdrRangeSpec spec, off_t ent_len) +httpHeaderAddContRange(HttpHeader * hdr, HttpHdrRangeSpec spec, squid_off_t ent_len) { HttpHdrContRange *cr = httpHdrContRangeCreate(); assert(hdr && ent_len >= 0); @@ -316,10 +316,10 @@ return 1; } -off_t -httpHeaderParseSize(const char *start, off_t * value) +squid_off_t +httpHeaderParseSize(const char *start, squid_off_t * value) { - off_t v; + squid_off_t v; char *end; int res; v = strto_off_t(start, &end, 10); Index: squid/src/HttpReply.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpReply.c,v retrieving revision 1.10.6.4.6.1 retrieving revision 1.10.6.4.6.2 diff -u -r1.10.6.4.6.1 -r1.10.6.4.6.2 --- squid/src/HttpReply.c 25 Feb 2005 10:48:45 -0000 1.10.6.4.6.1 +++ squid/src/HttpReply.c 3 Mar 2005 03:44:01 -0000 1.10.6.4.6.2 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.c,v 1.10.6.4.6.1 2005/02/25 10:48:45 hno Exp $ + * $Id: HttpReply.c,v 1.10.6.4.6.2 2005/03/03 03:44:01 hno Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -135,7 +135,7 @@ * returns true on success. */ int -httpReplyParse(HttpReply * rep, const char *buf, off_t end) +httpReplyParse(HttpReply * rep, const char *buf, squid_off_t end) { /* * this extra buffer/copy will be eliminated when headers become @@ -197,7 +197,7 @@ #if UNUSED_CODE MemBuf httpPackedReply(http_version_t ver, http_status status, const char *ctype, - off_t clen, time_t lmt, time_t expires) + squid_off_t clen, time_t lmt, time_t expires) { HttpReply *rep = httpReplyCreate(); MemBuf mb; @@ -232,7 +232,7 @@ void httpReplySetHeaders(HttpReply * reply, http_version_t ver, http_status status, const char *reason, - const char *ctype, off_t clen, time_t lmt, time_t expires) + const char *ctype, squid_off_t clen, time_t lmt, time_t expires) { HttpHeader *hdr; assert(reply); @@ -451,7 +451,7 @@ /* * Returns the body size of a HTTP response */ -off_t +squid_off_t httpReplyBodySize(method_t method, const HttpReply * reply) { if (reply->sline.version.major < 1) Index: squid/src/MemPool.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/MemPool.c,v retrieving revision 1.6.6.1.34.1 retrieving revision 1.6.6.1.34.2 diff -u -r1.6.6.1.34.1 -r1.6.6.1.34.2 --- squid/src/MemPool.c 25 Feb 2005 10:48:45 -0000 1.6.6.1.34.1 +++ squid/src/MemPool.c 3 Mar 2005 03:44:01 -0000 1.6.6.1.34.2 @@ -1,6 +1,6 @@ /* - * $Id: MemPool.c,v 1.6.6.1.34.1 2005/02/25 10:48:45 hno Exp $ + * $Id: MemPool.c,v 1.6.6.1.34.2 2005/03/03 03:44:01 hno Exp $ * * DEBUG: section 63 Low Level Memory Pool Management * AUTHOR: Alex Rousskov @@ -58,9 +58,9 @@ static Stack Pools; /* local prototypes */ -static void memShrink(off_t new_limit); +static void memShrink(squid_off_t new_limit); static void memPoolDescribe(const MemPool * pool); -static void memPoolShrink(MemPool * pool, off_t new_limit); +static void memPoolShrink(MemPool * pool, squid_off_t new_limit); static double @@ -135,9 +135,9 @@ static void -memShrink(off_t new_limit) +memShrink(squid_off_t new_limit) { - off_t start_limit = TheMeter.idle.level; + squid_off_t start_limit = TheMeter.idle.level; int i; assert(start_limit >= 0 && new_limit >= 0); debug(63, 1) ("memShrink: started with %ld KB goal: %ld KB\n", @@ -145,7 +145,7 @@ /* first phase: cut proportionally to the pool idle size */ for (i = 0; i < Pools.count && TheMeter.idle.level > new_limit; ++i) { MemPool *pool = Pools.items[i]; - const off_t target_pool_size = (size_t) ((double) pool->meter.idle.level * new_limit) / start_limit; + const squid_off_t target_pool_size = (size_t) ((double) pool->meter.idle.level * new_limit) / start_limit; memPoolShrink(pool, target_pool_size); } debug(63, 1) ("memShrink: 1st phase done with %ld KB left\n", (long int) toKB(TheMeter.idle.level)); @@ -276,7 +276,7 @@ } static void -memPoolShrink(MemPool * pool, off_t new_limit) +memPoolShrink(MemPool * pool, squid_off_t new_limit) { assert(pool); assert(new_limit >= 0); @@ -304,11 +304,11 @@ return pool->meter.inuse.level; } -off_t +squid_off_t memPoolInUseSize(const MemPool * pool) { assert(pool); - return ((off_t)pool->obj_size) * pool->meter.inuse.level; + return ((squid_off_t)pool->obj_size) * pool->meter.inuse.level; } /* to-do: make debug level a parameter? */ Index: squid/src/asn.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/asn.c,v retrieving revision 1.15.6.1 retrieving revision 1.15.6.1.20.1 diff -u -r1.15.6.1 -r1.15.6.1.20.1 --- squid/src/asn.c 19 Jun 2003 02:13:57 -0000 1.15.6.1 +++ squid/src/asn.c 3 Mar 2005 03:44:01 -0000 1.15.6.1.20.1 @@ -1,6 +1,6 @@ /* - * $Id: asn.c,v 1.15.6.1 2003/06/19 02:13:57 squidadm Exp $ + * $Id: asn.c,v 1.15.6.1.20.1 2005/03/03 03:44:01 hno Exp $ * * DEBUG: section 53 AS Number handling * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -73,8 +73,8 @@ store_client *sc; request_t *request; int as_number; - off_t seen; - off_t offset; + squid_off_t seen; + squid_off_t offset; }; typedef struct _ASState ASState; Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v retrieving revision 1.38.6.18.2.2 retrieving revision 1.38.6.18.2.3 diff -u -r1.38.6.18.2.2 -r1.38.6.18.2.3 --- squid/src/cache_cf.c 3 Mar 2005 02:00:35 -0000 1.38.6.18.2.2 +++ squid/src/cache_cf.c 3 Mar 2005 03:44:02 -0000 1.38.6.18.2.3 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.38.6.18.2.2 2005/03/03 02:00:35 hno Exp $ + * $Id: cache_cf.c,v 1.38.6.18.2.3 2005/03/03 03:44:02 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -78,7 +78,7 @@ static void default_all(void); static void defaults_if_none(void); static int parse_line(char *); -static void parseBytesLine(off_t * bptr, const char *units); +static void parseBytesLine(squid_off_t * bptr, const char *units); static size_t parseBytesUnits(const char *unit); static void free_all(void); void requirePathnameExists(const char *name, const char *path); @@ -222,12 +222,12 @@ return i; } -static off_t +static squid_off_t GetOffT(void) { char *token = strtok(NULL, w_space); char *end; - off_t i; + squid_off_t i; if (token == NULL) self_destruct(); i = strto_off_t(token, &end, 0); @@ -247,7 +247,7 @@ update_maxobjsize(void) { int i; - off_t ms = -1; + squid_off_t ms = -1; for (i = 0; i < Config.cacheSwap.n_configured; i++) { if (Config.cacheSwap.swapDirs[i].max_objsize > ms) @@ -517,18 +517,18 @@ } static void -parseBytesLine(off_t * bptr, const char *units) +parseBytesLine(squid_off_t * bptr, const char *units) { char *token; double d; - off_t m; - off_t u; + squid_off_t m; + squid_off_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 = (off_t) - 1; + *bptr = (squid_off_t) - 1; return; } d = atof(token); @@ -1348,12 +1348,12 @@ static void parse_cachedir_option_maxsize(SwapDir * sd, const char *option, const char *value, int reconfiguring) { - off_t size; + squid_off_t size; if (!value) self_destruct(); - size = atoi(value); + size = strto_off_t(value, NULL, 10); if (reconfiguring && sd->max_objsize != size) debug(3, 1) ("Cache dir '%s' max object size now %ld\n", sd->path, (long int) size); @@ -2100,20 +2100,20 @@ #if UNUSED_CODE static void -dump_size_t(StoreEntry * entry, const char *name, off_t var) +dump_size_t(StoreEntry * entry, const char *name, squid_off_t var) { storeAppendPrintf(entry, "%s %"PRINTF_OFF_T"\n", name, var); } #endif static void -dump_b_size_t(StoreEntry * entry, const char *name, off_t var) +dump_b_size_t(StoreEntry * entry, const char *name, squid_off_t var) { storeAppendPrintf(entry, "%s %"PRINTF_OFF_T" %s\n", name, var, B_BYTES_STR); } static void -dump_kb_size_t(StoreEntry * entry, const char *name, off_t var) +dump_kb_size_t(StoreEntry * entry, const char *name, squid_off_t var) { storeAppendPrintf(entry, "%s %"PRINTF_OFF_T" %s\n", name, var, B_KBYTES_STR); } @@ -2127,7 +2127,7 @@ #endif static void -parse_b_size_t(off_t * var) +parse_b_size_t(squid_off_t * var) { parseBytesLine(var, B_BYTES_STR); } @@ -2192,13 +2192,13 @@ static void -parse_kb_size_t(off_t * var) +parse_kb_size_t(squid_off_t * var) { parseBytesLine(var, B_KBYTES_STR); } static void -free_size_t(off_t * var) +free_size_t(squid_off_t * var) { *var = 0; } Index: squid/src/cachemgr.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/cachemgr.c,v retrieving revision 1.6.6.5 retrieving revision 1.6.6.5.26.1 diff -u -r1.6.6.5 -r1.6.6.5.26.1 --- squid/src/cachemgr.c 10 Nov 2002 22:44:12 -0000 1.6.6.5 +++ squid/src/cachemgr.c 3 Mar 2005 03:44:02 -0000 1.6.6.5.26.1 @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.c,v 1.6.6.5 2002/11/10 22:44:12 squidadm Exp $ + * $Id: cachemgr.c,v 1.6.6.5.26.1 2005/03/03 03:44:02 hno Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Duane Wessels @@ -735,7 +735,7 @@ make_auth_header(const cachemgr_request * req) { static char buf[1024]; - off_t l = 0; + int l = 0; const char *str64; if (!req->passwd) return ""; Index: squid/src/client.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/client.c,v retrieving revision 1.8.6.5.10.3 retrieving revision 1.8.6.5.10.4 diff -u -r1.8.6.5.10.3 -r1.8.6.5.10.4 --- squid/src/client.c 3 Mar 2005 01:28:48 -0000 1.8.6.5.10.3 +++ squid/src/client.c 3 Mar 2005 03:44:02 -0000 1.8.6.5.10.4 @@ -1,6 +1,6 @@ /* - * $Id: client.c,v 1.8.6.5.10.3 2005/03/03 01:28:48 hno Exp $ + * $Id: client.c,v 1.8.6.5.10.4 2005/03/03 03:44:02 hno Exp $ * * DEBUG: section 0 WWW Client * AUTHOR: Harvest Derived @@ -47,8 +47,8 @@ static SIGHDLR catch; static SIGHDLR pipe_handler; static void set_our_signal(void); -static off_t myread(int fd, void *buf, size_t len); -static off_t mywrite(int fd, void *buf, size_t len); +static squid_off_t myread(int fd, void *buf, size_t len); +static squid_off_t mywrite(int fd, void *buf, size_t len); static int put_fd; static char *put_file = NULL; static struct stat sb; @@ -311,7 +311,7 @@ } loops = ping ? pcount : 1; for (i = 0; loops == 0 || i < loops; i++) { - off_t fsize = 0; + squid_off_t fsize = 0; /* Connect to the server */ if ((conn = socket(PF_INET, SOCK_STREAM, 0)) < 0) { perror("client: socket"); @@ -490,14 +490,14 @@ } -static off_t +static squid_off_t myread(int fd, void *buf, size_t len) { alarm(io_timeout); return read(fd, buf, len); } -static off_t +static squid_off_t mywrite(int fd, void *buf, size_t len) { alarm(io_timeout); Index: squid/src/client_db.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_db.c,v retrieving revision 1.6.54.4.8.1 retrieving revision 1.6.54.4.8.2 diff -u -r1.6.54.4.8.1 -r1.6.54.4.8.2 --- squid/src/client_db.c 25 Feb 2005 10:48:48 -0000 1.6.54.4.8.1 +++ squid/src/client_db.c 3 Mar 2005 03:44:03 -0000 1.6.54.4.8.2 @@ -1,6 +1,6 @@ /* - * $Id: client_db.c,v 1.6.54.4.8.1 2005/02/25 10:48:48 hno Exp $ + * $Id: client_db.c,v 1.6.54.4.8.2 2005/03/03 03:44:03 hno Exp $ * * DEBUG: section 0 Client Database * AUTHOR: Duane Wessels @@ -77,7 +77,7 @@ } void -clientdbUpdate(struct in_addr addr, log_type ltype, protocol_t p, off_t size) +clientdbUpdate(struct in_addr addr, log_type ltype, protocol_t p, squid_off_t size) { char *key; ClientInfo *c; Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.47.2.56.2.2 retrieving revision 1.47.2.56.2.3 diff -u -r1.47.2.56.2.2 -r1.47.2.56.2.3 --- squid/src/client_side.c 3 Mar 2005 01:07:11 -0000 1.47.2.56.2.2 +++ squid/src/client_side.c 3 Mar 2005 03:44:03 -0000 1.47.2.56.2.3 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.47.2.56.2.2 2005/03/03 01:07:11 hno Exp $ + * $Id: client_side.c,v 1.47.2.56.2.3 2005/03/03 03:44:03 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -125,8 +125,8 @@ static int clientCheckContentLength(request_t * r); static DEFER httpAcceptDefer; static log_type clientProcessRequest2(clientHttpRequest * http); -static int clientReplyBodyTooLarge(clientHttpRequest *, off_t clen); -static int clientRequestBodyTooLarge(off_t clen); +static int clientReplyBodyTooLarge(clientHttpRequest *, squid_off_t clen); +static int clientRequestBodyTooLarge(squid_off_t clen); static void clientProcessBody(ConnStateData * conn); static void clientEatRequestBody(clientHttpRequest *); static BODY_HANDLER clientReadBody; @@ -602,7 +602,7 @@ int modifiedSince(StoreEntry * entry, request_t * request) { - off_t object_length; + squid_off_t object_length; MemObject *mem = entry->mem_obj; time_t mod_time = entry->lastmod; debug(33, 3) ("modifiedSince: '%s'\n", storeUrl(entry)); @@ -1224,10 +1224,10 @@ * warning: assumes that HTTP headers for individual ranges at the * time of the actuall assembly will be exactly the same as * the headers when clientMRangeCLen() is called */ -static off_t +static squid_off_t clientMRangeCLen(clientHttpRequest * http) { - off_t clen = 0; + squid_off_t clen = 0; HttpHdrRangePos pos = HttpHdrRangeInitPos; const HttpHdrRangeSpec *spec; MemBuf mb; @@ -1295,7 +1295,7 @@ http->request->range = NULL; } else { const int spec_count = http->request->range->specs.count; - off_t actual_clen = -1; + squid_off_t actual_clen = -1; debug(33, 3) ("clientBuildRangeHeader: range spec count: %d virgin clen: %"PRINTF_OFF_T"\n", spec_count, rep->content_length); @@ -1729,11 +1729,11 @@ clientPackRange(clientHttpRequest * http, HttpHdrRangeIter * i, const char **buf, - off_t * size, + squid_off_t * size, MemBuf * mb) { - const off_t copy_sz = i->debt_size <= *size ? i->debt_size : *size; - off_t body_off = http->out.offset - i->prefix_size; + const squid_off_t copy_sz = i->debt_size <= *size ? i->debt_size : *size; + squid_off_t body_off = http->out.offset - i->prefix_size; assert(*size > 0); assert(i->spec); /* @@ -1777,7 +1777,7 @@ * increments iterator "i" * used by clientPackMoreRanges */ static int -clientCanPackMoreRanges(const clientHttpRequest * http, HttpHdrRangeIter * i, off_t size) +clientCanPackMoreRanges(const clientHttpRequest * http, HttpHdrRangeIter * i, squid_off_t size) { /* first update "i" if needed */ if (!i->debt_size) { @@ -1792,17 +1792,17 @@ /* extracts "ranges" from buf and appends them to mb, updating all offsets and such */ /* returns true if we need more data */ static int -clientPackMoreRanges(clientHttpRequest * http, const char *buf, off_t size, MemBuf * mb) +clientPackMoreRanges(clientHttpRequest * http, const char *buf, squid_off_t size, MemBuf * mb) { HttpHdrRangeIter *i = &http->range_iter; /* offset in range specs does not count the prefix of an http msg */ - off_t body_off = http->out.offset - i->prefix_size; + squid_off_t body_off = http->out.offset - i->prefix_size; assert(size >= 0); /* check: reply was parsed and range iterator was initialized */ assert(i->prefix_size > 0); /* filter out data according to range specs */ while (clientCanPackMoreRanges(http, i, size)) { - off_t start; /* offset of still missing data */ + squid_off_t start; /* offset of still missing data */ assert(i->spec); start = i->spec->offset + i->spec->length - i->debt_size; debug(33, 3) ("clientPackMoreRanges: in: offset: %ld size: %ld\n", @@ -1876,7 +1876,7 @@ } static int -clientReplyBodyTooLarge(clientHttpRequest * http, off_t clen) +clientReplyBodyTooLarge(clientHttpRequest * http, squid_off_t clen) { if (0 == http->maxBodySize) return 0; /* disabled */ @@ -1888,7 +1888,7 @@ } static int -clientRequestBodyTooLarge(off_t clen) +clientRequestBodyTooLarge(squid_off_t clen) { if (0 == Config.maxRequestBodySize) return 0; /* disabled */ @@ -1939,9 +1939,9 @@ int fd = conn->fd; HttpReply *rep = NULL; const char *body_buf = buf; - off_t body_size = size; + squid_off_t body_size = size; MemBuf mb; - off_t check_size = 0; + squid_off_t check_size = 0; debug(33, 5) ("clientSendMoreData: %s, %d bytes\n", http->uri, (int) size); assert(size <= CLIENT_SOCK_SZ); assert(http->request != NULL); @@ -3636,7 +3636,7 @@ StoreEntry *entry = http->entry; MemObject *mem; http_reply *reply; - off_t sendlen; + squid_off_t sendlen; if (entry == NULL) return 0; /* @@ -3699,7 +3699,7 @@ static int clientGotNotEnough(clientHttpRequest * http) { - off_t cl = httpReplyBodySize(http->request->method, http->entry->mem_obj->reply); + squid_off_t cl = httpReplyBodySize(http->request->method, http->entry->mem_obj->reply); int hs = http->entry->mem_obj->reply->hdr_sz; assert(cl >= 0); if (http->out.offset < cl + hs) Index: squid/src/defines.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/defines.h,v retrieving revision 1.15.6.3.26.1 retrieving revision 1.15.6.3.26.2 diff -u -r1.15.6.3.26.1 -r1.15.6.3.26.2 --- squid/src/defines.h 3 Mar 2005 02:00:37 -0000 1.15.6.3.26.1 +++ squid/src/defines.h 3 Mar 2005 03:44:03 -0000 1.15.6.3.26.2 @@ -1,6 +1,6 @@ /* - * $Id: defines.h,v 1.15.6.3.26.1 2005/03/03 02:00:37 hno Exp $ + * $Id: defines.h,v 1.15.6.3.26.2 2005/03/03 03:44:03 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -308,9 +308,9 @@ #endif /* - * Macro to simplify off_t parsing + * Macro to simplify squid_off_t parsing */ -#if SIZEOF_OFF_T > SIZEOF_LONG +#if SIZEOF_LONG_LONG > SIZEOF_LONG #define strto_off_t strtoll #else #define strto_off_t strtol Index: squid/src/disk.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/disk.c,v retrieving revision 1.8.14.2 retrieving revision 1.8.14.2.8.1 diff -u -r1.8.14.2 -r1.8.14.2.8.1 --- squid/src/disk.c 7 Nov 2004 03:14:27 -0000 1.8.14.2 +++ squid/src/disk.c 3 Mar 2005 03:44:04 -0000 1.8.14.2.8.1 @@ -1,6 +1,6 @@ /* - * $Id: disk.c,v 1.8.14.2 2004/11/07 03:14:27 squidadm Exp $ + * $Id: disk.c,v 1.8.14.2.8.1 2005/03/03 03:44:04 hno Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -291,7 +291,7 @@ /* call a handle when writing is complete. */ void file_write(int fd, - off_t file_offset, + squid_off_t file_offset, void *ptr_to_buf, int len, DWCB * handle, @@ -331,7 +331,7 @@ * in a snap */ void -file_write_mbuf(int fd, off_t off, MemBuf mb, DWCB * handler, void *handler_data) +file_write_mbuf(int fd, squid_off_t off, MemBuf mb, DWCB * handler, void *handler_data) { file_write(fd, off, mb.buf, mb.size, handler, handler_data, memBufFreeFunc(&mb)); } @@ -388,7 +388,7 @@ * It must have at least req_len space in there. * call handler when a reading is complete. */ void -file_read(int fd, char *buf, int req_len, off_t offset, DRCB * handler, void *client_data) +file_read(int fd, char *buf, int req_len, squid_off_t offset, DRCB * handler, void *client_data) { dread_ctrl *ctrl_dat; assert(fd >= 0); Index: squid/src/dns_internal.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/dns_internal.c,v retrieving revision 1.15.6.5.8.1 retrieving revision 1.15.6.5.8.2 diff -u -r1.15.6.5.8.1 -r1.15.6.5.8.2 --- squid/src/dns_internal.c 25 Feb 2005 10:48:49 -0000 1.15.6.5.8.1 +++ squid/src/dns_internal.c 3 Mar 2005 03:44:04 -0000 1.15.6.5.8.2 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.c,v 1.15.6.5.8.1 2005/02/25 10:48:49 hno Exp $ + * $Id: dns_internal.c,v 1.15.6.5.8.2 2005/03/03 03:44:04 hno Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -518,7 +518,7 @@ idnsRead(int fd, void *data) { int *N = &incoming_sockets_accepted; - off_t len; + squid_off_t len; struct sockaddr_in from; socklen_t from_len; int max = INCOMING_DNS_MAX; Index: squid/src/ftp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ftp.c,v retrieving revision 1.18.6.18.2.3 retrieving revision 1.18.6.18.2.4 diff -u -r1.18.6.18.2.3 -r1.18.6.18.2.4 --- squid/src/ftp.c 3 Mar 2005 02:00:38 -0000 1.18.6.18.2.3 +++ squid/src/ftp.c 3 Mar 2005 03:44:04 -0000 1.18.6.18.2.4 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.18.6.18.2.3 2005/03/03 02:00:38 hno Exp $ + * $Id: ftp.c,v 1.18.6.18.2.4 2005/03/03 03:44:04 hno Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -93,11 +93,11 @@ int login_att; ftp_state_t state; time_t mdtm; - off_t size; + squid_off_t size; wordlist *pathcomps; char *filepath; - off_t restart_offset; - off_t restarted_offset; + squid_off_t restart_offset; + squid_off_t restarted_offset; int rest_att; char *proxy_host; int list_width; @@ -132,7 +132,7 @@ typedef struct { char type; - off_t size; + squid_off_t size; char *date; char *name; char *showname; @@ -770,7 +770,7 @@ case '-': default: { - off_t sz = parts->size; + squid_off_t sz = parts->size; char units = ' '; snprintf(icon, 2048, "\"%-6s\"", mimeGetIconURL(parts->name), Index: squid/src/globals.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/globals.h,v retrieving revision 1.14.6.4.6.1 retrieving revision 1.14.6.4.6.2 diff -u -r1.14.6.4.6.1 -r1.14.6.4.6.2 --- squid/src/globals.h 25 Feb 2005 10:48:49 -0000 1.14.6.4.6.1 +++ squid/src/globals.h 3 Mar 2005 03:44:04 -0000 1.14.6.4.6.2 @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.14.6.4.6.1 2005/02/25 10:48:49 hno Exp $ + * $Id: globals.h,v 1.14.6.4.6.2 2005/03/03 03:44:04 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -154,7 +154,7 @@ extern int store_swap_low; /* 0 */ extern int store_swap_high; /* 0 */ extern int store_pages_max; /* 0 */ -extern off_t store_maxobjsize; /* -1 */ +extern squid_off_t store_maxobjsize; /* -1 */ extern RemovalPolicy *mem_policy; extern hash_table *proxy_auth_username_cache; /* NULL */ extern int incoming_sockets_accepted; Index: squid/src/htcp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/htcp.c,v retrieving revision 1.9.2.5.2.1 retrieving revision 1.9.2.5.2.2 diff -u -r1.9.2.5.2.1 -r1.9.2.5.2.2 --- squid/src/htcp.c 25 Feb 2005 10:48:49 -0000 1.9.2.5.2.1 +++ squid/src/htcp.c 3 Mar 2005 03:44:04 -0000 1.9.2.5.2.2 @@ -1,6 +1,6 @@ /* - * $Id: htcp.c,v 1.9.2.5.2.1 2005/02/25 10:48:49 hno Exp $ + * $Id: htcp.c,v 1.9.2.5.2.2 2005/03/03 03:44:04 hno Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -159,17 +159,17 @@ static MemPool *htcpDetailPool = NULL; -static char *htcpBuildPacket(htcpStuff * stuff, off_t * len); +static char *htcpBuildPacket(htcpStuff * stuff, squid_off_t * len); static htcpSpecifier *htcpUnpackSpecifier(char *buf, int sz); static htcpDetail *htcpUnpackDetail(char *buf, int sz); static int htcpUnpackCountstr(char *buf, int sz, char **str); -static off_t htcpBuildAuth(char *buf, size_t buflen); -static off_t htcpBuildCountstr(char *buf, size_t buflen, const char *s); -static off_t htcpBuildData(char *buf, size_t buflen, htcpStuff * stuff); -static off_t htcpBuildDetail(char *buf, size_t buflen, htcpStuff * stuff); -static off_t htcpBuildOpData(char *buf, size_t buflen, htcpStuff * stuff); -static off_t htcpBuildSpecifier(char *buf, size_t buflen, htcpStuff * stuff); -static off_t htcpBuildTstOpData(char *buf, size_t buflen, htcpStuff * stuff); +static squid_off_t htcpBuildAuth(char *buf, size_t buflen); +static squid_off_t htcpBuildCountstr(char *buf, size_t buflen, const char *s); +static squid_off_t htcpBuildData(char *buf, size_t buflen, htcpStuff * stuff); +static squid_off_t htcpBuildDetail(char *buf, size_t buflen, htcpStuff * stuff); +static squid_off_t htcpBuildOpData(char *buf, size_t buflen, htcpStuff * stuff); +static squid_off_t htcpBuildSpecifier(char *buf, size_t buflen, htcpStuff * stuff); +static squid_off_t htcpBuildTstOpData(char *buf, size_t buflen, htcpStuff * stuff); static void htcpFreeSpecifier(htcpSpecifier * s); static void htcpFreeDetail(htcpDetail * s); static void htcpHandle(char *buf, int sz, struct sockaddr_in *from); @@ -209,7 +209,7 @@ * STUFF FOR SENDING HTCP MESSAGES */ -static off_t +static squid_off_t htcpBuildAuth(char *buf, size_t buflen) { htcpAuthHeader auth; @@ -222,12 +222,12 @@ return copy_sz; } -static off_t +static squid_off_t htcpBuildCountstr(char *buf, size_t buflen, const char *s) { u_short length; size_t len; - off_t off = 0; + squid_off_t off = 0; if (buflen - off < 2) return -1; if (s) @@ -247,11 +247,11 @@ return off; } -static off_t +static squid_off_t htcpBuildSpecifier(char *buf, size_t buflen, htcpStuff * stuff) { - off_t off = 0; - off_t s; + squid_off_t off = 0; + squid_off_t s; s = htcpBuildCountstr(buf + off, buflen - off, stuff->S.method); if (s < 0) return s; @@ -272,11 +272,11 @@ return off; } -static off_t +static squid_off_t htcpBuildDetail(char *buf, size_t buflen, htcpStuff * stuff) { - off_t off = 0; - off_t s; + squid_off_t off = 0; + squid_off_t s; s = htcpBuildCountstr(buf + off, buflen - off, stuff->D.resp_hdrs); if (s < 0) return s; @@ -292,7 +292,7 @@ return off; } -static off_t +static squid_off_t htcpBuildTstOpData(char *buf, size_t buflen, htcpStuff * stuff) { switch (stuff->rr) { @@ -312,10 +312,10 @@ return 0; } -static off_t +static squid_off_t htcpBuildOpData(char *buf, size_t buflen, htcpStuff * stuff) { - off_t off = 0; + squid_off_t off = 0; debug(31, 3) ("htcpBuildOpData: opcode %s\n", htcpOpcodeStr[stuff->op]); switch (stuff->op) { @@ -329,11 +329,11 @@ return off; } -static off_t +static squid_off_t htcpBuildData(char *buf, size_t buflen, htcpStuff * stuff) { - off_t off = 0; - off_t op_data_sz; + squid_off_t off = 0; + squid_off_t op_data_sz; size_t hdr_sz = sizeof(htcpDataHeader); htcpDataHeader hdr; if (buflen < hdr_sz) @@ -359,11 +359,11 @@ } static char * -htcpBuildPacket(htcpStuff * stuff, off_t * len) +htcpBuildPacket(htcpStuff * stuff, squid_off_t * len) { size_t buflen = 8192; - off_t s; - off_t off = 0; + squid_off_t s; + squid_off_t off = 0; size_t hdr_sz = sizeof(htcpHeader); htcpHeader hdr; char *buf = xcalloc(buflen, 1); @@ -544,7 +544,7 @@ HttpHeader hdr; MemBuf mb; Packer p; - off_t pktlen; + squid_off_t pktlen; char *host; int rtt = 0; int hops = 0; @@ -596,389 +596,4 @@ memBufClean(&mb); httpHeaderClean(&hdr); packerClean(&p); - } - pkt = htcpBuildPacket(&stuff, &pktlen); - if (pkt == NULL) { - debug(31, 0) ("htcpTstReply: htcpBuildPacket() failed\n"); - return; - } - htcpSend(pkt, (int) pktlen, from); - xfree(pkt); -} - -static void -htcpHandleNop(htcpDataHeader * hdr, char *buf, int sz, struct sockaddr_in *from) -{ - debug(31, 3) ("htcpHandleNop: Unimplemented\n"); -} - -static StoreEntry * -htcpCheckHit(const htcpSpecifier * s) -{ - request_t *request; - method_t m = urlParseMethod(s->method); - StoreEntry *e = NULL, *hit = NULL; - char *blk_end; - request = urlParse(m, s->uri); - if (NULL == request) { - debug(31, 3) ("htcpCheckHit: NO; failed to parse URL\n"); - return NULL; - } - blk_end = s->req_hdrs + strlen(s->req_hdrs); - if (!httpHeaderParse(&request->header, s->req_hdrs, blk_end)) { - debug(31, 3) ("htcpCheckHit: NO; failed to parse request headers\n"); - goto miss; - } - e = storeGetPublicByRequest(request); - if (NULL == e) { - debug(31, 3) ("htcpCheckHit: NO; public object not found\n"); - goto miss; - } - if (!storeEntryValidToSend(e)) { - debug(31, 3) ("htcpCheckHit: NO; entry not valid to send\n"); - goto miss; - } - if (refreshCheckHTCP(e, request)) { - debug(31, 3) ("htcpCheckHit: NO; cached response is stale\n"); - goto miss; - } - debug(31, 3) ("htcpCheckHit: YES!?\n"); - hit = e; - miss: - requestDestroy(request); - return hit; -} - -static void -htcpHandleTst(htcpDataHeader * hdr, char *buf, int sz, struct sockaddr_in *from) -{ - debug(31, 3) ("htcpHandleTst: sz = %d\n", (int) sz); - if (hdr->RR == RR_REQUEST) - htcpHandleTstRequest(hdr, buf, sz, from); - else - htcpHandleTstResponse(hdr, buf, sz, from); -} - -static void -htcpHandleTstResponse(htcpDataHeader * hdr, char *buf, int sz, struct sockaddr_in *from) -{ - htcpReplyData htcpReply; - cache_key *key = NULL; - htcpDetail *d = NULL; - char *t; - if (hdr->F1 == 1) { - debug(31, 1) ("htcpHandleTstResponse: error condition, F1/MO == 1\n"); - return; - } - memset(&htcpReply, '\0', sizeof(htcpReply)); - httpHeaderInit(&htcpReply.hdr, hoHtcpReply); - htcpReply.msg_id = hdr->msg_id; - debug(31, 3) ("htcpHandleTstResponse: msg_id = %d\n", (int) htcpReply.msg_id); - htcpReply.hit = hdr->response ? 0 : 1; - if (hdr->F1) { - debug(31, 3) ("htcpHandleTstResponse: MISS\n"); - } else { - debug(31, 3) ("htcpHandleTstResponse: HIT\n"); - d = htcpUnpackDetail(buf, sz); - if (d == NULL) { - debug(31, 1) ("htcpHandleTstResponse: bad DETAIL\n"); - return; - } - if ((t = d->resp_hdrs)) - httpHeaderParse(&htcpReply.hdr, t, t + strlen(t)); - if ((t = d->entity_hdrs)) - httpHeaderParse(&htcpReply.hdr, t, t + strlen(t)); - if ((t = d->cache_hdrs)) - httpHeaderParse(&htcpReply.hdr, t, t + strlen(t)); - } - key = queried_keys[htcpReply.msg_id % N_QUERIED_KEYS]; - debug(31, 3) ("htcpHandleTstResponse: key (%p) %s\n", key, storeKeyText(key)); - neighborsHtcpReply(key, &htcpReply, from); - httpHeaderClean(&htcpReply.hdr); - if (d) - htcpFreeDetail(d); -} - -static void -htcpHandleTstRequest(htcpDataHeader * dhdr, char *buf, int sz, struct sockaddr_in *from) -{ - /* buf should be a SPECIFIER */ - htcpSpecifier *s; - StoreEntry *e; - if (sz == 0) { - debug(31, 3) ("htcpHandleTst: nothing to do\n"); - return; - } - if (dhdr->F1 == 0) - return; - s = htcpUnpackSpecifier(buf, sz); - if (NULL == s) { - debug(31, 3) ("htcpHandleTstRequest: htcpUnpackSpecifier failed\n"); - return; - } - debug(31, 3) ("htcpHandleTstRequest: %s %s %s\n", - s->method, - s->uri, - s->version); - debug(31, 3) ("htcpHandleTstRequest: %s\n", s->req_hdrs); - if ((e = htcpCheckHit(s))) - htcpTstReply(dhdr, e, s, from); /* hit */ - else - htcpTstReply(dhdr, NULL, NULL, from); /* cache miss */ - htcpFreeSpecifier(s); -} - -static void -htcpHandleMon(htcpDataHeader * hdr, char *buf, int sz, struct sockaddr_in *from) -{ - debug(31, 3) ("htcpHandleMon: Unimplemented\n"); -} - -static void -htcpHandleSet(htcpDataHeader * hdr, char *buf, int sz, struct sockaddr_in *from) -{ - debug(31, 3) ("htcpHandleSet: Unimplemented\n"); -} - -static void -htcpHandleData(char *buf, int sz, struct sockaddr_in *from) -{ - htcpDataHeader hdr; - if (sz < sizeof(htcpDataHeader)) { - debug(31, 0) ("htcpHandleData: msg size less than htcpDataHeader size\n"); - return; - } - xmemcpy(&hdr, buf, sizeof(htcpDataHeader)); - hdr.length = ntohs(hdr.length); - hdr.msg_id = ntohl(hdr.msg_id); - debug(31, 3) ("htcpHandleData: sz = %d\n", sz); - debug(31, 3) ("htcpHandleData: length = %d\n", (int) hdr.length); - if (hdr.opcode >= HTCP_END) { - debug(31, 0) ("htcpHandleData: client %s, opcode %d out of range\n", - inet_ntoa(from->sin_addr), - (int) hdr.opcode); - return; - } - debug(31, 3) ("htcpHandleData: opcode = %d %s\n", - (int) hdr.opcode, htcpOpcodeStr[hdr.opcode]); - debug(31, 3) ("htcpHandleData: response = %d\n", (int) hdr.response); - debug(31, 3) ("htcpHandleData: F1 = %d\n", (int) hdr.F1); - debug(31, 3) ("htcpHandleData: RR = %d\n", (int) hdr.RR); - debug(31, 3) ("htcpHandleData: msg_id = %d\n", (int) hdr.msg_id); - if (sz < hdr.length) { - debug(31, 0) ("htcpHandle: sz < hdr.length\n"); - return; - } - /* - * set sz = hdr.length so we ignore any AUTH fields following - * the DATA. - */ - sz = (int) hdr.length; - buf += sizeof(htcpDataHeader); - sz -= sizeof(htcpDataHeader); - debug(31, 3) ("htcpHandleData: sz = %d\n", sz); - htcpHexdump("htcpHandleData", buf, sz); - switch (hdr.opcode) { - case HTCP_NOP: - htcpHandleNop(&hdr, buf, sz, from); - break; - case HTCP_TST: - htcpHandleTst(&hdr, buf, sz, from); - break; - case HTCP_MON: - htcpHandleMon(&hdr, buf, sz, from); - break; - case HTCP_SET: - htcpHandleSet(&hdr, buf, sz, from); - break; - case HTCP_CLR: - debug(31, 1) ("htcpHandleData: client %s, CLR not supported\n", - inet_ntoa(from->sin_addr)); - break; - default: - assert(0); - break; - } -} - -static void -htcpHandle(char *buf, int sz, struct sockaddr_in *from) -{ - htcpHeader htcpHdr; - if (sz < sizeof(htcpHeader)) { - debug(31, 0) ("htcpHandle: msg size less than htcpHeader size\n"); - return; - } - htcpHexdump("htcpHandle", buf, sz); - xmemcpy(&htcpHdr, buf, sizeof(htcpHeader)); - htcpHdr.length = ntohs(htcpHdr.length); - debug(31, 3) ("htcpHandle: htcpHdr.length = %d\n", (int) htcpHdr.length); - debug(31, 3) ("htcpHandle: htcpHdr.major = %d\n", (int) htcpHdr.major); - debug(31, 3) ("htcpHandle: htcpHdr.minor = %d\n", (int) htcpHdr.minor); - if (sz != htcpHdr.length) { - debug(31, 1) ("htcpHandle: sz/%d != htcpHdr.length/%d from %s:%d\n", - sz, htcpHdr.length, - inet_ntoa(from->sin_addr), (int) ntohs(from->sin_port)); - return; - } - buf += sizeof(htcpHeader); - sz -= sizeof(htcpHeader); - htcpHandleData(buf, sz, from); -} - -static void -htcpRecv(int fd, void *data) -{ - static char buf[8192]; - int len; - static struct sockaddr_in from; - socklen_t flen = sizeof(struct sockaddr_in); - memset(&from, '\0', flen); - statCounter.syscalls.sock.recvfroms++; - len = recvfrom(fd, buf, 8192, 0, (struct sockaddr *) &from, &flen); - debug(31, 3) ("htcpRecv: FD %d, %d bytes from %s:%d\n", - fd, len, inet_ntoa(from.sin_addr), ntohs(from.sin_port)); - htcpHandle(buf, len, &from); - commSetSelect(fd, COMM_SELECT_READ, htcpRecv, NULL, 0); -} - -/* - * ====================================================================== - * PUBLIC FUNCTIONS - * ====================================================================== - */ - -void -htcpInit(void) -{ - if (Config.Port.htcp <= 0) { - debug(31, 1) ("HTCP Disabled.\n"); - return; - } - enter_suid(); - htcpInSocket = comm_open(SOCK_DGRAM, - 0, - Config.Addrs.udp_incoming, - Config.Port.htcp, - COMM_NONBLOCKING, - "HTCP Socket"); - leave_suid(); - if (htcpInSocket < 0) - fatal("Cannot open HTCP Socket"); - commSetSelect(htcpInSocket, COMM_SELECT_READ, htcpRecv, NULL, 0); - debug(31, 1) ("Accepting HTCP messages on port %d, FD %d.\n", - (int) Config.Port.htcp, htcpInSocket); - if (Config.Addrs.udp_outgoing.s_addr != no_addr.s_addr) { - enter_suid(); - htcpOutSocket = comm_open(SOCK_DGRAM, - 0, - Config.Addrs.udp_outgoing, - Config.Port.htcp, - COMM_NONBLOCKING, - "Outgoing HTCP Socket"); - leave_suid(); - if (htcpOutSocket < 0) - fatal("Cannot open Outgoing HTCP Socket"); - commSetSelect(htcpOutSocket, COMM_SELECT_READ, htcpRecv, NULL, 0); - debug(31, 1) ("Outgoing HTCP messages on port %d, FD %d.\n", - (int) Config.Port.htcp, htcpOutSocket); - fd_note(htcpInSocket, "Incoming HTCP socket"); - } else { - htcpOutSocket = htcpInSocket; - } - if (!htcpSpecifierPool) { - htcpSpecifierPool = memPoolCreate("htcpSpecifier", sizeof(htcpSpecifier)); - htcpDetailPool = memPoolCreate("htcpDetail", sizeof(htcpDetail)); - } -} - -void -htcpQuery(StoreEntry * e, request_t * req, peer * p) -{ - cache_key *save_key; - char *pkt; - off_t pktlen; - char vbuf[32]; - htcpStuff stuff; - HttpHeader hdr; - Packer pa; - MemBuf mb; - http_state_flags flags; - - if (htcpInSocket < 0) - return; - - memset(&flags, '\0', sizeof(flags)); - snprintf(vbuf, sizeof(vbuf), "%d/%d", - req->http_ver.major, req->http_ver.minor); - stuff.op = HTCP_TST; - stuff.rr = RR_REQUEST; - stuff.f1 = 1; - stuff.response = 0; - stuff.msg_id = ++msg_id_counter; - stuff.S.method = (char *) RequestMethodStr[req->method]; - stuff.S.uri = (char *) storeUrl(e); - stuff.S.version = vbuf; - httpBuildRequestHeader(req, req, e, &hdr, flags); - memBufDefInit(&mb); - packerToMemInit(&pa, &mb); - httpHeaderPackInto(&hdr, &pa); - httpHeaderClean(&hdr); - packerClean(&pa); - stuff.S.req_hdrs = mb.buf; - pkt = htcpBuildPacket(&stuff, &pktlen); - memBufClean(&mb); - if (pkt == NULL) { - debug(31, 0) ("htcpQuery: htcpBuildPacket() failed\n"); - return; - } - htcpSend(pkt, (int) pktlen, &p->in_addr); - save_key = queried_keys[stuff.msg_id % N_QUERIED_KEYS]; - storeKeyCopy(save_key, e->hash.key); - debug(31, 3) ("htcpQuery: key (%p) %s\n", save_key, storeKeyText(save_key)); - xfree(pkt); -} - -/* - * htcpSocketShutdown only closes the 'in' socket if it is - * different than the 'out' socket. - */ -void -htcpSocketShutdown(void) -{ - if (htcpInSocket < 0) - return; - if (htcpInSocket != htcpOutSocket) { - debug(12, 1) ("FD %d Closing HTCP socket\n", htcpInSocket); - comm_close(htcpInSocket); - } - /* - * Here we set 'htcpInSocket' to -1 even though the HTCP 'in' - * and 'out' sockets might be just one FD. This prevents this - * function from executing repeatedly. When we are really ready to - * exit or restart, main will comm_close the 'out' descriptor. - */ - htcpInSocket = -1; - /* - * Normally we only write to the outgoing HTCP socket, but - * we also have a read handler there to catch messages sent - * to that specific interface. During shutdown, we must - * disable reading on the outgoing socket. - */ - /* XXX Don't we need this handler to read replies while shutting down? - * I think there should be a separate hander for reading replies.. - */ - assert(htcpOutSocket > -1); - commSetSelect(htcpOutSocket, COMM_SELECT_READ, NULL, NULL, 0); -} - -void -htcpSocketClose(void) -{ - htcpSocketShutdown(); - if (htcpOutSocket > -1) { - debug(12, 1) ("FD %d Closing HTCP socket\n", htcpOutSocket); - comm_close(htcpOutSocket); - htcpOutSocket = -1; - } -} + \ No newline at end of file Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/http.c,v retrieving revision 1.17.6.26.2.2 retrieving revision 1.17.6.26.2.3 diff -u -r1.17.6.26.2.2 -r1.17.6.26.2.3 --- squid/src/http.c 3 Mar 2005 00:11:55 -0000 1.17.6.26.2.2 +++ squid/src/http.c 3 Mar 2005 03:44:04 -0000 1.17.6.26.2.3 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.17.6.26.2.2 2005/03/03 00:11:55 hno Exp $ + * $Id: http.c,v 1.17.6.26.2.3 2005/03/03 03:44:04 hno Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -528,7 +528,7 @@ /* return 1 if we got the last of the data on a persistent connection */ MemObject *mem = httpState->entry->mem_obj; HttpReply *reply = mem->reply; - off_t clen; + squid_off_t clen; debug(11, 3) ("httpPconnTransferDone: FD %d\n", httpState->fd); debug(11, 5) ("httpPconnTransferDone: content_length=%"PRINTF_OFF_T"\n", reply->content_length); Index: squid/src/net_db.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/net_db.c,v retrieving revision 1.11.22.3.2.1 retrieving revision 1.11.22.3.2.2 diff -u -r1.11.22.3.2.1 -r1.11.22.3.2.2 --- squid/src/net_db.c 25 Feb 2005 10:48:50 -0000 1.11.22.3.2.1 +++ squid/src/net_db.c 3 Mar 2005 03:44:05 -0000 1.11.22.3.2.2 @@ -1,6 +1,6 @@ /* - * $Id: net_db.c,v 1.11.22.3.2.1 2005/02/25 10:48:50 hno Exp $ + * $Id: net_db.c,v 1.11.22.3.2.2 2005/03/03 03:44:05 hno Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -42,8 +42,8 @@ StoreEntry *e; store_client *sc; request_t *r; - off_t seen; - off_t used; + squid_off_t seen; + squid_off_t used; size_t buf_sz; char *buf; } netdbExchangeState; @@ -527,11 +527,11 @@ } static void -netdbExchangeHandleReply(void *data, char *buf, off_t size) +netdbExchangeHandleReply(void *data, char *buf, squid_off_t size) { netdbExchangeState *ex = data; int rec_sz = 0; - off_t o; + squid_off_t o; struct in_addr addr; double rtt; double hops; Index: squid/src/peer_digest.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/peer_digest.c,v retrieving revision 1.10.6.1.16.1 retrieving revision 1.10.6.1.16.2 diff -u -r1.10.6.1.16.1 -r1.10.6.1.16.2 --- squid/src/peer_digest.c 25 Feb 2005 10:48:51 -0000 1.10.6.1.16.1 +++ squid/src/peer_digest.c 3 Mar 2005 03:44:05 -0000 1.10.6.1.16.2 @@ -1,6 +1,6 @@ /* - * $Id: peer_digest.c,v 1.10.6.1.16.1 2005/02/25 10:48:51 hno Exp $ + * $Id: peer_digest.c,v 1.10.6.1.16.2 2005/03/03 03:44:05 hno Exp $ * * DEBUG: section 72 Peer Digest Routines * AUTHOR: Alex Rousskov @@ -453,7 +453,7 @@ if (size >= StoreDigestCBlockSize) { PeerDigest *pd = fetch->pd; HttpReply *rep = fetch->entry->mem_obj->reply; - const off_t seen = fetch->offset + size; + const squid_off_t seen = fetch->offset + size; assert(pd && rep); if (peerDigestSetCBlock(pd, buf)) { @@ -541,7 +541,7 @@ host = strBuf(pd->host); } debug(72, 6) ("%s: peer %s, offset: %"PRINTF_OFF_T" size: %d.\n", - step_name, host, fcb_valid ? fetch->offset : (off_t)-1, size); + step_name, host, fcb_valid ? fetch->offset : (squid_off_t)-1, size); /* continue checking (with pd and host known and valid) */ if (!reason) { Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.41.6.22.2.3 retrieving revision 1.41.6.22.2.4 diff -u -r1.41.6.22.2.3 -r1.41.6.22.2.4 --- squid/src/protos.h 3 Mar 2005 01:28:48 -0000 1.41.6.22.2.3 +++ squid/src/protos.h 3 Mar 2005 03:44:05 -0000 1.41.6.22.2.4 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.41.6.22.2.3 2005/03/03 01:28:48 hno Exp $ + * $Id: protos.h,v 1.41.6.22.2.4 2005/03/03 03:44:05 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -125,7 +125,7 @@ extern int cbdataLocked(const void *p); extern void clientdbInit(void); -extern void clientdbUpdate(struct in_addr, log_type, protocol_t, off_t); +extern void clientdbUpdate(struct in_addr, log_type, protocol_t, squid_off_t); extern int clientdbCutoffDenied(struct in_addr); extern void clientdbDump(StoreEntry *); extern void clientdbFreeMemory(void); @@ -223,9 +223,9 @@ /* disk.c */ extern int file_open(const char *path, int mode); extern void file_close(int fd); -extern void file_write(int, off_t, void *, int len, DWCB *, void *, FREE *); -extern void file_write_mbuf(int fd, off_t, MemBuf mb, DWCB * handler, void *handler_data); -extern void file_read(int, char *, int, off_t, DRCB *, void *); +extern void file_write(int, squid_off_t, void *, int len, DWCB *, void *, FREE *); +extern void file_write_mbuf(int fd, squid_off_t, MemBuf mb, DWCB * handler, void *handler_data); +extern void file_read(int, char *, int, squid_off_t, DRCB *, void *); extern void disk_init(void); /* diskd.c */ @@ -235,9 +235,9 @@ extern void afile_sync(void); extern void afile_open(const char *path, int mode, DOCB *, void *); extern void afile_close(int fd, DCCB * callback, void *data); -extern void afile_write(int, off_t, void *, int len, DWCB *, void *, FREE *); -extern void afile_write_mbuf(int fd, off_t, MemBuf, DWCB *, void *); -extern void afile_read(int, char *, int, off_t, DRCB *, void *); +extern void afile_write(int, squid_off_t, void *, int len, DWCB *, void *, FREE *); +extern void afile_write_mbuf(int fd, squid_off_t, MemBuf, DWCB *, void *); +extern void afile_read(int, char *, int, squid_off_t, DRCB *, void *); extern void afile_unlink(const char *path, DUCB *, void *); extern void afile_truncate(const char *path, DTCB *, void *); @@ -371,13 +371,13 @@ /* iterate through specs */ extern HttpHdrRangeSpec *httpHdrRangeGetSpec(const HttpHdrRange * range, HttpHdrRangePos * pos); /* adjust specs after the length is known */ -extern int httpHdrRangeCanonize(HttpHdrRange *, off_t); +extern int httpHdrRangeCanonize(HttpHdrRange *, squid_off_t); /* other */ extern String httpHdrRangeBoundaryStr(clientHttpRequest * http); extern int httpHdrRangeIsComplex(const HttpHdrRange * range); extern int httpHdrRangeWillBeComplex(const HttpHdrRange * range); -extern off_t httpHdrRangeFirstOffset(const HttpHdrRange * range); -extern off_t httpHdrRangeLowestOffset(const HttpHdrRange * range, off_t); +extern squid_off_t httpHdrRangeFirstOffset(const HttpHdrRange * range); +extern squid_off_t httpHdrRangeLowestOffset(const HttpHdrRange * range, squid_off_t); extern int httpHdrRangeOffsetLimit(HttpHdrRange *); @@ -390,7 +390,7 @@ extern HttpHdrContRange *httpHdrContRangeDup(const HttpHdrContRange * crange); extern void httpHdrContRangePackInto(const HttpHdrContRange * crange, Packer * p); /* inits with given spec */ -extern void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, off_t); +extern void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, squid_off_t); /* Http Header Tools */ extern HttpHeaderFieldInfo *httpHeaderBuildFieldsInfo(const HttpHeaderFieldAttrs * attrs, int count); @@ -401,14 +401,14 @@ extern void httpHeaderMaskInit(HttpHeaderMask * mask, int value); extern void httpHeaderCalcMask(HttpHeaderMask * mask, const int *enums, int count); extern int httpHeaderHasConnDir(const HttpHeader * hdr, const char *directive); -extern void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, off_t); +extern void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, squid_off_t); extern void strListAdd(String * str, const char *item, char del); extern int strListIsMember(const String * str, const char *item, char del); extern int strListIsSubstr(const String * list, const char *s, char del); extern int strListGetItem(const String * str, char del, const char **item, int *ilen, const char **pos); extern const char *getStringPrefix(const char *str, const char *end); extern int httpHeaderParseInt(const char *start, int *val); -extern off_t httpHeaderParseSize(const char *start, off_t * sz); +extern squid_off_t httpHeaderParseSize(const char *start, squid_off_t * sz); extern int httpHeaderReset(HttpHeader * hdr); #if STDC_HEADERS extern void @@ -433,7 +433,7 @@ /* field manipulation */ extern int httpHeaderHas(const HttpHeader * hdr, http_hdr_type type); extern void httpHeaderPutInt(HttpHeader * hdr, http_hdr_type type, int number); -extern void httpHeaderPutSize(HttpHeader * hdr, http_hdr_type type, off_t number); +extern void httpHeaderPutSize(HttpHeader * hdr, http_hdr_type type, squid_off_t number); extern void httpHeaderPutTime(HttpHeader * hdr, http_hdr_type type, time_t htime); extern void httpHeaderPutStr(HttpHeader * hdr, http_hdr_type type, const char *str); extern void httpHeaderPutAuth(HttpHeader * hdr, const char *auth_scheme, const char *realm); @@ -442,7 +442,7 @@ extern void httpHeaderPutRange(HttpHeader * hdr, const HttpHdrRange * range); extern void httpHeaderPutExt(HttpHeader * hdr, const char *name, const char *value); extern int httpHeaderGetInt(const HttpHeader * hdr, http_hdr_type id); -extern off_t httpHeaderGetSize(const HttpHeader * hdr, http_hdr_type id); +extern squid_off_t httpHeaderGetSize(const HttpHeader * hdr, http_hdr_type id); extern time_t httpHeaderGetTime(const HttpHeader * hdr, http_hdr_type id); extern TimeOrTag httpHeaderGetTimeOrTag(const HttpHeader * hdr, http_hdr_type id); extern HttpHdrCc *httpHeaderGetCc(const HttpHeader * hdr); @@ -484,7 +484,7 @@ /* absorb: copy the contents of a new reply to the old one, destroy new one */ extern void httpReplyAbsorb(HttpReply * rep, HttpReply * new_rep); /* parse returns -1,0,+1 on error,need-more-data,success */ -extern int httpReplyParse(HttpReply * rep, const char *buf, off_t); +extern int httpReplyParse(HttpReply * rep, const char *buf, squid_off_t); extern void httpReplyPackInto(const HttpReply * rep, Packer * p); /* ez-routines */ /* mem-pack: returns a ready to use mem buffer with a packed reply */ @@ -493,10 +493,10 @@ extern void httpReplySwapOut(const HttpReply * rep, StoreEntry * e); /* set commonly used info with one call */ extern void httpReplySetHeaders(HttpReply * rep, http_version_t ver, http_status status, - const char *reason, const char *ctype, off_t clen, time_t lmt, time_t expires); + const char *reason, const char *ctype, squid_off_t clen, time_t lmt, time_t expires); /* do everything in one call: init, set, pack, clean, return MemBuf */ extern MemBuf httpPackedReply(http_version_t ver, http_status status, const char *ctype, - off_t clen, time_t lmt, time_t expires); + squid_off_t clen, time_t lmt, time_t expires); /* construct 304 reply and pack it into MemBuf, return MemBuf */ extern MemBuf httpPacked304Reply(const HttpReply * rep); /* update when 304 reply is received for a cached object */ @@ -507,7 +507,7 @@ extern time_t httpReplyExpires(const HttpReply * rep); extern int httpReplyHasCc(const HttpReply * rep, http_hdr_cc_type type); extern void httpRedirectReply(HttpReply *, http_status, const char *); -extern off_t httpReplyBodySize(method_t, const HttpReply *); +extern squid_off_t httpReplyBodySize(method_t, const HttpReply *); /* Http Request */ extern request_t *requestCreate(method_t, protocol_t, const char *urlpath); @@ -790,7 +790,7 @@ extern void start_announce(void *unused); -extern void sslStart(clientHttpRequest *, off_t *, int *); +extern void sslStart(clientHttpRequest *, squid_off_t *, int *); extern void waisStart(FwdState *); /* ident.c */ @@ -864,16 +864,16 @@ extern void memPoolFree(MemPool * pool, void *obj); extern int memPoolWasUsed(const MemPool * pool); extern int memPoolInUseCount(const MemPool * pool); -extern off_t memPoolInUseSize(const MemPool * pool); +extern squid_off_t memPoolInUseSize(const MemPool * pool); extern int memPoolUsedCount(const MemPool * pool); extern void memPoolReport(const MemPool * pool, StoreEntry * e); /* Mem */ extern void memReport(StoreEntry * e); -extern off_t stmemFreeDataUpto(mem_hdr *, off_t); +extern squid_off_t stmemFreeDataUpto(mem_hdr *, squid_off_t); extern void stmemAppend(mem_hdr *, const char *, int); -extern ssize_t stmemCopy(const mem_hdr *, off_t, char *, size_t); +extern ssize_t stmemCopy(const mem_hdr *, squid_off_t, char *, size_t); extern void stmemFree(mem_hdr *); extern void stmemFreeData(mem_hdr *); @@ -948,10 +948,10 @@ extern storeIOState *storeCreate(StoreEntry *, STFNCB *, STIOCB *, void *); extern storeIOState *storeOpen(StoreEntry *, STFNCB *, STIOCB *, void *); extern void storeClose(storeIOState *); -extern void storeRead(storeIOState *, char *, size_t, off_t, STRCB *, void *); -extern void storeWrite(storeIOState *, char *, size_t, off_t, FREE *); +extern void storeRead(storeIOState *, char *, size_t, squid_off_t, STRCB *, void *); +extern void storeWrite(storeIOState *, char *, size_t, squid_off_t, FREE *); extern void storeUnlink(StoreEntry *); -extern off_t storeOffset(storeIOState *); +extern squid_off_t storeOffset(storeIOState *); /* * store_log.c @@ -1009,7 +1009,7 @@ extern void storeDirInit(void); extern void storeDirOpenSwapLogs(void); extern void storeDirSwapLog(const StoreEntry *, int op); -extern void storeDirUpdateSwapSize(SwapDir *, off_t size, int sign); +extern void storeDirUpdateSwapSize(SwapDir *, squid_off_t size, int sign); extern void storeDirSync(void); extern void storeDirCallback(void); extern void storeDirLRUDelete(StoreEntry *); @@ -1051,10 +1051,10 @@ extern store_client *storeClientListSearch(const MemObject * mem, void *data); #endif extern store_client *storeClientListAdd(StoreEntry * e, void *data); -extern void storeClientCopy(store_client *, StoreEntry *, off_t, off_t, size_t, char *, STCB *, void *); +extern void storeClientCopy(store_client *, StoreEntry *, squid_off_t, squid_off_t, size_t, char *, STCB *, void *); extern int storeClientCopyPending(store_client *, StoreEntry * e, void *data); extern int storeUnregister(store_client * sc, StoreEntry * e, void *data); -extern off_t storeLowestMemReaderOffset(const StoreEntry * entry); +extern squid_off_t storeLowestMemReaderOffset(const StoreEntry * entry); extern void InvokeHandlers(StoreEntry * e); extern int storePendingNClients(const StoreEntry * e); @@ -1154,7 +1154,7 @@ extern void dlinkNodeDelete(dlink_node * m); extern dlink_node *dlinkNodeNew(void); -extern void kb_incr(kb_t *, off_t); +extern void kb_incr(kb_t *, squid_off_t); extern double gb_to_double(const gb_t *); extern const char *gb_to_str(const gb_t *); extern void gb_flush(gb_t *); /* internal, do not use this */ Index: squid/src/ssl.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ssl.c,v retrieving revision 1.13.6.7.8.1 retrieving revision 1.13.6.7.8.2 diff -u -r1.13.6.7.8.1 -r1.13.6.7.8.2 --- squid/src/ssl.c 25 Feb 2005 10:48:51 -0000 1.13.6.7.8.1 +++ squid/src/ssl.c 3 Mar 2005 03:44:06 -0000 1.13.6.7.8.2 @@ -1,6 +1,6 @@ /* - * $Id: ssl.c,v 1.13.6.7.8.1 2005/02/25 10:48:51 hno Exp $ + * $Id: ssl.c,v 1.13.6.7.8.2 2005/03/03 03:44:06 hno Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -46,7 +46,7 @@ int len; char *buf; } client, server; - off_t *size_ptr; /* pointer to size in an ConnStateData for logging */ + squid_off_t *size_ptr; /* pointer to size in an ConnStateData for logging */ int *status_ptr; /* pointer to status for logging */ #if DELAY_POOLS delay_id delay_id; @@ -467,7 +467,7 @@ CBDATA_TYPE(SslStateData); void -sslStart(clientHttpRequest * http, off_t * size_ptr, int *status_ptr) +sslStart(clientHttpRequest * http, squid_off_t * size_ptr, int *status_ptr) { /* Create state structure. */ SslStateData *sslState = NULL; Index: squid/src/stmem.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/stmem.c,v retrieving revision 1.7.66.3 retrieving revision 1.7.66.4 diff -u -r1.7.66.3 -r1.7.66.4 --- squid/src/stmem.c 3 Mar 2005 01:28:49 -0000 1.7.66.3 +++ squid/src/stmem.c 3 Mar 2005 03:44:06 -0000 1.7.66.4 @@ -1,6 +1,6 @@ /* - * $Id: stmem.c,v 1.7.66.3 2005/03/03 01:28:49 hno Exp $ + * $Id: stmem.c,v 1.7.66.4 2005/03/03 03:44:06 hno Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Harvest Derived @@ -51,10 +51,10 @@ mem->origin_offset = 0; } -off_t -stmemFreeDataUpto(mem_hdr * mem, off_t target_offset) +squid_off_t +stmemFreeDataUpto(mem_hdr * mem, squid_off_t target_offset) { - off_t current_offset = mem->origin_offset; + squid_off_t current_offset = mem->origin_offset; mem_node *lastp; mem_node *p = mem->head; while (p && ((current_offset + p->len) <= target_offset)) { @@ -125,10 +125,10 @@ } ssize_t -stmemCopy(const mem_hdr * mem, off_t offset, char *buf, size_t size) +stmemCopy(const mem_hdr * mem, squid_off_t offset, char *buf, size_t size) { mem_node *p = mem->head; - off_t t_off = mem->origin_offset; + squid_off_t t_off = mem->origin_offset; size_t bytes_to_go = size; char *ptr_to_buf = NULL; int bytes_from_this_packet = 0; Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.16.6.7.6.2 retrieving revision 1.16.6.7.6.3 diff -u -r1.16.6.7.6.2 -r1.16.6.7.6.3 --- squid/src/store.c 3 Mar 2005 01:07:22 -0000 1.16.6.7.6.2 +++ squid/src/store.c 3 Mar 2005 03:44:06 -0000 1.16.6.7.6.3 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.16.6.7.6.2 2005/03/03 01:07:22 hno Exp $ + * $Id: store.c,v 1.16.6.7.6.3 2005/03/03 03:44:06 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -939,8 +939,8 @@ static int storeEntryValidLength(const StoreEntry * e) { - off_t diff; - off_t clen; + squid_off_t diff; + squid_off_t clen; const HttpReply *reply; assert(e->mem_obj != NULL); reply = e->mem_obj->reply; @@ -1240,7 +1240,7 @@ storeSwapOut(e); } -int +squid_off_t objectLen(const StoreEntry * e) { assert(e->mem_obj != NULL); Index: squid/src/store_client.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_client.c,v retrieving revision 1.9.6.2.16.1 retrieving revision 1.9.6.2.16.2 diff -u -r1.9.6.2.16.1 -r1.9.6.2.16.2 --- squid/src/store_client.c 25 Feb 2005 10:48:51 -0000 1.9.6.2.16.1 +++ squid/src/store_client.c 3 Mar 2005 03:44:06 -0000 1.9.6.2.16.2 @@ -1,6 +1,6 @@ /* - * $Id: store_client.c,v 1.9.6.2.16.1 2005/02/25 10:48:51 hno Exp $ + * $Id: store_client.c,v 1.9.6.2.16.2 2005/03/03 03:44:06 hno Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -153,7 +153,7 @@ } static void -storeClientCallback(store_client * sc, off_t sz) +storeClientCallback(store_client * sc, squid_off_t sz) { STCB *callback = sc->callback; char *buf = sc->copy_buf; @@ -179,8 +179,8 @@ void storeClientCopy(store_client * sc, StoreEntry * e, - off_t seen_offset, - off_t copy_offset, + squid_off_t seen_offset, + squid_off_t copy_offset, size_t size, char *buf, STCB * callback, @@ -220,7 +220,7 @@ static int storeClientNoMoreToSend(StoreEntry * e, store_client * sc) { - off_t len; + squid_off_t len; if (e->store_status == STORE_PENDING) return 0; if ((len = objectLen(e)) < 0) @@ -539,11 +539,11 @@ return 1; } -off_t +squid_off_t storeLowestMemReaderOffset(const StoreEntry * entry) { const MemObject *mem = entry->mem_obj; - off_t lowest = mem->inmem_hi + 1; + squid_off_t lowest = mem->inmem_hi + 1; store_client *sc; dlink_node *nx = NULL; dlink_node *node; Index: squid/src/store_dir.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_dir.c,v retrieving revision 1.19.6.2.16.1 retrieving revision 1.19.6.2.16.2 diff -u -r1.19.6.2.16.1 -r1.19.6.2.16.2 --- squid/src/store_dir.c 25 Feb 2005 10:48:51 -0000 1.19.6.2.16.1 +++ squid/src/store_dir.c 3 Mar 2005 03:44:07 -0000 1.19.6.2.16.2 @@ -1,6 +1,6 @@ /* - * $Id: store_dir.c,v 1.19.6.2.16.1 2005/02/25 10:48:51 hno Exp $ + * $Id: store_dir.c,v 1.19.6.2.16.2 2005/03/03 03:44:07 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -45,7 +45,7 @@ #include #endif -static int storeDirValidSwapDirSize(int, off_t); +static int storeDirValidSwapDirSize(int, squid_off_t); static STDIRSELECT storeDirSelectSwapDirRoundRobin; static STDIRSELECT storeDirSelectSwapDirLeastLoad; @@ -106,7 +106,7 @@ * ie any-sized-object swapdirs. This is a good thing. */ static int -storeDirValidSwapDirSize(int swapdir, off_t objsize) +storeDirValidSwapDirSize(int swapdir, squid_off_t objsize) { /* * If the swapdir's max_obj_size is -1, then it definitely can @@ -144,7 +144,7 @@ int i; int load; SwapDir *sd; - off_t objsize = (off_t) objectLen(e); + squid_off_t objsize = objectLen(e); for (i = 0; i <= Config.cacheSwap.n_configured; i++) { if (++dirn >= Config.cacheSwap.n_configured) dirn = 0; @@ -181,9 +181,9 @@ static int storeDirSelectSwapDirLeastLoad(const StoreEntry * e) { - off_t objsize; - off_t most_free = 0, cur_free; - off_t least_objsize = -1; + squid_off_t objsize; + squid_off_t most_free = 0, cur_free; + squid_off_t least_objsize = -1; int least_load = INT_MAX; int load; int dirn = -1; @@ -191,7 +191,7 @@ SwapDir *SD; /* Calculate the object size */ - objsize = (off_t) objectLen(e); + objsize = (squid_off_t) objectLen(e); if (objsize != -1) objsize += e->mem_obj->swap_hdr_sz; for (i = 0; i < Config.cacheSwap.n_configured; i++) { @@ -270,7 +270,7 @@ } void -storeDirUpdateSwapSize(SwapDir * SD, off_t size, int sign) +storeDirUpdateSwapSize(SwapDir * SD, squid_off_t size, int sign) { int blks = (size + SD->fs.blksize - 1) / SD->fs.blksize; int k = (blks * SD->fs.blksize >> 10) * sign; Index: squid/src/store_io.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_io.c,v retrieving revision 1.3 retrieving revision 1.3.74.1 diff -u -r1.3 -r1.3.74.1 --- squid/src/store_io.c 24 Oct 2001 09:42:14 -0000 1.3 +++ squid/src/store_io.c 3 Mar 2005 03:44:07 -0000 1.3.74.1 @@ -76,14 +76,14 @@ } void -storeRead(storeIOState * sio, char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +storeRead(storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { SwapDir *SD = &Config.cacheSwap.swapDirs[sio->swap_dirn]; SD->obj.read(SD, sio, buf, size, offset, callback, callback_data); } void -storeWrite(storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func) +storeWrite(storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { SwapDir *SD = &Config.cacheSwap.swapDirs[sio->swap_dirn]; SD->obj.write(SD, sio, buf, size, offset, free_func); @@ -96,7 +96,7 @@ SD->obj.unlink(SD, e); } -off_t +squid_off_t storeOffset(storeIOState * sio) { return sio->offset; Index: squid/src/store_swapmeta.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_swapmeta.c,v retrieving revision 1.8 retrieving revision 1.8.74.1 diff -u -r1.8 -r1.8.74.1 --- squid/src/store_swapmeta.c 24 Oct 2001 09:42:14 -0000 1.8 +++ squid/src/store_swapmeta.c 3 Mar 2005 03:44:07 -0000 1.8.74.1 @@ -1,6 +1,6 @@ /* - * $Id: store_swapmeta.c,v 1.8 2001/10/24 09:42:14 squidadm Exp $ + * $Id: store_swapmeta.c,v 1.8.74.1 2005/03/03 03:44:07 hno Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -86,7 +86,7 @@ { int buflen = 0; tlv *t; - off_t j = 0; + squid_off_t j = 0; char *buf; assert(length != NULL); buflen++; /* STORE_META_OK */ @@ -119,7 +119,7 @@ char type; int length; int buflen; - off_t j = 0; + squid_off_t j = 0; assert(buf != NULL); assert(hdr_len != NULL); if (buf[j++] != (char) STORE_META_OK) Index: squid/src/store_swapout.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_swapout.c,v retrieving revision 1.11.2.1.30.1 retrieving revision 1.11.2.1.30.2 diff -u -r1.11.2.1.30.1 -r1.11.2.1.30.2 --- squid/src/store_swapout.c 25 Feb 2005 10:48:52 -0000 1.11.2.1.30.1 +++ squid/src/store_swapout.c 3 Mar 2005 03:44:07 -0000 1.11.2.1.30.2 @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.c,v 1.11.2.1.30.1 2005/02/25 10:48:52 hno Exp $ + * $Id: store_swapout.c,v 1.11.2.1.30.2 2005/03/03 03:44:07 hno Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -35,7 +35,7 @@ #include "squid.h" -static off_t storeSwapOutObjectBytesOnDisk(const MemObject *); +static squid_off_t storeSwapOutObjectBytesOnDisk(const MemObject *); static void storeSwapOutStart(StoreEntry * e); static STIOCB storeSwapOutFileClosed; static STIOCB storeSwapOutFileNotify; @@ -99,11 +99,11 @@ storeSwapOut(StoreEntry * e) { MemObject *mem = e->mem_obj; - off_t lowest_offset; - off_t new_mem_lo; - off_t on_disk = 0; - off_t swapout_size; - off_t swap_buf_len; + squid_off_t lowest_offset; + squid_off_t new_mem_lo; + squid_off_t on_disk = 0; + squid_off_t swapout_size; + squid_off_t swap_buf_len; if (mem == NULL) return; /* should we swap something out to disk? */ @@ -136,7 +136,7 @@ * Grab the swapout_size and check to see whether we're going to defer * the swapout based upon size */ - swapout_size = (off_t) (mem->inmem_hi - mem->swapout.queue_offset); + swapout_size = (squid_off_t) (mem->inmem_hi - mem->swapout.queue_offset); if ((e->store_status != STORE_OK) && (swapout_size < store_maxobjsize)) { /* * NOTE: the store_maxobjsize here is the max of optional @@ -187,7 +187,7 @@ mem->inmem_lo = new_mem_lo; #if SIZEOF_OFF_T == 4 if (mem->inmem_hi > 0x7FFF0000) { - debug(20, 0) ("WARNING: preventing off_t overflow for %s\n", storeUrl(e)); + debug(20, 0) ("WARNING: preventing squid_off_t overflow for %s\n", storeUrl(e)); storeAbort(e); return; } @@ -260,7 +260,7 @@ /* the storeWrite() call might generate an error */ if (e->swap_status != SWAPOUT_WRITING) break; - swapout_size = (off_t) (mem->inmem_hi - mem->swapout.queue_offset); + swapout_size = (squid_off_t) (mem->inmem_hi - mem->swapout.queue_offset); if (e->store_status == STORE_PENDING) if (swapout_size < SM_PAGE_SIZE) break; @@ -335,7 +335,7 @@ /* * How much of the object data is on the disk? */ -static off_t +static squid_off_t storeSwapOutObjectBytesOnDisk(const MemObject * mem) { /* @@ -349,7 +349,7 @@ * meaning we haven't even opened the swapout file * yet. */ - off_t nwritten; + squid_off_t nwritten; if (mem->swapout.sio == NULL) return 0; nwritten = storeOffset(mem->swapout.sio); Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.48.2.33.2.4 retrieving revision 1.48.2.33.2.5 diff -u -r1.48.2.33.2.4 -r1.48.2.33.2.5 --- squid/src/structs.h 3 Mar 2005 01:28:49 -0000 1.48.2.33.2.4 +++ squid/src/structs.h 3 Mar 2005 03:44:07 -0000 1.48.2.33.2.5 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.48.2.33.2.4 2005/03/03 01:28:49 hno Exp $ + * $Id: structs.h,v 1.48.2.33.2.5 2005/03/03 03:44:07 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -228,7 +228,7 @@ struct _body_size { dlink_node node; acl_access *access_list; - off_t maxsize; + squid_off_t maxsize; }; struct _http_version_t { @@ -385,20 +385,20 @@ struct _SquidConfig { struct { - off_t maxSize; + squid_off_t maxSize; int highWaterMark; int lowWaterMark; } Swap; - off_t memMaxSize; + squid_off_t memMaxSize; struct { char *relayHost; u_short relayPort; peer *peer; } Wais; struct { - off_t min; + squid_off_t min; int pct; - off_t max; + squid_off_t max; } quickAbort; RemovalPolicySettings *replPolicy; RemovalPolicySettings *memPolicy; @@ -428,9 +428,9 @@ time_t idns_query; #endif } Timeout; - off_t maxRequestHeaderSize; - off_t maxRequestBodySize; - off_t maxReplyHeaderSize; + squid_off_t maxRequestHeaderSize; + squid_off_t maxRequestBodySize; + squid_off_t maxReplyHeaderSize; dlink_list ReplyBodySize; struct { u_short icp; @@ -531,8 +531,8 @@ #endif struct in_addr client_netmask; } Addrs; - off_t tcpRcvBufsz; - off_t udpMaxHitObjsz; + squid_off_t tcpRcvBufsz; + squid_off_t udpMaxHitObjsz; wordlist *hierarchy_stoplist; wordlist *mcast_group_list; wordlist *dns_testname_list; @@ -552,10 +552,10 @@ cachemgr_passwd *passwd_list; struct { int objectsPerBucket; - off_t avgObjectSize; - off_t maxObjectSize; - off_t minObjectSize; - off_t maxInMemObjSize; + squid_off_t avgObjectSize; + squid_off_t maxObjectSize; + squid_off_t minObjectSize; + squid_off_t maxInMemObjSize; } Store; struct { int high; @@ -660,7 +660,7 @@ int onerror; } retry; struct { - off_t limit; + squid_off_t limit; } MemPools; #if DELAY_POOLS delayConfig Delay; @@ -675,7 +675,7 @@ } comm_incoming; int max_open_disk_fds; int uri_whitespace; - off_t rangeOffsetLimit; + squid_off_t rangeOffsetLimit; #if MULTICAST_MISS_STREAM struct { struct in_addr addr; @@ -692,7 +692,7 @@ int bits_per_entry; time_t rebuild_period; time_t rewrite_period; - off_t swapout_chunk_size; + squid_off_t swapout_chunk_size; int rebuild_chunk_percentage; } digest; #endif @@ -705,7 +705,7 @@ struct { int high_rptm; int high_pf; - off_t high_memory; + squid_off_t high_memory; } warnings; char *store_dir_select_algorithm; int sleep_after_fork; /* microseconds */ @@ -732,7 +732,7 @@ struct _dread_ctrl { int fd; - off_t offset; + squid_off_t offset; int req_len; char *buf; int end_of_file; @@ -745,7 +745,7 @@ int inpipe; int outpipe; time_t answer; - off_t offset; + squid_off_t offset; size_t size; char ip_inbuf[DNS_INBUF_SZ]; struct timeval dispatch_time; @@ -753,10 +753,10 @@ }; struct _dwrite_q { - off_t file_offset; + squid_off_t file_offset; char *buf; int len; - off_t buf_offset; + squid_off_t buf_offset; dwrite_q *next; FREE *free_func; }; @@ -793,15 +793,15 @@ unsigned int close_on_exec:1; unsigned int read_pending:1; } flags; - off_t bytes_read; - off_t bytes_written; + squid_off_t bytes_read; + squid_off_t bytes_written; int uses; /* ie # req's over persistent conn */ struct _fde_disk { DWCB *wrt_handle; void *wrt_handle_data; dwrite_q *write_q; dwrite_q *write_q_tail; - off_t offset; + squid_off_t offset; } disk; PF *read_handler; void *read_data; @@ -885,8 +885,8 @@ /* http byte-range-spec */ struct _HttpHdrRangeSpec { - off_t offset; - off_t length; + squid_off_t offset; + squid_off_t length; }; /* There may be more than one byte range specified in the request. @@ -900,7 +900,7 @@ /* http content-range header field */ struct _HttpHdrContRange { HttpHdrRangeSpec spec; - off_t elength; /* entity length, not content length */ + squid_off_t elength; /* entity length, not content length */ }; /* some fields can hold either time or etag specs (e.g. If-Range) */ @@ -914,8 +914,8 @@ struct _HttpHdrRangeIter { HttpHdrRangePos pos; const HttpHdrRangeSpec *spec; /* current spec at pos */ - off_t debt_size; /* bytes left to send from the current spec */ - off_t prefix_size; /* the size of the incoming HTTP msg prefix */ + squid_off_t debt_size; /* bytes left to send from the current spec */ + squid_off_t prefix_size; /* the size of the incoming HTTP msg prefix */ String boundary; /* boundary for multipart responses */ }; @@ -962,7 +962,7 @@ int hdr_sz; /* sums _stored_ status-line, headers, and */ /* public, readable; never update these or their .hdr equivalents directly */ - off_t content_length; + squid_off_t content_length; time_t date; time_t last_modified; time_t expires; @@ -1053,7 +1053,7 @@ } icp; struct { struct in_addr caddr; - off_t size; + squid_off_t size; log_type code; int msec; const char *rfc931; @@ -1077,11 +1077,11 @@ char *uri; char *log_uri; struct { - off_t offset; - off_t size; + squid_off_t offset; + squid_off_t size; } out; HttpHdrRangeIter range_iter; /* data for iterating thru range specs */ - off_t req_sz; /* raw request size on input, not current request size */ + squid_off_t req_sz; /* raw request size on input, not current request size */ StoreEntry *entry; StoreEntry *old_entry; log_type log_type; @@ -1105,18 +1105,18 @@ char *location; } redirect; dlink_node active; - off_t maxBodySize; + squid_off_t maxBodySize; }; struct _ConnStateData { int fd; struct { char *buf; - off_t offset; + squid_off_t offset; size_t size; } in; struct { - off_t size_left; /* How much body left to process */ + squid_off_t size_left; /* How much body left to process */ request_t *request; /* Parameters passed to clientReadBody */ char *buf; size_t bufsize; @@ -1186,8 +1186,8 @@ store_client *sc; store_client *old_sc; request_t *request; - off_t offset; - off_t mask_offset; + squid_off_t offset; + squid_off_t mask_offset; time_t start_time; time_t resp_time; time_t expires; @@ -1436,14 +1436,14 @@ struct _mem_hdr { mem_node *head; mem_node *tail; - off_t origin_offset; + squid_off_t origin_offset; }; /* keep track each client receiving data from that particular StoreEntry */ struct _store_client { int type; - off_t copy_offset; - off_t seen_offset; + squid_off_t copy_offset; + squid_off_t seen_offset; size_t copy_size; char *copy_buf; STCB *callback; @@ -1501,12 +1501,12 @@ method_t method; char *url; mem_hdr data_hdr; - off_t inmem_hi; - off_t inmem_lo; + squid_off_t inmem_hi; + squid_off_t inmem_lo; dlink_list clients; int nclients; struct { - off_t queue_offset; /* relative to in-mem data */ + squid_off_t queue_offset; /* relative to in-mem data */ mem_node *memnode; /* which node we're currently paging out */ storeIOState *sio; } swapout; @@ -1522,7 +1522,7 @@ char *log_url; RemovalPolicyNode repl; int id; - off_t object_sz; + squid_off_t object_sz; size_t swap_hdr_sz; #if URL_CHECKSUM_DEBUG unsigned int chksum; @@ -1539,7 +1539,7 @@ time_t lastref; time_t expires; time_t lastmod; - off_t swap_file_sz; + squid_off_t swap_file_sz; u_short refcount; u_short flags; /* END OF ON-DISK STORE_META_STD */ @@ -1559,7 +1559,7 @@ int max_size; char *path; int index; /* This entry's index into the swapDirs array */ - off_t max_objsize; + squid_off_t max_objsize; RemovalPolicy *repl; int removals; int scanned; @@ -1639,8 +1639,8 @@ sfileno swap_filen; StoreEntry *e; /* Need this so the FS layers can play god */ mode_t mode; - off_t st_size; /* do stat(2) after read open */ - off_t offset; /* current on-disk offset pointer */ + squid_off_t st_size; /* do stat(2) after read open */ + squid_off_t offset; /* current on-disk offset pointer */ STFNCB *file_callback; /* called on delayed sfileno assignments */ STIOCB *callback; void *callback_data; @@ -1676,7 +1676,7 @@ struct in_addr my_addr; unsigned short my_port; HttpHeader header; - off_t content_length; + squid_off_t content_length; HierarchyLogEntry hier; err_type err_type; char *peer_login; /* Configured peer login:password */ @@ -1713,7 +1713,7 @@ struct _CommWriteStateData { char *buf; size_t size; - off_t offset; + squid_off_t offset; CWCB *handler; void *handler_data; FREE *free_func; @@ -1910,7 +1910,7 @@ time_t lastref; time_t expires; time_t lastmod; - off_t swap_file_sz; + squid_off_t swap_file_sz; u_short refcount; u_short flags; unsigned char key[MD5_DIGEST_CHARS]; @@ -1918,8 +1918,8 @@ /* object to track per-action memory usage (e.g. #idle objects) */ struct _MemMeter { - off_t level; /* current level (count or volume) */ - off_t hwater_level; /* high water mark */ + squid_off_t level; /* current level (count or volume) */ + squid_off_t hwater_level; /* high water mark */ time_t hwater_stamp; /* timestamp of last high water mark change */ }; @@ -2074,7 +2074,7 @@ int wfd; char *buf; size_t buf_sz; - off_t offset; + squid_off_t offset; struct timeval dispatch_time; struct timeval answer_time; dlink_node link; @@ -2098,7 +2098,7 @@ int wfd; char *buf; size_t buf_sz; - off_t offset; + squid_off_t offset; struct timeval dispatch_time; struct timeval answer_time; dlink_node link; Index: squid/src/tools.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/tools.c,v retrieving revision 1.19.6.10.2.1 retrieving revision 1.19.6.10.2.2 diff -u -r1.19.6.10.2.1 -r1.19.6.10.2.2 --- squid/src/tools.c 25 Feb 2005 10:48:52 -0000 1.19.6.10.2.1 +++ squid/src/tools.c 3 Mar 2005 03:44:08 -0000 1.19.6.10.2.2 @@ -1,6 +1,6 @@ /* - * $Id: tools.c,v 1.19.6.10.2.1 2005/02/25 10:48:52 hno Exp $ + * $Id: tools.c,v 1.19.6.10.2.2 2005/03/03 03:44:08 hno Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -839,7 +839,7 @@ } void -kb_incr(kb_t * k, off_t v) +kb_incr(kb_t * k, squid_off_t v) { k->bytes += v; k->kb += (k->bytes >> 10); Index: squid/src/typedefs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/typedefs.h,v retrieving revision 1.25.6.6.8.2 retrieving revision 1.25.6.6.8.3 diff -u -r1.25.6.6.8.2 -r1.25.6.6.8.3 --- squid/src/typedefs.h 3 Mar 2005 00:11:57 -0000 1.25.6.6.8.2 +++ squid/src/typedefs.h 3 Mar 2005 03:44:08 -0000 1.25.6.6.8.3 @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.25.6.6.8.2 2005/03/03 00:11:57 hno Exp $ + * $Id: typedefs.h,v 1.25.6.6.8.3 2005/03/03 03:44:08 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -41,9 +41,15 @@ typedef signed int sfileno; typedef signed int sdirno; +#if SIZEOF_LONG_LONG > SIZEOF_LONG +typedef long long squid_off_t; +#else +typedef long squid_off_t; +#endif + typedef struct { - off_t bytes; - off_t kb; + squid_off_t bytes; + squid_off_t kb; } kb_t; typedef struct { @@ -275,8 +281,8 @@ typedef storeIOState *STOBJCREATE(SwapDir *, StoreEntry *, STFNCB *, STIOCB *, void *); typedef storeIOState *STOBJOPEN(SwapDir *, StoreEntry *, STFNCB *, STIOCB *, void *); typedef void STOBJCLOSE(SwapDir *, storeIOState *); -typedef void STOBJREAD(SwapDir *, storeIOState *, char *, size_t, off_t, STRCB *, void *); -typedef void STOBJWRITE(SwapDir *, storeIOState *, char *, size_t, off_t, FREE *); +typedef void STOBJREAD(SwapDir *, storeIOState *, char *, size_t, squid_off_t, STRCB *, void *); +typedef void STOBJWRITE(SwapDir *, storeIOState *, char *, size_t, squid_off_t, FREE *); typedef void STOBJUNLINK(SwapDir *, StoreEntry *); typedef void STLOGOPEN(SwapDir *); Index: squid/src/fs/aufs/aiops.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/aiops.c,v retrieving revision 1.11.6.7 retrieving revision 1.11.6.7.16.1 diff -u -r1.11.6.7 -r1.11.6.7.16.1 --- squid/src/fs/aufs/aiops.c 7 Aug 2003 02:13:45 -0000 1.11.6.7 +++ squid/src/fs/aufs/aiops.c 3 Mar 2005 03:44:09 -0000 1.11.6.7.16.1 @@ -94,7 +94,7 @@ char *bufferp; char *tmpbufp; int buflen; - off_t offset; + squid_off_t offset; int whence; int ret; int err; @@ -632,7 +632,7 @@ int -squidaio_read(int fd, char *bufp, int bufs, off_t offset, int whence, squidaio_result_t * resultp) +squidaio_read(int fd, char *bufp, int bufs, squid_off_t offset, int whence, squidaio_result_t * resultp) { squidaio_request_t *requestp; @@ -663,7 +663,7 @@ int -squidaio_write(int fd, char *bufp, int bufs, off_t offset, int whence, squidaio_result_t * resultp) +squidaio_write(int fd, char *bufp, int bufs, squid_off_t offset, int whence, squidaio_result_t * resultp) { squidaio_request_t *requestp; @@ -773,7 +773,7 @@ } int -squidaio_truncate(const char *path, off_t length, squidaio_result_t * resultp) +squidaio_truncate(const char *path, squid_off_t length, squidaio_result_t * resultp) { squidaio_request_t *requestp; Index: squid/src/fs/aufs/async_io.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/async_io.c,v retrieving revision 1.7.6.4 retrieving revision 1.7.6.4.22.1 diff -u -r1.7.6.4 -r1.7.6.4.22.1 --- squid/src/fs/aufs/async_io.c 4 Jan 2003 03:15:06 -0000 1.7.6.4 +++ squid/src/fs/aufs/async_io.c 3 Mar 2005 03:44:09 -0000 1.7.6.4.22.1 @@ -277,7 +277,7 @@ } /* aioUnlink */ void -aioTruncate(const char *path, off_t length, AIOCB * callback, void *callback_data) +aioTruncate(const char *path, squid_off_t length, AIOCB * callback, void *callback_data) { squidaio_ctrl_t *ctrlp; assert(initialised); Index: squid/src/fs/aufs/store_asyncufs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/store_asyncufs.h,v retrieving revision 1.6.14.2 retrieving revision 1.6.14.2.16.1 diff -u -r1.6.14.2 -r1.6.14.2.16.1 --- squid/src/fs/aufs/store_asyncufs.h 7 Aug 2003 02:13:45 -0000 1.6.14.2 +++ squid/src/fs/aufs/store_asyncufs.h 3 Mar 2005 03:44:10 -0000 1.6.14.2.16.1 @@ -43,12 +43,12 @@ int squidaio_cancel(squidaio_result_t *); int squidaio_open(const char *, int, mode_t, squidaio_result_t *); -int squidaio_read(int, char *, int, off_t, int, squidaio_result_t *); -int squidaio_write(int, char *, int, off_t, int, squidaio_result_t *); +int squidaio_read(int, char *, int, squid_off_t, int, squidaio_result_t *); +int squidaio_write(int, char *, int, squid_off_t, int, squidaio_result_t *); int squidaio_close(int, squidaio_result_t *); int squidaio_stat(const char *, struct stat *, squidaio_result_t *); int squidaio_unlink(const char *, squidaio_result_t *); -int squidaio_truncate(const char *, off_t length, squidaio_result_t *); +int squidaio_truncate(const char *, squid_off_t length, squidaio_result_t *); int squidaio_opendir(const char *, squidaio_result_t *); squidaio_result_t *squidaio_poll_done(void); int squidaio_operations_pending(void); @@ -66,7 +66,7 @@ void aioRead(int, int offset, int size, AIOCB *, void *); void aioStat(char *, struct stat *, AIOCB *, void *); void aioUnlink(const char *, AIOCB *, void *); -void aioTruncate(const char *, off_t length, AIOCB *, void *); +void aioTruncate(const char *, squid_off_t length, AIOCB *, void *); int aioCheckCallbacks(SwapDir *); void aioSync(SwapDir *); int aioQueueSize(void); @@ -98,14 +98,14 @@ struct _queued_write { char *buf; size_t size; - off_t offset; + squid_off_t offset; FREE *free_func; }; struct _queued_read { char *buf; size_t size; - off_t offset; + squid_off_t offset; STRCB *callback; void *callback_data; }; Index: squid/src/fs/aufs/store_dir_aufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/store_dir_aufs.c,v retrieving revision 1.23.6.9 retrieving revision 1.23.6.9.8.1 diff -u -r1.23.6.9 -r1.23.6.9.8.1 --- squid/src/fs/aufs/store_dir_aufs.c 26 Aug 2004 02:13:44 -0000 1.23.6.9 +++ squid/src/fs/aufs/store_dir_aufs.c 3 Mar 2005 03:44:10 -0000 1.23.6.9.8.1 @@ -944,7 +944,7 @@ char *new; char *cln; char *outbuf; - off_t outbuf_offset; + squid_off_t outbuf_offset; int fd; RemovalPolicyWalker *walker; }; Index: squid/src/fs/aufs/store_io_aufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/store_io_aufs.c,v retrieving revision 1.13.2.11.8.1 retrieving revision 1.13.2.11.8.2 diff -u -r1.13.2.11.8.1 -r1.13.2.11.8.2 --- squid/src/fs/aufs/store_io_aufs.c 25 Feb 2005 10:48:53 -0000 1.13.2.11.8.1 +++ squid/src/fs/aufs/store_io_aufs.c 3 Mar 2005 03:44:11 -0000 1.13.2.11.8.2 @@ -153,7 +153,7 @@ /* Read */ void -storeAufsRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +storeAufsRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; assert(sio->read.callback == NULL); @@ -194,7 +194,7 @@ /* Write */ void -storeAufsWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func) +storeAufsWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; debug(79, 3) ("storeAufsWrite: dirno %d, fileno %08X, FD %d\n", @@ -320,7 +320,7 @@ squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; STRCB *callback = sio->read.callback; void *their_data = sio->read.callback_data; - off_t rlen; + squid_off_t rlen; int inreaddone = aiostate->flags.inreaddone; /* Protect from callback loops */ debug(79, 3) ("storeAufsReadDone: dirno %d, fileno %08X, FD %d, len %d\n", sio->swap_dirn, sio->swap_filen, fd, len); @@ -330,7 +330,7 @@ debug(79, 3) ("storeAufsReadDone: got failure (%d)\n", errflag); rlen = -1; } else { - rlen = (off_t) len; + rlen = (squid_off_t) len; sio->offset += len; } #if ASYNC_READ Index: squid/src/fs/coss/async_io.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/coss/async_io.c,v retrieving revision 1.3.28.3 retrieving revision 1.3.28.3.16.1 diff -u -r1.3.28.3 -r1.3.28.3.16.1 --- squid/src/fs/coss/async_io.c 30 Jul 2003 02:13:44 -0000 1.3.28.3 +++ squid/src/fs/coss/async_io.c 3 Mar 2005 03:44:27 -0000 1.3.28.3.16.1 @@ -54,7 +54,7 @@ /* Exported routines */ void -a_file_read(async_queue_t * q, int fd, void *buf, int req_len, off_t offset, +a_file_read(async_queue_t * q, int fd, void *buf, int req_len, squid_off_t offset, DRCB * callback, void *data) { int slot; @@ -102,7 +102,7 @@ void -a_file_write(async_queue_t * q, int fd, off_t offset, void *buf, int len, +a_file_write(async_queue_t * q, int fd, squid_off_t offset, void *buf, int len, DWCB * callback, void *data, FREE * freefunc) { int slot; Index: squid/src/fs/coss/async_io.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/coss/async_io.h,v retrieving revision 1.2 retrieving revision 1.2.110.1 diff -u -r1.2 -r1.2.110.1 --- squid/src/fs/coss/async_io.h 16 Aug 2001 07:39:04 -0000 1.2 +++ squid/src/fs/coss/async_io.h 3 Mar 2005 03:44:27 -0000 1.2.110.1 @@ -48,8 +48,8 @@ /* Functions */ extern void a_file_read(async_queue_t * q, int fd, void *buf, int req_len, - off_t offset, DRCB * callback, void *data); -extern void a_file_write(async_queue_t * q, int fd, off_t offset, void *buf, + squid_off_t offset, DRCB * callback, void *data); +extern void a_file_write(async_queue_t * q, int fd, squid_off_t offset, void *buf, int len, DWCB * callback, void *data, FREE * freefunc); extern int a_file_callback(async_queue_t * q); extern void a_file_setupqueue(async_queue_t * q); Index: squid/src/fs/coss/store_dir_coss.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/coss/store_dir_coss.c,v retrieving revision 1.17.6.9 retrieving revision 1.17.6.9.16.1 diff -u -r1.17.6.9 -r1.17.6.9.16.1 --- squid/src/fs/coss/store_dir_coss.c 5 Aug 2003 02:14:39 -0000 1.17.6.9 +++ squid/src/fs/coss/store_dir_coss.c 3 Mar 2005 03:44:27 -0000 1.17.6.9.16.1 @@ -485,7 +485,7 @@ char *new; char *cln; char *outbuf; - off_t outbuf_offset; + squid_off_t outbuf_offset; int fd; dlink_node *current; }; @@ -762,7 +762,7 @@ unsigned int i; unsigned int size; CossInfo *cs; - off_t max_offset; + squid_off_t max_offset; i = GetInteger(); size = i << 10; /* Mbytes to Kbytes */ @@ -831,7 +831,7 @@ * largest possible sfileno, assuming sfileno is a 25-bit * signed integer, as defined in structs.h. */ - max_offset = (off_t) 0xFFFFFF << cs->blksz_bits; + max_offset = (squid_off_t) 0xFFFFFF << cs->blksz_bits; if (sd->max_size > (unsigned long) (max_offset >> 10)) { debug(47, 0) ("COSS block-size = %d bytes\n", 1 << cs->blksz_bits); debug(47, 0) ("COSS largest file offset = %lu KB\n", (unsigned long) max_offset >> 10); Index: squid/src/fs/coss/store_io_coss.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/coss/store_io_coss.c,v retrieving revision 1.9.6.6 retrieving revision 1.9.6.6.16.1 diff -u -r1.9.6.6 -r1.9.6.6.16.1 --- squid/src/fs/coss/store_io_coss.c 30 Jul 2003 02:13:44 -0000 1.9.6.6 +++ squid/src/fs/coss/store_io_coss.c 3 Mar 2005 03:44:27 -0000 1.9.6.6.16.1 @@ -49,8 +49,8 @@ static CossMemBuf *storeCossCreateMemBuf(SwapDir * SD, size_t start, sfileno curfn, int *collision); static CBDUNL storeCossIOFreeEntry; -static off_t storeCossFilenoToDiskOffset(sfileno f, CossInfo *); -static sfileno storeCossDiskOffsetToFileno(off_t o, CossInfo *); +static squid_off_t storeCossFilenoToDiskOffset(sfileno f, CossInfo *); +static sfileno storeCossDiskOffsetToFileno(squid_off_t o, CossInfo *); static void storeCossMaybeWriteMemBuf(SwapDir * SD, CossMemBuf * t); static void membuf_describe(CossMemBuf * t, int level, int line); @@ -72,7 +72,7 @@ { CossInfo *cs = (CossInfo *) SD->fsdata; CossMemBuf *newmb; - off_t retofs; + squid_off_t retofs; size_t allocsize; int coll = 0; sfileno checkf; @@ -95,7 +95,7 @@ assert(which != COSS_ALLOC_NOTIFY); /* Check if we have overflowed the disk .. */ - if ((cs->current_offset + allocsize) > ((off_t) SD->max_size << 10)) { + if ((cs->current_offset + allocsize) > ((squid_off_t) SD->max_size << 10)) { /* * tried to allocate past the end of the disk, so wrap * back to the beginning @@ -296,7 +296,7 @@ } void -storeCossRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +storeCossRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { char *p; CossState *cstate = (CossState *) sio->fsstate; @@ -337,11 +337,11 @@ } void -storeCossWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func) +storeCossWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { char *dest; CossMemBuf *membuf; - off_t diskoffset; + squid_off_t diskoffset; /* * If we get handed an object with a size of -1, @@ -450,7 +450,7 @@ CossMemBuf *t = NULL; dlink_node *m; CossInfo *cs = (CossInfo *) SD->fsdata; - off_t o = storeCossFilenoToDiskOffset(s, cs); + squid_off_t o = storeCossFilenoToDiskOffset(s, cs); for (m = cs->membufs.head; m; m = m->next) { t = m->data; if ((o >= t->diskstart) && (o < t->diskend)) @@ -590,7 +590,7 @@ * Kill objects from the tail to make space for a new chunk */ for (m = cs->index.tail; m; m = prev) { - off_t o; + squid_off_t o; prev = m->prev; e = m->data; o = storeCossFilenoToDiskOffset(e->swap_filen, cs); @@ -633,14 +633,14 @@ memPoolFree(coss_state_pool, ((storeIOState *) sio)->fsstate); } -static off_t +static squid_off_t storeCossFilenoToDiskOffset(sfileno f, CossInfo * cs) { - return (off_t) f << cs->blksz_bits; + return (squid_off_t) f << cs->blksz_bits; } static sfileno -storeCossDiskOffsetToFileno(off_t o, CossInfo * cs) +storeCossDiskOffsetToFileno(squid_off_t o, CossInfo * cs) { assert(0 == (o & cs->blksz_mask)); return o >> cs->blksz_bits; Index: squid/src/fs/diskd/diskd.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/diskd/diskd.c,v retrieving revision 1.6 retrieving revision 1.6.122.1 diff -u -r1.6 -r1.6.122.1 --- squid/src/fs/diskd/diskd.c 7 Feb 2001 19:11:49 -0000 1.6 +++ squid/src/fs/diskd/diskd.c 3 Mar 2005 03:44:28 -0000 1.6.122.1 @@ -54,7 +54,7 @@ file_state *next; int id; int fd; - off_t offset; + squid_off_t offset; }; static hash_table *hash = NULL; Index: squid/src/fs/diskd/store_dir_diskd.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/diskd/store_dir_diskd.c,v retrieving revision 1.32.6.8 retrieving revision 1.32.6.8.16.1 diff -u -r1.32.6.8 -r1.32.6.8.16.1 --- squid/src/fs/diskd/store_dir_diskd.c 24 Jul 2003 02:14:09 -0000 1.32.6.8 +++ squid/src/fs/diskd/store_dir_diskd.c 3 Mar 2005 03:44:28 -0000 1.32.6.8.16.1 @@ -528,7 +528,7 @@ storeDiskdHandle(&M); retval = 1; /* Return that we've actually done some work */ if (M.shm_offset > -1) - storeDiskdShmPut(SD, (off_t) M.shm_offset); + storeDiskdShmPut(SD, (squid_off_t) M.shm_offset); } return retval; } @@ -1128,7 +1128,7 @@ char *new; char *cln; char *outbuf; - off_t outbuf_offset; + squid_off_t outbuf_offset; int fd; RemovalPolicyWalker *walker; }; @@ -1636,7 +1636,7 @@ */ void * -storeDiskdShmGet(SwapDir * sd, off_t * shm_offset) +storeDiskdShmGet(SwapDir * sd, squid_off_t * shm_offset) { char *buf = NULL; diskdinfo_t *diskdinfo = sd->fsdata; @@ -1659,7 +1659,7 @@ } void -storeDiskdShmPut(SwapDir * sd, off_t offset) +storeDiskdShmPut(SwapDir * sd, squid_off_t offset) { int i; diskdinfo_t *diskdinfo = sd->fsdata; Index: squid/src/fs/diskd/store_diskd.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/diskd/store_diskd.h,v retrieving revision 1.5 retrieving revision 1.5.64.1 diff -u -r1.5 -r1.5.64.1 --- squid/src/fs/diskd/store_diskd.h 11 Jul 2001 04:35:15 -0000 1.5 +++ squid/src/fs/diskd/store_diskd.h 3 Mar 2005 03:44:29 -0000 1.5.64.1 @@ -95,8 +95,8 @@ extern void storeDiskdDirUnlinkFile(SwapDir *, sfileno); extern void storeDiskdDirReplAdd(SwapDir *, StoreEntry *); extern void storeDiskdDirReplRemove(StoreEntry *); -extern void storeDiskdShmPut(SwapDir *, off_t); -extern void *storeDiskdShmGet(SwapDir *, off_t *); +extern void storeDiskdShmPut(SwapDir *, squid_off_t); +extern void *storeDiskdShmGet(SwapDir *, squid_off_t *); extern void storeDiskdHandle(diomsg * M); extern int storeDiskdDirCallback(SwapDir *); Index: squid/src/fs/diskd/store_io_diskd.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/diskd/store_io_diskd.c,v retrieving revision 1.8.22.3 retrieving revision 1.8.22.3.26.1 diff -u -r1.8.22.3 -r1.8.22.3.26.1 --- squid/src/fs/diskd/store_io_diskd.c 8 Aug 2002 20:18:41 -0000 1.8.22.3 +++ squid/src/fs/diskd/store_io_diskd.c 3 Mar 2005 03:44:29 -0000 1.8.22.3.26.1 @@ -42,7 +42,7 @@ #include "store_diskd.h" -static int storeDiskdSend(int, SwapDir *, int, storeIOState *, int, int, off_t); +static int storeDiskdSend(int, SwapDir *, int, storeIOState *, int, int, squid_off_t); static void storeDiskdIOCallback(storeIOState * sio, int errflag); static CBDUNL storeDiskdIOFreeEntry; @@ -59,7 +59,7 @@ storeIOState *sio; char *buf; diskdstate_t *diskdstate; - off_t shm_offset; + squid_off_t shm_offset; diskdinfo_t *diskdinfo = SD->fsdata; debug(79, 3) ("storeDiskdOpen: fileno %08X\n", f); /* @@ -115,7 +115,7 @@ int x; storeIOState *sio; char *buf; - off_t shm_offset; + squid_off_t shm_offset; diskdinfo_t *diskdinfo = SD->fsdata; diskdstate_t *diskdstate; /* @@ -191,10 +191,10 @@ } void -storeDiskdRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +storeDiskdRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { int x; - off_t shm_offset; + squid_off_t shm_offset; char *rbuf; diskdstate_t *diskdstate = sio->fsstate; debug(79, 3) ("storeDiskdRead: dirno %d, fileno %08X\n", sio->swap_dirn, sio->swap_filen); @@ -231,11 +231,11 @@ } void -storeDiskdWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func) +storeDiskdWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { int x; char *sbuf; - off_t shm_offset; + squid_off_t shm_offset; diskdstate_t *diskdstate = sio->fsstate; debug(79, 3) ("storeDiskdWrite: dirno %d, fileno %08X\n", SD->index, sio->swap_filen); assert(!diskdstate->flags.close_request); @@ -267,7 +267,7 @@ storeDiskdUnlink(SwapDir * SD, StoreEntry * e) { int x; - off_t shm_offset; + squid_off_t shm_offset; char *buf; diskdinfo_t *diskdinfo = SD->fsdata; @@ -462,7 +462,7 @@ } static int -storeDiskdSend(int mtype, SwapDir * sd, int id, storeIOState * sio, int size, int offset, off_t shm_offset) +storeDiskdSend(int mtype, SwapDir * sd, int id, storeIOState * sio, int size, int offset, squid_off_t shm_offset) { int x; diomsg M; Index: squid/src/fs/ufs/store_dir_ufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/ufs/store_dir_ufs.c,v retrieving revision 1.21.6.10 retrieving revision 1.21.6.10.8.1 diff -u -r1.21.6.10 -r1.21.6.10.8.1 --- squid/src/fs/ufs/store_dir_ufs.c 26 Aug 2004 02:13:45 -0000 1.21.6.10 +++ squid/src/fs/ufs/store_dir_ufs.c 3 Mar 2005 03:44:30 -0000 1.21.6.10.8.1 @@ -942,7 +942,7 @@ char *new; char *cln; char *outbuf; - off_t outbuf_offset; + squid_off_t outbuf_offset; int fd; RemovalPolicyWalker *walker; }; Index: squid/src/fs/ufs/store_io_ufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/ufs/store_io_ufs.c,v retrieving revision 1.7.6.3.8.1 retrieving revision 1.7.6.3.8.2 diff -u -r1.7.6.3.8.1 -r1.7.6.3.8.2 --- squid/src/fs/ufs/store_io_ufs.c 25 Feb 2005 10:48:53 -0000 1.7.6.3.8.1 +++ squid/src/fs/ufs/store_io_ufs.c 3 Mar 2005 03:44:31 -0000 1.7.6.3.8.2 @@ -150,7 +150,7 @@ } void -storeUfsRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) +storeUfsRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { ufsstate_t *ufsstate = (ufsstate_t *) sio->fsstate; @@ -172,7 +172,7 @@ } void -storeUfsWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t offset, FREE * free_func) +storeUfsWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, FREE * free_func) { ufsstate_t *ufsstate = (ufsstate_t *) sio->fsstate; debug(79, 3) ("storeUfsWrite: dirn %d, fileno %08X, FD %d\n", sio->swap_dirn, sio->swap_filen, ufsstate->fd); @@ -204,7 +204,7 @@ ufsstate_t *ufsstate = (ufsstate_t *) sio->fsstate; STRCB *callback = sio->read.callback; void *their_data = sio->read.callback_data; - off_t rlen; + squid_off_t rlen; debug(79, 3) ("storeUfsReadDone: dirno %d, fileno %08X, FD %d, len %d\n", sio->swap_dirn, sio->swap_filen, fd, len); @@ -213,7 +213,7 @@ debug(79, 3) ("storeUfsReadDone: got failure (%d)\n", errflag); rlen = -1; } else { - rlen = (off_t) len; + rlen = (squid_off_t) len; sio->offset += len; } assert(callback);