From: Francesco Chemolli Date: Wed, 2 Sep 2015 17:11:07 +0000 (+0200) Subject: Implement UserNameCache for Auth::Negotiate. X-Git-Tag: SQUID_4_0_1~21^2~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=92f59a05815420b69bf39d4bfec656a4398cd956;p=thirdparty%2Fsquid.git Implement UserNameCache for Auth::Negotiate. --- diff --git a/src/Makefile.am b/src/Makefile.am index 8a9d04aefc..ba9b631ae7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -421,6 +421,8 @@ squid_SOURCES = \ send-announce.h \ send-announce.cc \ $(SBUF_SOURCE) \ + SBufAlgos.h \ + SBufAlgos.cc \ SBufDetailedStats.h \ SBufDetailedStats.cc \ SBufStatsAction.h \ diff --git a/src/auth/User.h b/src/auth/User.h index bebf7f9674..806c4db53b 100644 --- a/src/auth/User.h +++ b/src/auth/User.h @@ -13,6 +13,7 @@ #include "auth/CredentialState.h" #include "auth/Type.h" +#include "base/CbcPointer.h" #include "base/RefCount.h" #include "dlink.h" #include "ip/Address.h" @@ -85,6 +86,8 @@ public: void addToNameCache(); static void UsernameCacheStats(StoreEntry * output); + static CbcPointer Cache(); //must be implemented in subclasses + CredentialState credentials() const; void credentials(CredentialState); diff --git a/src/auth/negotiate/User.cc b/src/auth/negotiate/User.cc index e3bb4faede..ba50d1c422 100644 --- a/src/auth/negotiate/User.cc +++ b/src/auth/negotiate/User.cc @@ -9,6 +9,7 @@ #include "squid.h" #include "auth/Config.h" #include "auth/negotiate/User.h" +#include "auth/UserNameCache.h" #include "Debug.h" Auth::Negotiate::User::User(Auth::Config *aConfig, const char *aRequestRealm) : @@ -27,3 +28,10 @@ Auth::Negotiate::User::ttl() const return -1; // Negotiate cannot be cached. } +CbcPointer +Auth::Negotiate::User::Cache() +{ + static Auth::UserNameCache cache("negotiate"); + static CbcPointer p(&cache); + return p; +} diff --git a/src/auth/negotiate/User.h b/src/auth/negotiate/User.h index 1c17dbc590..f63e857716 100644 --- a/src/auth/negotiate/User.h +++ b/src/auth/negotiate/User.h @@ -29,6 +29,8 @@ public: ~User(); virtual int32_t ttl() const; + static CbcPointer Cache(); + dlink_list proxy_auth_list; };