]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish on-demand helpers a little more
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 19 Dec 2009 05:47:00 +0000 (18:47 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 19 Dec 2009 05:47:00 +0000 (18:47 +1300)
* logic for implicit external_acl_type idle= parameter was bad
  could result in idle=9999999 if max<startup.
  Fix that and remove the possible max<startup

* add concurrency back into the config dump displays

* fully drop the auth_param concurrency parameter for consistency.

src/HelperChildConfig.h
src/auth/basic/auth_basic.cc
src/auth/basic/auth_basic.h
src/auth/digest/auth_digest.cc
src/auth/negotiate/auth_negotiate.cc
src/auth/ntlm/auth_ntlm.cc
src/cf.data.pre
src/external_acl.cc

index 89b984f0e5ebaffaa924afd9ecac66adf15afc8e..1378763a0ff9569c18f6badbce67f13079bc153b 100644 (file)
@@ -73,7 +73,7 @@ public:
 
 /* Legacy parser interface */
 #define parse_HelperChildConfig(c)     (c)->parseConfig()
-#define dump_HelperChildConfig(e,n,c)  storeAppendPrintf((e), "\n%s %d startup=%d idle=%d\n", (n), (c).n_max, (c).n_startup, (c).n_idle)
+#define dump_HelperChildConfig(e,n,c)  storeAppendPrintf((e), "\n%s %d startup=%d idle=%d concurrency=%d\n", (n), (c).n_max, (c).n_startup, (c).n_idle, (c).concurrency)
 #define free_HelperChildConfig(dummy)  // NO.
 
 #endif /* _SQUID_SRC_HELPERCHILDCONFIG_H */
index ef1bf15c23da67c0db0eaa3529cbf9fac7696c98..d3bb42138d747b6f2e3e6048afcdb1a645e5bda0 100644 (file)
@@ -301,8 +301,7 @@ AuthBasicConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme)
     storeAppendPrintf(entry, "\n");
 
     storeAppendPrintf(entry, "%s basic realm %s\n", name, basicAuthRealm);
-    storeAppendPrintf(entry, "%s basic children %d startup=%d idle=%d\n", name, authenticateChildren.n_max, authenticateChildren.n_startup, authenticateChildren.n_idle);
-    storeAppendPrintf(entry, "%s basic concurrency %d\n", name, authenticateConcurrency);
+    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");
 }
@@ -331,8 +330,6 @@ AuthBasicConfig::parse(AuthConfig * scheme, int n_configured, char *param_str)
         requirePathnameExists("auth_param basic program", authenticate->key);
     } else if (strcasecmp(param_str, "children") == 0) {
         authenticateChildren.parseConfig();
-    } else if (strcasecmp(param_str, "concurrency") == 0) {
-        parse_int(&authenticateConcurrency);
     } else if (strcasecmp(param_str, "realm") == 0) {
         parse_eol(&basicAuthRealm);
     } else if (strcasecmp(param_str, "credentialsttl") == 0) {
@@ -610,8 +607,6 @@ AuthBasicConfig::init(AuthConfig * scheme)
 
         basicauthenticators->childs = authenticateChildren;
 
-        basicauthenticators->childs.concurrency = authenticateConcurrency;
-
         basicauthenticators->ipc_type = IPC_STREAM;
 
         helperOpenServers(basicauthenticators);
index 079addb13c771c5476f00a29a0a3ec68a60136cd..2728cf4f90c85a247f781e28387e8a9824a1201e 100644 (file)
@@ -128,7 +128,6 @@ public:
     virtual void registerWithCacheManager(void);
     virtual const char * type() const;
     HelperChildConfig authenticateChildren;
-    int authenticateConcurrency;
     char *basicAuthRealm;
     wordlist *authenticate;
     time_t credentialsTTL;
index 909ce9829870ea49a7b50f7369e223ef5d03e487..879a3c8e5e4f98252d5b5e1137b708bf9c373269 100644 (file)
@@ -532,9 +532,9 @@ AuthDigestConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme
         list = list->next;
     }
 
-    storeAppendPrintf(entry, "\n%s %s realm %s\n%s %s children %d startup=%d idle=%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 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",
                       name, "digest", digestAuthRealm,
-                      name, "digest", authenticateChildren.n_max, authenticateChildren.n_startup, authenticateChildren.n_idle,
+                      name, "digest", authenticateChildren.n_max, authenticateChildren.n_startup, authenticateChildren.n_idle, authenticateChildren.concurrency,
                       name, "digest", noncemaxuses,
                       name, "digest", (int) noncemaxduration,
                       name, "digest", (int) nonceGCInterval);
index 16772fb62680da1f799bcd5e088a9f749b3598f4..59da54ca0b96b355a1625320ddb19344e43c9387 100644 (file)
@@ -136,8 +136,8 @@ AuthNegotiateConfig::dump(StoreEntry * entry, const char *name, AuthConfig * sch
         list = list->next;
     }
 
-    storeAppendPrintf(entry, "\n%s negotiate children %d startup=%d idle=%d\n",
-                      name, authenticateChildren.n_max, authenticateChildren.n_startup, authenticateChildren.n_idle);
+    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");
 
 }
index 85fe175c072d5b9151bc38b6ead50c259c06544d..c685dc0bdba967d3e67bd2fc3d16c7ceab7d243c 100644 (file)
@@ -118,8 +118,8 @@ AuthNTLMConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme)
         list = list->next;
     }
 
-    storeAppendPrintf(entry, "\n%s ntlm children %d startup=%d idle=%d\n",
-                      name, authenticateChildren.n_max, authenticateChildren.n_startup, authenticateChildren.n_idle);
+    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");
 
 }
index b20b455c549b52e2b0bf9b41f925a90ba6f04c57..79f17ff084fdf1ecd8f0e65b3c9b44d57ab03c07 100644 (file)
@@ -3196,7 +3196,7 @@ DOC_END
 
 NAME: url_rewrite_children redirect_children
 TYPE: HelperChildConfig
-DEFAULT: 20 startup=0 idle=1 concurrency=0
+DEFAULT: 20 startup=0 idle=1 concurrency=1
 LOC: Config.redirectChildren
 DOC_START
        The maximum number of redirector processes to spawn. If you limit
index 2addc11b6e48bc616b921b233e2f1373a4af7d76..a55c4a373b3c9f2adacf940f7e4b7342182d9c5e 100644 (file)
@@ -295,7 +295,7 @@ parse_externalAclHelper(external_acl ** list)
     a->negative_ttl = -1;
     a->children.n_max = DEFAULT_EXTERNAL_ACL_CHILDREN;
     a->children.n_startup = a->children.n_max;
-    a->children.n_idle = 99999999; // big to detect if the user sets their own.
+    a->children.n_idle = 1;
     a->local_addr.SetLocalhost();
     a->quote = external_acl::QUOTE_METHOD_URL;
 
@@ -357,10 +357,15 @@ parse_externalAclHelper(external_acl ** list)
         token = strtok(NULL, w_space);
     }
 
-    /* our default idle is huge on purpose, make it sane when we know whether the user has set their own. */
-    if (a->children.n_idle > a->children.n_max - a->children.n_startup)
-        a->children.n_idle = max(1, (int)(a->children.n_max - a->children.n_startup));
+     /* check that child startup value is sane. */
+    if ((a->children.n_startup > a->children.n_max)
+        a->children.n_startup = a->children.n_max;
 
+     /* check that child idle value is sane. */
+    if (a->children.n_idle > a->children.n_max)
+        a->children.n_idle = a->children.n_max;
+    if (a->children.n_idle < 1)
+        a->children.n_idle = 1;
 
     if (a->negative_ttl == -1)
         a->negative_ttl = a->ttl;