------------------------------------------------------------ revno: 13205 [merge] revision-id: kinkie@squid-cache.org-20140103175235-fo37ieq0a1td0ata parent: kinkie@squid-cache.org-20140102230320-1re3sopi3awozt0c parent: kinkie@squid-cache.org-20140103111352-9w38brepno97d0io committer: Francesco Chemolli branch nick: trunk timestamp: Fri 2014-01-03 18:52:35 +0100 message: Merge storeentry-refactor, fix store unit test ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: kinkie@squid-cache.org-20140103175235-fo37ieq0a1td0ata # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 1c20449b24669f1ce1bfcf552c68e55d47783080 # timestamp: 2014-01-03 17:53:48 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: kinkie@squid-cache.org-20140102230320-\ # 1re3sopi3awozt0c # # Begin patch === modified file 'src/Makefile.am' --- src/Makefile.am 2014-01-02 16:01:57 +0000 +++ src/Makefile.am 2014-01-03 10:32:53 +0000 @@ -591,7 +591,6 @@ client_side_request.cci \ MemBuf.cci \ MemBuf.h \ - Store.cci \ StoreEntryStream.h \ String.cci \ SquidString.h \ === removed file 'src/Store.cci' --- src/Store.cci 2013-10-25 00:13:46 +0000 +++ src/Store.cci 1970-01-01 00:00:00 +0000 @@ -1,63 +0,0 @@ -/* - * DEBUG: section 20 Storage Manager - * AUTHOR: Harvest Derived - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ - -#include "HttpReply.h" -#include "MemObject.h" - -/** - \retval true Store contains 0 bytes of data. - \retval false Store contains 1 or more bytes of data. - \retval false Store contains negative content !!!!!! - */ -bool -StoreEntry::isEmpty () const -{ - assert (mem_obj); - return mem_obj->endOffset() == 0; -} - -/// \retval * - Always NULL for 'null' filesystem. -HttpReply const * -NullStoreEntry::getReply() const -{ - return NULL; -} - -/// \retval N/A Kills squid with fatal error if called before Store Root is set. -Store & -Store::Root() -{ - if (CurrentRoot == NULL) - fatal("No Store Root has been set"); - - return *CurrentRoot; -} === modified file 'src/Store.h' --- src/Store.h 2013-12-19 04:53:35 +0000 +++ src/Store.h 2014-01-03 10:32:53 +0000 @@ -41,6 +41,7 @@ #include "hash.h" #include "HttpReply.h" #include "HttpRequestMethod.h" +#include "MemObject.h" #include "Range.h" #include "RemovalPolicy.h" #include "StoreIOBuffer.h" @@ -56,7 +57,6 @@ class AsyncCall; class HttpRequest; -class MemObject; class Packer; class RequestFlags; class StoreClient; @@ -84,7 +84,16 @@ virtual HttpReply const *getReply() const; virtual void write (StoreIOBuffer); - virtual _SQUID_INLINE_ bool isEmpty() const; + + /** Check if the Store entry is emtpty + * \retval true Store contains 0 bytes of data. + * \retval false Store contains 1 or more bytes of data. + * \retval false Store contains negative content !!!!!! + */ + virtual bool isEmpty() const { + assert (mem_obj); + return mem_obj->endOffset() == 0; + } virtual bool isAccepting() const; virtual size_t bytesWanted(Range const aRange, bool ignoreDelayPool = false) const; virtual void complete(); @@ -251,7 +260,7 @@ } const char *getMD5Text() const; - _SQUID_INLINE_ HttpReply const *getReply() const; + HttpReply const *getReply() const { return NULL; } void write (StoreIOBuffer) {} bool isEmpty () const {return true;} @@ -284,7 +293,11 @@ public: /** The root store */ - static _SQUID_INLINE_ Store &Root(); + static Store &Root() { + if (CurrentRoot == NULL) + fatal("No Store Root has been set"); + return *CurrentRoot; + } static void Root(Store *); static void Root(RefCount); static void Stats(StoreEntry * output); @@ -504,8 +517,4 @@ /// \ingroup StoreAPI void storeGetMemSpace(int size); -#if _USE_INLINE_ -#include "Store.cci" -#endif - #endif /* SQUID_STORE_H */ === modified file 'src/ipc/Queue.h' --- src/ipc/Queue.h 2013-12-06 23:52:26 +0000 +++ src/ipc/Queue.h 2014-01-03 11:13:52 +0000 @@ -148,6 +148,7 @@ { public: BaseMultiQueue(const int aLocalProcessId); + virtual ~BaseMultiQueue() {} /// clears the reader notification received by the local process from the remote process void clearReaderSignal(const int remoteProcessId); === modified file 'src/store.cc' --- src/store.cc 2014-01-01 19:20:49 +0000 +++ src/store.cc 2014-01-03 10:32:53 +0000 @@ -2085,7 +2085,3 @@ { return NULL; } - -#if !_USE_INLINE_ -#include "Store.cci" -#endif === modified file 'src/tests/stub_store.cc' --- src/tests/stub_store.cc 2013-12-29 05:30:26 +0000 +++ src/tests/stub_store.cc 2014-01-03 10:32:53 +0000 @@ -136,14 +136,3 @@ void destroyStoreEntry(void *) STUB // in Packer.cc !? void packerToStoreInit(Packer * p, StoreEntry * e) STUB void storeGetMemSpace(int size) STUB - -#if !_USE_INLINE_ /* stubs for Store.cci */ -bool StoreEntry::isEmpty () const STUB_RETVAL(true) -HttpReply const *NullStoreEntry::getReply() const STUB_RETVAL(NULL) - -Store &Store::Root() -{ - CPPUNIT_ASSERT(CurrentRoot != NULL); - return *CurrentRoot; -} -#endif /* !_USE_INLINE_ */