--------------------- PatchSet 6466 Date: 2005/03/03 04:43:41 Author: hno Branch: lfs-2_5 Tag: (none) Log: Cleanup to not overuse squid_off_t where ssize_t or int is sufficient Members: src/HttpReply.c:1.10.6.4.6.2->1.10.6.4.6.3 src/MemPool.c:1.6.6.1.34.2->1.6.6.1.34.3 src/client.c:1.8.6.5.10.4->1.8.6.5.10.5 src/client_side.c:1.47.2.56.2.3->1.47.2.56.2.4 src/disk.c:1.8.14.2.8.1->1.8.14.2.8.2 src/dns_internal.c:1.15.6.5.8.2->1.15.6.5.8.3 src/helper.c:1.16.2.14->1.16.2.14.8.1 src/htcp.c:1.9.2.5.2.3->1.9.2.5.2.4 src/net_db.c:1.11.22.3.2.2->1.11.22.3.2.3 src/protos.h:1.41.6.22.2.4->1.41.6.22.2.5 src/store.c:1.16.6.7.6.3->1.16.6.7.6.4 src/store_client.c:1.9.6.2.16.2->1.9.6.2.16.3 src/store_dir.c:1.19.6.2.16.2->1.19.6.2.16.3 src/store_swapmeta.c:1.8.74.1->1.8.74.2 src/store_swapout.c:1.11.2.1.30.2->1.11.2.1.30.3 src/structs.h:1.48.2.33.2.5->1.48.2.33.2.6 src/typedefs.h:1.25.6.6.8.3->1.25.6.6.8.4 Index: squid/src/HttpReply.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpReply.c,v retrieving revision 1.10.6.4.6.2 retrieving revision 1.10.6.4.6.3 diff -u -r1.10.6.4.6.2 -r1.10.6.4.6.3 --- squid/src/HttpReply.c 3 Mar 2005 03:44:01 -0000 1.10.6.4.6.2 +++ squid/src/HttpReply.c 3 Mar 2005 04:43:41 -0000 1.10.6.4.6.3 @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.c,v 1.10.6.4.6.2 2005/03/03 03:44:01 hno Exp $ + * $Id: HttpReply.c,v 1.10.6.4.6.3 2005/03/03 04:43:41 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, squid_off_t end) +httpReplyParse(HttpReply * rep, const char *buf, size_t end) { /* * this extra buffer/copy will be eliminated when headers become Index: squid/src/MemPool.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/MemPool.c,v retrieving revision 1.6.6.1.34.2 retrieving revision 1.6.6.1.34.3 diff -u -r1.6.6.1.34.2 -r1.6.6.1.34.3 --- squid/src/MemPool.c 3 Mar 2005 03:44:01 -0000 1.6.6.1.34.2 +++ squid/src/MemPool.c 3 Mar 2005 04:43:41 -0000 1.6.6.1.34.3 @@ -1,6 +1,6 @@ /* - * $Id: MemPool.c,v 1.6.6.1.34.2 2005/03/03 03:44:01 hno Exp $ + * $Id: MemPool.c,v 1.6.6.1.34.3 2005/03/03 04:43:41 hno Exp $ * * DEBUG: section 63 Low Level Memory Pool Management * AUTHOR: Alex Rousskov @@ -46,7 +46,7 @@ /* module globals */ /* huge constant to set mem_idle_limit to "unlimited" */ -static const size_t mem_unlimited_size = 2 * 1024 * MB; +static const size_t mem_unlimited_size = 2 * 1024 * MB - 1; /* we cannot keep idle more than this limit */ static size_t mem_idle_limit = 0; @@ -58,9 +58,9 @@ static Stack Pools; /* local prototypes */ -static void memShrink(squid_off_t new_limit); +static void memShrink(size_t new_limit); static void memPoolDescribe(const MemPool * pool); -static void memPoolShrink(MemPool * pool, squid_off_t new_limit); +static void memPoolShrink(MemPool * pool, size_t new_limit); static double @@ -135,9 +135,9 @@ static void -memShrink(squid_off_t new_limit) +memShrink(size_t new_limit) { - squid_off_t start_limit = TheMeter.idle.level; + size_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 squid_off_t target_pool_size = (size_t) ((double) pool->meter.idle.level * new_limit) / start_limit; + const size_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, squid_off_t new_limit) +memPoolShrink(MemPool * pool, size_t new_limit) { assert(pool); assert(new_limit >= 0); @@ -304,11 +304,11 @@ return pool->meter.inuse.level; } -squid_off_t +size_t memPoolInUseSize(const MemPool * pool) { assert(pool); - return ((squid_off_t)pool->obj_size) * pool->meter.inuse.level; + return (pool->obj_size * pool->meter.inuse.level); } /* to-do: make debug level a parameter? */ Index: squid/src/client.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/client.c,v retrieving revision 1.8.6.5.10.4 retrieving revision 1.8.6.5.10.5 diff -u -r1.8.6.5.10.4 -r1.8.6.5.10.5 --- squid/src/client.c 3 Mar 2005 03:44:02 -0000 1.8.6.5.10.4 +++ squid/src/client.c 3 Mar 2005 04:43:41 -0000 1.8.6.5.10.5 @@ -1,6 +1,6 @@ /* - * $Id: client.c,v 1.8.6.5.10.4 2005/03/03 03:44:02 hno Exp $ + * $Id: client.c,v 1.8.6.5.10.5 2005/03/03 04:43:41 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 squid_off_t myread(int fd, void *buf, size_t len); -static squid_off_t mywrite(int fd, void *buf, size_t len); +static ssize_t myread(int fd, void *buf, size_t len); +static ssize_t mywrite(int fd, void *buf, size_t len); static int put_fd; static char *put_file = NULL; static struct stat sb; @@ -490,14 +490,14 @@ } -static squid_off_t +static ssize_t myread(int fd, void *buf, size_t len) { alarm(io_timeout); return read(fd, buf, len); } -static squid_off_t +static ssize_t mywrite(int fd, void *buf, size_t len) { alarm(io_timeout); Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.47.2.56.2.3 retrieving revision 1.47.2.56.2.4 diff -u -r1.47.2.56.2.3 -r1.47.2.56.2.4 --- squid/src/client_side.c 3 Mar 2005 03:44:03 -0000 1.47.2.56.2.3 +++ squid/src/client_side.c 3 Mar 2005 04:43:42 -0000 1.47.2.56.2.4 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.47.2.56.2.3 2005/03/03 03:44:03 hno Exp $ + * $Id: client_side.c,v 1.47.2.56.2.4 2005/03/03 04:43:42 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1729,10 +1729,10 @@ clientPackRange(clientHttpRequest * http, HttpHdrRangeIter * i, const char **buf, - squid_off_t * size, + size_t * size, MemBuf * mb) { - const squid_off_t copy_sz = i->debt_size <= *size ? i->debt_size : *size; + const size_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, squid_off_t size) +clientCanPackMoreRanges(const clientHttpRequest * http, HttpHdrRangeIter * i, size_t size) { /* first update "i" if needed */ if (!i->debt_size) { @@ -1792,7 +1792,7 @@ /* 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, squid_off_t size, MemBuf * mb) +clientPackMoreRanges(clientHttpRequest * http, const char *buf, size_t size, MemBuf * mb) { HttpHdrRangeIter *i = &http->range_iter; /* offset in range specs does not count the prefix of an http msg */ @@ -2184,8 +2184,8 @@ StoreEntry *entry = http->entry; int done; http->out.size += size; - debug(33, 5) ("clientWriteComplete: FD %d, sz %ld, err %d, off %ld, len %d\n", - fd, (long int) size, errflag, (long int) http->out.offset, entry ? objectLen(entry) : 0); + debug(33, 5) ("clientWriteComplete: FD %d, sz %d, err %d, off %"PRINTF_OFF_T", len %"PRINTF_OFF_T"\n", + fd, size, errflag, http->out.offset, entry ? objectLen(entry) : (squid_off_t)0); if (size > 0) { kb_incr(&statCounter.client_http.kbytes_out, size); if (isTcpHit(http->log_type)) Index: squid/src/disk.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/disk.c,v retrieving revision 1.8.14.2.8.1 retrieving revision 1.8.14.2.8.2 diff -u -r1.8.14.2.8.1 -r1.8.14.2.8.2 --- squid/src/disk.c 3 Mar 2005 03:44:04 -0000 1.8.14.2.8.1 +++ squid/src/disk.c 3 Mar 2005 04:43:42 -0000 1.8.14.2.8.2 @@ -1,6 +1,6 @@ /* - * $Id: disk.c,v 1.8.14.2.8.1 2005/03/03 03:44:04 hno Exp $ + * $Id: disk.c,v 1.8.14.2.8.2 2005/03/03 04:43:42 hno Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -293,7 +293,7 @@ file_write(int fd, squid_off_t file_offset, void *ptr_to_buf, - int len, + size_t len, DWCB * handle, void *handle_data, FREE * free_func) @@ -331,9 +331,9 @@ * in a snap */ void -file_write_mbuf(int fd, squid_off_t off, MemBuf mb, DWCB * handler, void *handler_data) +file_write_mbuf(int fd, squid_off_t file_offset, MemBuf mb, DWCB * handler, void *handler_data) { - file_write(fd, off, mb.buf, mb.size, handler, handler_data, memBufFreeFunc(&mb)); + file_write(fd, file_offset, mb.buf, mb.size, handler, handler_data, memBufFreeFunc(&mb)); } /* Read from FD */ @@ -352,12 +352,12 @@ memFree(ctrl_dat, MEM_DREAD_CTRL); return; } - if (F->disk.offset != ctrl_dat->offset) { + if (F->disk.offset != ctrl_dat->file_offset) { debug(6, 3) ("diskHandleRead: FD %d seeking to offset %d\n", - fd, (int) ctrl_dat->offset); - lseek(fd, ctrl_dat->offset, SEEK_SET); /* XXX ignore return? */ + fd, (int) ctrl_dat->file_offset); + lseek(fd, ctrl_dat->file_offset, SEEK_SET); /* XXX ignore return? */ statCounter.syscalls.disk.seeks++; - F->disk.offset = ctrl_dat->offset; + F->disk.offset = ctrl_dat->file_offset; } errno = 0; len = FD_READ_METHOD(fd, ctrl_dat->buf, ctrl_dat->req_len); @@ -388,13 +388,13 @@ * 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, squid_off_t offset, DRCB * handler, void *client_data) +file_read(int fd, char *buf, size_t req_len, squid_off_t file_offset, DRCB * handler, void *client_data) { dread_ctrl *ctrl_dat; assert(fd >= 0); ctrl_dat = memAllocate(MEM_DREAD_CTRL); ctrl_dat->fd = fd; - ctrl_dat->offset = offset; + ctrl_dat->file_offset = file_offset; ctrl_dat->req_len = req_len; ctrl_dat->buf = buf; ctrl_dat->end_of_file = 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.2 retrieving revision 1.15.6.5.8.3 diff -u -r1.15.6.5.8.2 -r1.15.6.5.8.3 --- squid/src/dns_internal.c 3 Mar 2005 03:44:04 -0000 1.15.6.5.8.2 +++ squid/src/dns_internal.c 3 Mar 2005 04:43:42 -0000 1.15.6.5.8.3 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.c,v 1.15.6.5.8.2 2005/03/03 03:44:04 hno Exp $ + * $Id: dns_internal.c,v 1.15.6.5.8.3 2005/03/03 04:43:42 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; - squid_off_t len; + ssize_t len; struct sockaddr_in from; socklen_t from_len; int max = INCOMING_DNS_MAX; Index: squid/src/helper.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/helper.c,v retrieving revision 1.16.2.14 retrieving revision 1.16.2.14.8.1 diff -u -r1.16.2.14 -r1.16.2.14.8.1 --- squid/src/helper.c 7 Nov 2004 03:14:27 -0000 1.16.2.14 +++ squid/src/helper.c 3 Mar 2005 04:43:43 -0000 1.16.2.14.8.1 @@ -1,6 +1,6 @@ /* - * $Id: helper.c,v 1.16.2.14 2004/11/07 03:14:27 squidadm Exp $ + * $Id: helper.c,v 1.16.2.14.8.1 2005/03/03 04:43:43 hno Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Harvest Derived? @@ -374,7 +374,7 @@ srv->flags.closing ? 'C' : ' ', srv->flags.shutdown ? 'S' : ' ', tt < 0.0 ? 0.0 : tt, - (int) srv->offset, + srv->offset, srv->request ? log_quote(srv->request->buf) : "(none)"); } storeAppendPrintf(sentry, "\nFlags key:\n\n"); @@ -423,7 +423,7 @@ srv->flags.reserved ? 'R' : ' ', srv->flags.shutdown ? 'S' : ' ', tt < 0.0 ? 0.0 : tt, - (int) srv->offset, + srv->offset, srv->request ? log_quote(srv->request->buf) : "(none)"); } storeAppendPrintf(sentry, "\nFlags key:\n\n"); Index: squid/src/htcp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/htcp.c,v retrieving revision 1.9.2.5.2.3 retrieving revision 1.9.2.5.2.4 diff -u -r1.9.2.5.2.3 -r1.9.2.5.2.4 --- squid/src/htcp.c 3 Mar 2005 03:47:08 -0000 1.9.2.5.2.3 +++ squid/src/htcp.c 3 Mar 2005 04:43:43 -0000 1.9.2.5.2.4 @@ -1,6 +1,6 @@ /* - * $Id: htcp.c,v 1.9.2.5.2.3 2005/03/03 03:47:08 hno Exp $ + * $Id: htcp.c,v 1.9.2.5.2.4 2005/03/03 04:43:43 hno Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -159,17 +159,17 @@ static MemPool *htcpDetailPool = NULL; -static char *htcpBuildPacket(htcpStuff * stuff, squid_off_t * len); +static char *htcpBuildPacket(htcpStuff * stuff, ssize_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 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 ssize_t htcpBuildAuth(char *buf, size_t buflen); +static ssize_t htcpBuildCountstr(char *buf, size_t buflen, const char *s); +static ssize_t htcpBuildData(char *buf, size_t buflen, htcpStuff * stuff); +static ssize_t htcpBuildDetail(char *buf, size_t buflen, htcpStuff * stuff); +static ssize_t htcpBuildOpData(char *buf, size_t buflen, htcpStuff * stuff); +static ssize_t htcpBuildSpecifier(char *buf, size_t buflen, htcpStuff * stuff); +static ssize_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 squid_off_t +static ssize_t htcpBuildAuth(char *buf, size_t buflen) { htcpAuthHeader auth; @@ -222,12 +222,12 @@ return copy_sz; } -static squid_off_t +static ssize_t htcpBuildCountstr(char *buf, size_t buflen, const char *s) { u_short length; size_t len; - squid_off_t off = 0; + int off = 0; if (buflen - off < 2) return -1; if (s) @@ -247,11 +247,11 @@ return off; } -static squid_off_t +static ssize_t htcpBuildSpecifier(char *buf, size_t buflen, htcpStuff * stuff) { - squid_off_t off = 0; - squid_off_t s; + ssize_t off = 0; + ssize_t s; s = htcpBuildCountstr(buf + off, buflen - off, stuff->S.method); if (s < 0) return s; @@ -272,11 +272,11 @@ return off; } -static squid_off_t +static ssize_t htcpBuildDetail(char *buf, size_t buflen, htcpStuff * stuff) { - squid_off_t off = 0; - squid_off_t s; + ssize_t off = 0; + ssize_t s; s = htcpBuildCountstr(buf + off, buflen - off, stuff->D.resp_hdrs); if (s < 0) return s; @@ -292,7 +292,7 @@ return off; } -static squid_off_t +static ssize_t htcpBuildTstOpData(char *buf, size_t buflen, htcpStuff * stuff) { switch (stuff->rr) { @@ -312,10 +312,10 @@ return 0; } -static squid_off_t +static ssize_t htcpBuildOpData(char *buf, size_t buflen, htcpStuff * stuff) { - squid_off_t off = 0; + ssize_t off = 0; debug(31, 3) ("htcpBuildOpData: opcode %s\n", htcpOpcodeStr[stuff->op]); switch (stuff->op) { @@ -329,11 +329,11 @@ return off; } -static squid_off_t +static ssize_t htcpBuildData(char *buf, size_t buflen, htcpStuff * stuff) { - squid_off_t off = 0; - squid_off_t op_data_sz; + ssize_t off = 0; + ssize_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, squid_off_t * len) +htcpBuildPacket(htcpStuff * stuff, ssize_t * len) { size_t buflen = 8192; - squid_off_t s; - squid_off_t off = 0; + ssize_t s; + ssize_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; - squid_off_t pktlen; + ssize_t pktlen; char *host; int rtt = 0; int hops = 0; @@ -897,7 +897,7 @@ { cache_key *save_key; char *pkt; - squid_off_t pktlen; + ssize_t pktlen; char vbuf[32]; htcpStuff stuff; HttpHeader hdr; Index: squid/src/net_db.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/net_db.c,v retrieving revision 1.11.22.3.2.2 retrieving revision 1.11.22.3.2.3 diff -u -r1.11.22.3.2.2 -r1.11.22.3.2.3 --- squid/src/net_db.c 3 Mar 2005 03:44:05 -0000 1.11.22.3.2.2 +++ squid/src/net_db.c 3 Mar 2005 04:43:43 -0000 1.11.22.3.2.3 @@ -1,6 +1,6 @@ /* - * $Id: net_db.c,v 1.11.22.3.2.2 2005/03/03 03:44:05 hno Exp $ + * $Id: net_db.c,v 1.11.22.3.2.3 2005/03/03 04:43:43 hno Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -527,11 +527,11 @@ } static void -netdbExchangeHandleReply(void *data, char *buf, squid_off_t size) +netdbExchangeHandleReply(void *data, char *buf, ssize_t size) { netdbExchangeState *ex = data; int rec_sz = 0; - squid_off_t o; + ssize_t o; struct in_addr addr; double rtt; double hops; Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.41.6.22.2.4 retrieving revision 1.41.6.22.2.5 diff -u -r1.41.6.22.2.4 -r1.41.6.22.2.5 --- squid/src/protos.h 3 Mar 2005 03:44:05 -0000 1.41.6.22.2.4 +++ squid/src/protos.h 3 Mar 2005 04:43:43 -0000 1.41.6.22.2.5 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.41.6.22.2.4 2005/03/03 03:44:05 hno Exp $ + * $Id: protos.h,v 1.41.6.22.2.5 2005/03/03 04:43:43 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -223,24 +223,12 @@ /* disk.c */ extern int file_open(const char *path, int mode); extern void file_close(int fd); -extern void file_write(int, squid_off_t, void *, int len, DWCB *, void *, FREE *); +extern void file_write(int, squid_off_t, void *, size_t 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 file_read(int, char *, size_t, squid_off_t, DRCB *, void *); extern void disk_init(void); -/* diskd.c */ -extern diskd_queue *afile_create_queue(void); -extern void afile_destroy_queue(diskd_queue *); -extern void afile_sync_queue(diskd_queue *); -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, 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 *); - +/* dns.s */ extern void dnsShutdown(void); extern void dnsInit(void); extern void dnsSubmit(const char *lookup, HLPCB * callback, void *data); @@ -484,7 +472,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, squid_off_t); +extern int httpReplyParse(HttpReply * rep, const char *buf, size_t); extern void httpReplyPackInto(const HttpReply * rep, Packer * p); /* ez-routines */ /* mem-pack: returns a ready to use mem buffer with a packed reply */ @@ -864,7 +852,7 @@ extern void memPoolFree(MemPool * pool, void *obj); extern int memPoolWasUsed(const MemPool * pool); extern int memPoolInUseCount(const MemPool * pool); -extern squid_off_t memPoolInUseSize(const MemPool * pool); +extern size_t memPoolInUseSize(const MemPool * pool); extern int memPoolUsedCount(const MemPool * pool); extern void memPoolReport(const MemPool * pool, StoreEntry * e); @@ -926,8 +914,8 @@ extern void storeAppendVPrintf(StoreEntry *, const char *, va_list ap); extern int storeCheckCachable(StoreEntry * e); extern void storeSetPrivateKey(StoreEntry *); -extern int objectLen(const StoreEntry * e); -extern int contentLen(const StoreEntry * e); +extern squid_off_t objectLen(const StoreEntry * e); +extern squid_off_t contentLen(const StoreEntry * e); extern HttpReply *storeEntryReply(StoreEntry *); extern int storeTooManyDiskFilesOpen(void); extern void storeEntryReset(StoreEntry *); Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.16.6.7.6.3 retrieving revision 1.16.6.7.6.4 diff -u -r1.16.6.7.6.3 -r1.16.6.7.6.4 --- squid/src/store.c 3 Mar 2005 03:44:06 -0000 1.16.6.7.6.3 +++ squid/src/store.c 3 Mar 2005 04:43:44 -0000 1.16.6.7.6.4 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.16.6.7.6.3 2005/03/03 03:44:06 hno Exp $ + * $Id: store.c,v 1.16.6.7.6.4 2005/03/03 04:43:44 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -945,7 +945,7 @@ assert(e->mem_obj != NULL); reply = e->mem_obj->reply; debug(20, 3) ("storeEntryValidLength: Checking '%s'\n", storeKeyText(e->hash.key)); - debug(20, 5) ("storeEntryValidLength: object_len = %d\n", + debug(20, 5) ("storeEntryValidLength: object_len = %"PRINTF_OFF_T"\n", objectLen(e)); debug(20, 5) ("storeEntryValidLength: hdr_sz = %d\n", reply->hdr_sz); @@ -1247,7 +1247,7 @@ return e->mem_obj->object_sz; } -int +squid_off_t contentLen(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.2 retrieving revision 1.9.6.2.16.3 diff -u -r1.9.6.2.16.2 -r1.9.6.2.16.3 --- squid/src/store_client.c 3 Mar 2005 03:44:06 -0000 1.9.6.2.16.2 +++ squid/src/store_client.c 3 Mar 2005 04:43:44 -0000 1.9.6.2.16.3 @@ -1,6 +1,6 @@ /* - * $Id: store_client.c,v 1.9.6.2.16.2 2005/03/03 03:44:06 hno Exp $ + * $Id: store_client.c,v 1.9.6.2.16.3 2005/03/03 04:43:44 hno Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -153,7 +153,7 @@ } static void -storeClientCallback(store_client * sc, squid_off_t sz) +storeClientCallback(store_client * sc, ssize_t sz) { STCB *callback = sc->callback; char *buf = sc->copy_buf; @@ -265,7 +265,7 @@ storeClientCopy3(StoreEntry * e, store_client * sc) { MemObject *mem = e->mem_obj; - size_t sz; + ssize_t sz; if (storeClientNoMoreToSend(e, sc)) { /* There is no more to send! */ Index: squid/src/store_dir.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_dir.c,v retrieving revision 1.19.6.2.16.2 retrieving revision 1.19.6.2.16.3 diff -u -r1.19.6.2.16.2 -r1.19.6.2.16.3 --- squid/src/store_dir.c 3 Mar 2005 03:44:07 -0000 1.19.6.2.16.2 +++ squid/src/store_dir.c 3 Mar 2005 04:43:44 -0000 1.19.6.2.16.3 @@ -1,6 +1,6 @@ /* - * $Id: store_dir.c,v 1.19.6.2.16.2 2005/03/03 03:44:07 hno Exp $ + * $Id: store_dir.c,v 1.19.6.2.16.3 2005/03/03 04:43:44 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -182,7 +182,7 @@ storeDirSelectSwapDirLeastLoad(const StoreEntry * e) { squid_off_t objsize; - squid_off_t most_free = 0, cur_free; + int most_free = 0, cur_free; squid_off_t least_objsize = -1; int least_load = INT_MAX; int load; @@ -191,7 +191,7 @@ SwapDir *SD; /* Calculate the object size */ - objsize = (squid_off_t) objectLen(e); + objsize = objectLen(e); if (objsize != -1) objsize += e->mem_obj->swap_hdr_sz; for (i = 0; i < Config.cacheSwap.n_configured; i++) { Index: squid/src/store_swapmeta.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_swapmeta.c,v retrieving revision 1.8.74.1 retrieving revision 1.8.74.2 diff -u -r1.8.74.1 -r1.8.74.2 --- squid/src/store_swapmeta.c 3 Mar 2005 03:44:07 -0000 1.8.74.1 +++ squid/src/store_swapmeta.c 3 Mar 2005 04:43:45 -0000 1.8.74.2 @@ -1,6 +1,6 @@ /* - * $Id: store_swapmeta.c,v 1.8.74.1 2005/03/03 03:44:07 hno Exp $ + * $Id: store_swapmeta.c,v 1.8.74.2 2005/03/03 04:43:45 hno Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -86,7 +86,7 @@ { int buflen = 0; tlv *t; - squid_off_t j = 0; + int j = 0; char *buf; assert(length != NULL); buflen++; /* STORE_META_OK */ @@ -119,7 +119,7 @@ char type; int length; int buflen; - squid_off_t j = 0; + int 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.2 retrieving revision 1.11.2.1.30.3 diff -u -r1.11.2.1.30.2 -r1.11.2.1.30.3 --- squid/src/store_swapout.c 3 Mar 2005 03:44:07 -0000 1.11.2.1.30.2 +++ squid/src/store_swapout.c 3 Mar 2005 04:43:45 -0000 1.11.2.1.30.3 @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.c,v 1.11.2.1.30.2 2005/03/03 03:44:07 hno Exp $ + * $Id: store_swapout.c,v 1.11.2.1.30.3 2005/03/03 04:43:45 hno Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -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 = (squid_off_t) (mem->inmem_hi - mem->swapout.queue_offset); + swapout_size = 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 @@ -260,7 +260,7 @@ /* the storeWrite() call might generate an error */ if (e->swap_status != SWAPOUT_WRITING) break; - swapout_size = (squid_off_t) (mem->inmem_hi - mem->swapout.queue_offset); + swapout_size = mem->inmem_hi - mem->swapout.queue_offset; if (e->store_status == STORE_PENDING) if (swapout_size < SM_PAGE_SIZE) break; Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.48.2.33.2.5 retrieving revision 1.48.2.33.2.6 diff -u -r1.48.2.33.2.5 -r1.48.2.33.2.6 --- squid/src/structs.h 3 Mar 2005 03:44:07 -0000 1.48.2.33.2.5 +++ squid/src/structs.h 3 Mar 2005 04:43:45 -0000 1.48.2.33.2.6 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.48.2.33.2.5 2005/03/03 03:44:07 hno Exp $ + * $Id: structs.h,v 1.48.2.33.2.6 2005/03/03 04:43:45 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -389,7 +389,7 @@ int highWaterMark; int lowWaterMark; } Swap; - squid_off_t memMaxSize; + size_t memMaxSize; struct { char *relayHost; u_short relayPort; @@ -732,31 +732,19 @@ struct _dread_ctrl { int fd; - squid_off_t offset; - int req_len; + squid_off_t file_offset; + size_t req_len; char *buf; int end_of_file; DRCB *handler; void *client_data; }; -struct _dnsserver_t { - int id; - int inpipe; - int outpipe; - time_t answer; - squid_off_t offset; - size_t size; - char ip_inbuf[DNS_INBUF_SZ]; - struct timeval dispatch_time; - void *data; -}; - struct _dwrite_q { squid_off_t file_offset; char *buf; - int len; - squid_off_t buf_offset; + size_t len; + size_t buf_offset; dwrite_q *next; FREE *free_func; }; @@ -1081,7 +1069,7 @@ squid_off_t size; } out; HttpHdrRangeIter range_iter; /* data for iterating thru range specs */ - squid_off_t req_sz; /* raw request size on input, not current request size */ + size_t req_sz; /* raw request size on input, not current request size */ StoreEntry *entry; StoreEntry *old_entry; log_type log_type; @@ -1112,7 +1100,7 @@ int fd; struct { char *buf; - squid_off_t offset; + size_t offset; size_t size; } in; struct { @@ -1639,7 +1627,7 @@ sfileno swap_filen; StoreEntry *e; /* Need this so the FS layers can play god */ mode_t mode; - squid_off_t st_size; /* do stat(2) after read open */ + 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; @@ -1918,8 +1906,8 @@ /* object to track per-action memory usage (e.g. #idle objects) */ struct _MemMeter { - squid_off_t level; /* current level (count or volume) */ - squid_off_t hwater_level; /* high water mark */ + ssize_t level; /* current level (count or volume) */ + ssize_t hwater_level; /* high water mark */ time_t hwater_stamp; /* timestamp of last high water mark change */ }; @@ -2074,7 +2062,7 @@ int wfd; char *buf; size_t buf_sz; - squid_off_t offset; + int offset; struct timeval dispatch_time; struct timeval answer_time; dlink_node link; @@ -2098,7 +2086,7 @@ int wfd; char *buf; size_t buf_sz; - squid_off_t offset; + int offset; struct timeval dispatch_time; struct timeval answer_time; dlink_node link; Index: squid/src/typedefs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/typedefs.h,v retrieving revision 1.25.6.6.8.3 retrieving revision 1.25.6.6.8.4 diff -u -r1.25.6.6.8.3 -r1.25.6.6.8.4 --- squid/src/typedefs.h 3 Mar 2005 03:44:08 -0000 1.25.6.6.8.3 +++ squid/src/typedefs.h 3 Mar 2005 04:43:45 -0000 1.25.6.6.8.4 @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.25.6.6.8.3 2005/03/03 03:44:08 hno Exp $ + * $Id: typedefs.h,v 1.25.6.6.8.4 2005/03/03 04:43:45 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -96,7 +96,6 @@ typedef struct _SquidConfig2 SquidConfig2; typedef struct _close_handler close_handler; typedef struct _dread_ctrl dread_ctrl; -typedef struct _dnsserver_t dnsserver_t; typedef struct _dwrite_q dwrite_q; typedef struct _ETag ETag; typedef struct _fde fde;