From: Francesco Chemolli Date: Fri, 4 Sep 2015 03:39:43 +0000 (+0200) Subject: Set debug levels to sanity in username cache X-Git-Tag: SQUID_4_0_1~21^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fedcd192d43ef0644136669f2b52be6d362d4027;p=thirdparty%2Fsquid.git Set debug levels to sanity in username cache --- diff --git a/src/auth/UserNameCache.cc b/src/auth/UserNameCache.cc index 9dedcaad4b..a08b1dcb13 100644 --- a/src/auth/UserNameCache.cc +++ b/src/auth/UserNameCache.cc @@ -16,8 +16,6 @@ #include "SquidConfig.h" #include "SquidTime.h" -// XXX: reset debugs levels to something sane - namespace Auth { CBDATA_CLASS_INIT(UserNameCache); @@ -25,7 +23,7 @@ CBDATA_CLASS_INIT(UserNameCache); UserNameCache::UserNameCache(const char *name) : cachename(name), cacheCleanupEventName("User cache cleanup: ") { - debugs(29, 2, "initializing " << name << " username cache"); + debugs(29, 5, "initializing " << name << " username cache"); cacheCleanupEventName.append(name); eventAdd(cacheCleanupEventName.c_str(), &UserNameCache::Cleanup, this, ::Config.authenticateGCInterval, 1); @@ -35,7 +33,7 @@ UserNameCache::UserNameCache(const char *name) : Auth::User::Pointer UserNameCache::lookup(const SBuf &userKey) const { - debugs(29, 2, "lookup for " << userKey); + debugs(29, 6, "lookup for " << userKey); auto p = store_.find(userKey); if (p == store_.end()) return User::Pointer(nullptr); @@ -45,7 +43,7 @@ UserNameCache::lookup(const SBuf &userKey) const void UserNameCache::Cleanup(void *data) { - debugs(29, 2, "checkpoint"); + debugs(29, 5, "checkpoint"); if (!cbdataReferenceValid(data)) return; // data is this in disguise @@ -53,14 +51,12 @@ UserNameCache::Cleanup(void *data) // cache entries with expiretime <= expirationTime are to be evicted const time_t expirationTime = current_time.tv_sec - ::Config.authenticateTTL; - //XXX for some reason if evicting directly iterators are invalidated - // trying to defer deletion by using a queue const auto end = self->store_.end(); for (auto i = self->store_.begin(); i != end;) { - debugs(29, 2, "considering " << i->first << "(expires in " << + debugs(29, 6, "considering " << i->first << "(expires in " << (expirationTime - i->second->expiretime) << " sec)"); if (i->second->expiretime <= expirationTime) { - debugs(29, 2, "evicting " << i->first); + debugs(29, 6, "evicting " << i->first); i = self->store_.erase(i); //erase advances i } else { ++i; @@ -73,7 +69,7 @@ UserNameCache::Cleanup(void *data) void UserNameCache::insert(Auth::User::Pointer anAuth_user) { - debugs(29, 2, "adding " << anAuth_user->SBUserKey()); + debugs(29, 6, "adding " << anAuth_user->SBUserKey()); store_[anAuth_user->SBUserKey()] = anAuth_user; } @@ -97,7 +93,7 @@ UserNameCache::sortedUsersList() const void UserNameCache::endingShutdown() { - debugs(29, 2, "Shutting down username cache " << cachename); + debugs(29, 5, "Shutting down username cache " << cachename); eventDelete(&UserNameCache::Cleanup, this); reset(); } @@ -105,7 +101,7 @@ UserNameCache::endingShutdown() void UserNameCache::syncConfig() { - debugs(29, 2, "Reconfiguring username cache " << cachename); + debugs(29, 5, "Reconfiguring username cache " << cachename); for (auto i : store_) { aclCacheMatchFlush(&i.second->proxy_match_cache); //flush }