From: wessels <> Date: Tue, 22 Nov 2005 06:14:22 +0000 (+0000) Subject: Added a convenience StoreIOBuffer constructor that creates a X-Git-Tag: SQUID_3_0_PRE4~509 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d0df277966070ee71c5aafb04554754ce9f2ab91;p=thirdparty%2Fsquid.git Added a convenience StoreIOBuffer constructor that creates a StoreIOBuffer from a MemBuf plus an offset. This was added for ICAP integration. --- diff --git a/src/StoreIOBuffer.h b/src/StoreIOBuffer.h index 863b29d6eb..da1c2456a7 100644 --- a/src/StoreIOBuffer.h +++ b/src/StoreIOBuffer.h @@ -1,6 +1,6 @@ /* - * $Id: StoreIOBuffer.h,v 1.4 2003/08/10 03:59:19 robertc Exp $ + * $Id: StoreIOBuffer.h,v 1.5 2005/11/21 23:14:22 wessels Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -37,6 +37,7 @@ /* TODO: move this and the range() method into a .cci */ #include "Range.h" +#include "MemBuf.h" class StoreIOBuffer { @@ -50,11 +51,27 @@ public: flags.error = 0; } + /* Create a StoreIOBuffer from a MemBuf and offset */ + /* NOTE that MemBuf still "owns" the pointers, StoreIOBuffer is just borrowing them */ + StoreIOBuffer(MemBuf *aMemBuf, off_t anOffset) : + length(aMemBuf->contentSize()), + offset (anOffset), + data(aMemBuf->content()) + { + flags.error = 0; + } + Range range() const { return Range(offset, offset + length); } + void dump() const + { + fwrite(data, length, 1, stderr); + fwrite("\n", 1, 1, stderr); + } + struct {