]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: de-duplicate handling of auth_param 'children'
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 28 May 2014 11:38:34 +0000 (04:38 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 28 May 2014 11:38:34 +0000 (04:38 -0700)
src/auth/Config.cc
src/auth/basic/auth_basic.cc
src/auth/digest/auth_digest.cc
src/auth/negotiate/auth_negotiate.cc
src/auth/ntlm/auth_ntlm.cc

index a50c13b308d522f85c5cef1f7b20dfa61b12b796..8a601f55cc1e28b205d9918a981fdcc0ffa704fe 100644 (file)
@@ -94,7 +94,10 @@ Auth::Config::registerWithCacheManager(void)
 void
 Auth::Config::parse(Auth::Config * scheme, int n_configured, char *param_str)
 {
-    if (strcmp(param_str, "key_extras") == 0) {
+    if (strcmp(param_str, "children") == 0) {
+        authenticateChildren.parseConfig();
+
+    } else if (strcmp(param_str, "key_extras") == 0) {
         keyExtrasLine = ConfigParser::NextQuotedToken();
         Format::Format *nlf =  new ::Format::Format(scheme->type());
         if (!nlf->parse(keyExtrasLine.termedBuf())) {
@@ -119,6 +122,11 @@ Auth::Config::parse(Auth::Config * scheme, int n_configured, char *param_str)
 void
 Auth::Config::dump(StoreEntry *entry, const char *name, Auth::Config *scheme)
 {
+    storeAppendPrintf(entry, "%s %s children %d startup=%d idle=%d concurrency=%d\n",
+                      name, scheme->type(),
+                      authenticateChildren.n_max, authenticateChildren.n_startup,
+                      authenticateChildren.n_idle, authenticateChildren.concurrency);
+
     if (keyExtrasLine.size() > 0)
         storeAppendPrintf(entry, "%s %s key_extras \"%s\"\n", name, scheme->type(), keyExtrasLine.termedBuf());
 }
index 4f490236d4f2e5c570e46fbf71686a7e0def538a..d3b40a10300db809ec4cc012f50f33b74f99b13a 100644 (file)
@@ -148,7 +148,6 @@ Auth::Basic::Config::dump(StoreEntry * entry, const char *name, Auth::Config * s
     storeAppendPrintf(entry, "\n");
 
     storeAppendPrintf(entry, "%s basic realm %s\n", name, basicAuthRealm);
-    storeAppendPrintf(entry, "%s basic children %d startup=%d idle=%d concurrency=%d\n", name, authenticateChildren.n_max, authenticateChildren.n_startup, authenticateChildren.n_idle, authenticateChildren.concurrency);
     storeAppendPrintf(entry, "%s basic credentialsttl %d seconds\n", name, (int) credentialsTTL);
     storeAppendPrintf(entry, "%s basic casesensitive %s\n", name, casesensitive ? "on" : "off");
     Auth::Config::dump(entry, name, scheme);
@@ -177,8 +176,6 @@ Auth::Basic::Config::parse(Auth::Config * scheme, int n_configured, char *param_
         parse_wordlist(&authenticateProgram);
 
         requirePathnameExists("auth_param basic program", authenticateProgram->key);
-    } else if (strcmp(param_str, "children") == 0) {
-        authenticateChildren.parseConfig();
     } else if (strcmp(param_str, "realm") == 0) {
         parse_eol(&basicAuthRealm);
     } else if (strcmp(param_str, "credentialsttl") == 0) {
index 2bf72436d43733b7a000a1ced1e9230e14f38471..81be588c63fb4fc805c3d25190102dbaa169c80d 100644 (file)
@@ -499,9 +499,8 @@ Auth::Digest::Config::dump(StoreEntry * entry, const char *name, Auth::Config *
         list = list->next;
     }
 
-    storeAppendPrintf(entry, "\n%s %s realm %s\n%s %s children %d startup=%d idle=%d concurrency=%d\n%s %s nonce_max_count %d\n%s %s nonce_max_duration %d seconds\n%s %s nonce_garbage_interval %d seconds\n",
+    storeAppendPrintf(entry, "\n%s %s realm %s\n%s %s nonce_max_count %d\n%s %s nonce_max_duration %d seconds\n%s %s nonce_garbage_interval %d seconds\n",
                       name, "digest", digestAuthRealm,
-                      name, "digest", authenticateChildren.n_max, authenticateChildren.n_startup, authenticateChildren.n_idle, authenticateChildren.concurrency,
                       name, "digest", noncemaxuses,
                       name, "digest", (int) noncemaxduration,
                       name, "digest", (int) nonceGCInterval);
@@ -639,8 +638,6 @@ Auth::Digest::Config::parse(Auth::Config * scheme, int n_configured, char *param
         parse_wordlist(&authenticateProgram);
 
         requirePathnameExists("auth_param digest program", authenticateProgram->key);
-    } else if (strcmp(param_str, "children") == 0) {
-        authenticateChildren.parseConfig();
     } else if (strcmp(param_str, "realm") == 0) {
         parse_eol(&digestAuthRealm);
     } else if (strcmp(param_str, "nonce_garbage_interval") == 0) {
index 9ce6010ae220848a9a45f464174e363c49e59762..c5eee8a216e2a7929081d7c031201a983f9a5e9b 100644 (file)
@@ -119,9 +119,7 @@ Auth::Negotiate::Config::dump(StoreEntry * entry, const char *name, Auth::Config
         list = list->next;
     }
 
-    storeAppendPrintf(entry, "\n%s negotiate children %d startup=%d idle=%d concurrency=%d\n",
-                      name, authenticateChildren.n_max, authenticateChildren.n_startup, authenticateChildren.n_idle, authenticateChildren.concurrency);
-    storeAppendPrintf(entry, "%s %s keep_alive %s\n", name, "negotiate", keep_alive ? "on" : "off");
+    storeAppendPrintf(entry, "\n%s %s keep_alive %s\n", name, "negotiate", keep_alive ? "on" : "off");
     Auth::Config::dump(entry, name, scheme);
 }
 
@@ -138,8 +136,6 @@ Auth::Negotiate::Config::parse(Auth::Config * scheme, int n_configured, char *pa
         parse_wordlist(&authenticateProgram);
 
         requirePathnameExists("auth_param negotiate program", authenticateProgram->key);
-    } else if (strcmp(param_str, "children") == 0) {
-        authenticateChildren.parseConfig();
     } else if (strcmp(param_str, "keep_alive") == 0) {
         parse_onoff(&keep_alive);
     } else
index 03d62f1dfd6a447b88a1aebe84a3149f57d9c763..b86cd9857ae59660b3f9e02d1a48c3f69c124328 100644 (file)
@@ -111,9 +111,7 @@ Auth::Ntlm::Config::dump(StoreEntry * entry, const char *name, Auth::Config * sc
         list = list->next;
     }
 
-    storeAppendPrintf(entry, "\n%s ntlm children %d startup=%d idle=%d concurrency=%d\n",
-                      name, authenticateChildren.n_max, authenticateChildren.n_startup, authenticateChildren.n_idle, authenticateChildren.concurrency);
-    storeAppendPrintf(entry, "%s %s keep_alive %s\n", name, "ntlm", keep_alive ? "on" : "off");
+    storeAppendPrintf(entry, "\n%s %s keep_alive %s\n", name, "ntlm", keep_alive ? "on" : "off");
     Auth::Config::dump(entry, name, scheme);
 }
 
@@ -130,8 +128,6 @@ Auth::Ntlm::Config::parse(Auth::Config * scheme, int n_configured, char *param_s
         parse_wordlist(&authenticateProgram);
 
         requirePathnameExists("auth_param ntlm program", authenticateProgram->key);
-    } else if (strcmp(param_str, "children") == 0) {
-        authenticateChildren.parseConfig();
     } else if (strcmp(param_str, "keep_alive") == 0) {
         parse_onoff(&keep_alive);
     } else