]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Implement UserNameCache for Auth::Negotiate.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 2 Sep 2015 17:11:07 +0000 (19:11 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 2 Sep 2015 17:11:07 +0000 (19:11 +0200)
src/Makefile.am
src/auth/User.h
src/auth/negotiate/User.cc
src/auth/negotiate/User.h

index 8a9d04aefcadee15a80365fe9be16edd9278bc92..ba9b631ae7679ac05066e4b282270f2c520ca94d 100644 (file)
@@ -421,6 +421,8 @@ squid_SOURCES = \
        send-announce.h \
        send-announce.cc \
        $(SBUF_SOURCE) \
+       SBufAlgos.h \
+       SBufAlgos.cc \
        SBufDetailedStats.h \
        SBufDetailedStats.cc \
        SBufStatsAction.h \
index bebf7f96746859b116c097fbd7df191d716c5c31..806c4db53b04ad97b833ce94123e672cbba12a70 100644 (file)
@@ -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<Auth::UserNameCache> Cache(); //must be implemented in subclasses
+
     CredentialState credentials() const;
     void credentials(CredentialState);
 
index e3bb4faededc299e75d38a5cceb50c8fad057297..ba50d1c4228a6f7e9fb191dcd0dfe4dd0d8466bb 100644 (file)
@@ -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::UserNameCache>
+Auth::Negotiate::User::Cache()
+{
+    static Auth::UserNameCache cache("negotiate");
+    static CbcPointer<Auth::UserNameCache> p(&cache);
+    return p;
+}
index 1c17dbc5906dba585f232969036c4d2e79fbdd45..f63e8577167bf04071d2a5689c6e0a022555d676 100644 (file)
@@ -29,6 +29,8 @@ public:
     ~User();
     virtual int32_t ttl() const;
 
+    static CbcPointer<Auth::UserNameCache> Cache();
+
     dlink_list proxy_auth_list;
 };