/*
- * $Id: Store.h,v 1.26 2006/09/03 21:05:20 hno Exp $
+ * $Id: Store.h,v 1.27 2007/04/17 05:40:18 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
/* reduce the memory lock count on the entry */
virtual int unlock();
/* increate the memory lock count on the entry */
+ virtual ssize_t objectLen() const;
virtual void lock()
/*
- * $Id: client_side.cc,v 1.746 2007/04/15 14:46:15 serassio Exp $
+ * $Id: client_side.cc,v 1.747 2007/04/17 05:40:18 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
assert(fd > -1);
debugs(33, 5, "clientWriteComplete: FD " << fd << ", sz " << size <<
", err " << errflag << ", off " << http->out.size << ", len " <<
- entry ? objectLen(entry) : 0);
+ entry ? entry->objectLen() : 0);
clientUpdateSocketStats(http->logType, size);
assert (this->fd() == fd);
/*
- * $Id: client_side_reply.cc,v 1.116 2007/01/31 23:58:25 wessels Exp $
+ * $Id: client_side_reply.cc,v 1.117 2007/04/17 05:40:18 wessels Exp $
*
* DEBUG: section 88 Client-side Reply Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
int
clientReplyContext::storeOKTransferDone() const
{
- if (http->out.offset >= objectLen(http->storeEntry()) - headers_sz)
+ if (http->out.offset >= http->storeEntry()->objectLen() - headers_sz)
return 1;
return 0;
/*
- * $Id: store.cc,v 1.603 2007/02/07 00:48:15 hno Exp $
+ * $Id: store.cc,v 1.604 2007/04/17 05:40:18 wessels Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
reply = getReply();
debug(20, 3) ("storeEntryValidLength: Checking '%s'\n", getMD5Text());
debugs(20, 5, "storeEntryValidLength: object_len = " <<
- objectLen(this));
+ objectLen());
debug(20, 5) ("storeEntryValidLength: hdr_sz = %d\n",
reply->hdr_sz);
debug(20, 5) ("storeEntryValidLength: content_length = %d\n",
if (reply->sline.status == HTTP_NO_CONTENT)
return 1;
- diff = reply->hdr_sz + reply->content_length - objectLen(this);
+ diff = reply->hdr_sz + reply->content_length - objectLen();
if (diff == 0)
return 1;
}
ssize_t
-objectLen(const StoreEntry * e)
+StoreEntry::objectLen() const
{
- assert(e->mem_obj != NULL);
- return e->mem_obj->object_sz;
+ assert(mem_obj != NULL);
+ return mem_obj->object_sz;
}
int
{
assert(e->mem_obj != NULL);
assert(e->getReply() != NULL);
- return objectLen(e) - e->getReply()->hdr_sz;
+ return e->objectLen() - e->getReply()->hdr_sz;
}
/*
- * $Id: store_client.cc,v 1.148 2006/09/20 11:38:14 adrian Exp $
+ * $Id: store_client.cc,v 1.149 2007/04/17 05:40:18 wessels Exp $
*
* DEBUG: section 90 Storage Manager Client-Side Interface
* AUTHOR: Duane Wessels
if (e->store_status == STORE_PENDING)
return 0;
- if ((len = objectLen(e)) < 0)
+ if ((len = e->objectLen()) < 0)
return 0;
if (sc->copyInto.offset < len)
/*
- * $Id: store_dir.cc,v 1.157 2007/04/10 00:45:10 wessels Exp $
+ * $Id: store_dir.cc,v 1.158 2007/04/17 05:40:18 wessels Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
int i;
int load;
RefCount<SwapDir> sd;
- ssize_t objsize = (ssize_t) objectLen(e);
for (i = 0; i <= Config.cacheSwap.n_configured; i++) {
if (++dirn >= Config.cacheSwap.n_configured)
if (sd->cur_size > sd->max_size)
continue;
- if (!sd->objectSizeIsAcceptable(objsize))
+ if (!sd->objectSizeIsAcceptable(e->objectLen()))
continue;
/* check for error or overload condition */
RefCount<SwapDir> SD;
/* Calculate the object size */
- objsize = (ssize_t) objectLen(e);
+ objsize = e->objectLen();
if (objsize != -1)
objsize += e->mem_obj->swap_hdr_sz;
store_io_stats.create.calls++;
/* This is just done for logging purposes */
- objsize = objectLen(e);
+ objsize = e->objectLen();
if (objsize != -1)
objsize += e->mem_obj->swap_hdr_sz;
/*
- * $Id: store_swapout.cc,v 1.108 2006/08/21 00:50:41 robertc Exp $
+ * $Id: store_swapout.cc,v 1.109 2007/04/17 05:40:18 wessels Exp $
*
* DEBUG: section 20 Storage Manager Swapout Functions
* AUTHOR: Duane Wessels
/* swapping complete */
debug(20, 3) ("storeSwapOutFileClosed: SwapOut complete: '%s' to %d, %08X\n",
storeUrl(e), e->swap_dirn, e->swap_filen);
- e->swap_file_sz = objectLen(e) + mem->swap_hdr_sz;
+ e->swap_file_sz = e->objectLen() + mem->swap_hdr_sz;
e->swap_status = SWAPOUT_DONE;
e->store()->updateSize(e->swap_file_sz, 1);