From: Amos Jeffries Date: Wed, 28 May 2014 11:38:34 +0000 (-0700) Subject: Cleanup: de-duplicate handling of auth_param 'children' X-Git-Tag: SQUID_3_5_0_1~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0309fc406832ea1103fb4172cadab9f6d6abe8cb;p=thirdparty%2Fsquid.git Cleanup: de-duplicate handling of auth_param 'children' --- diff --git a/src/auth/Config.cc b/src/auth/Config.cc index a50c13b308..8a601f55cc 100644 --- a/src/auth/Config.cc +++ b/src/auth/Config.cc @@ -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()); } diff --git a/src/auth/basic/auth_basic.cc b/src/auth/basic/auth_basic.cc index 4f490236d4..d3b40a1030 100644 --- a/src/auth/basic/auth_basic.cc +++ b/src/auth/basic/auth_basic.cc @@ -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) { diff --git a/src/auth/digest/auth_digest.cc b/src/auth/digest/auth_digest.cc index 2bf72436d4..81be588c63 100644 --- a/src/auth/digest/auth_digest.cc +++ b/src/auth/digest/auth_digest.cc @@ -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) { diff --git a/src/auth/negotiate/auth_negotiate.cc b/src/auth/negotiate/auth_negotiate.cc index 9ce6010ae2..c5eee8a216 100644 --- a/src/auth/negotiate/auth_negotiate.cc +++ b/src/auth/negotiate/auth_negotiate.cc @@ -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 diff --git a/src/auth/ntlm/auth_ntlm.cc b/src/auth/ntlm/auth_ntlm.cc index 03d62f1dfd..b86cd9857a 100644 --- a/src/auth/ntlm/auth_ntlm.cc +++ b/src/auth/ntlm/auth_ntlm.cc @@ -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