Hi,

I believe there is a little problem with this.  If store digest is not
enabled.  I get:
store_digest.cc: In function `void
  storeDigestRegisterWithCacheManager(CacheManager&)':
store_digest.cc:135: error: `registerAction' undeclared (first use this
  function)
store_digest.cc:135: error: (Each undeclared identifier is reported only once
  for each function it appears in.)

Attached is my proposal fix for this.

Regards,

On 5/28/06, Robert Collins <[EMAIL PROTECTED]> wrote:
I hadn't heard anything back, so I've committed what I think is a
tasteful implementation of the second option. This has allowed removing
the stub_cache_manager.cc test suite file, as well as making a bunch of
modules' init simpler.

Cheers,
Rob

On Sun, 2006-05-28 at 00:18 +1000, Robert Collins wrote:
> I'd like to make the cachemgrRegister calls in various of our fooInit()
> calls not require dragging in the whole squid to the binary, this is
> part of the blow-out on linked in objects for squid.
>
> Secondly, I'd like to remove the idea of the cachemanager being a global
> object and make it be explicitly passed in when it exists.
>
> We discussed this somewhat on irc.
>
> Some possibilities:
>
> Assuming we have a CacheManager class with 'register' and 'unregister'
> virtual methods, we could:
>
> * add that as a parameter to the Init calls where this is desirable.
> * Have a separate call from Init in modules which asks the module to
> register all its menu items with a supplied CacheManager.
>
> I prefer the second option, as it makes the behaviour of init more
> occupied with 'what is required to use a module' rather than 'do
> everything that /squid/ needs done before running that is related to
> this module.' Henrik is concerned that this will increase the
> maintenance cost of main(), which is possibly true, but I think we can
> address that in future if needed, i.e. by a registry of the modules with
> a few functions like 'init', 'registerWithCacheManger' etc.
>
> Thoughts?
>
> Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBEej3JM4BfeEKYx2ERAoPWAJ4lSy5Rff8itOhm5WfyLcs06CA63ACgluZb
OcntB2Y7OpvtYHxqh/MxQPk=
=XJhV
-----END PGP SIGNATURE-----





--
Gonzalo A. Arana
Index: store_digest.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/store_digest.cc,v
retrieving revision 1.15
diff -U6 -p -r1.15 store_digest.cc
--- store_digest.cc	29 May 2006 00:50:18 -0000	1.15
+++ store_digest.cc	29 May 2006 13:26:56 -0000
@@ -38,15 +38,15 @@
  * TODO: We probably do not track all the cases when
  *       storeDigestNoteStoreReady() must be called; this may prevent
  *       storeDigestRebuild/write schedule to be activated
  */
 
 #include "squid.h"
+#include "CacheManager.h"
 #if USE_CACHE_DIGESTS
 
-#include "CacheManager.h"
 #include "Store.h"
 #include "HttpRequest.h"
 #include "HttpReply.h"
 #include "MemObject.h"
 #include "SquidTime.h"
 #include "StoreSearch.h"

Reply via email to