]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Renamed "main_processes" to "workers" per Squid Project review.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 5 Jul 2010 22:12:51 +0000 (16:12 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 5 Jul 2010 22:12:51 +0000 (16:12 -0600)
src/cf.data.pre
src/main.cc
src/structs.h
src/tools.cc

index 8b780b1e37a54b9c736f1b8ba7c191796dc89b3a..945b806c5e2b2e3abe7084116d287163420fe19f 100644 (file)
@@ -6844,15 +6844,18 @@ DOC_START
        Whether to lookup the EUI or MAC address of a connected client.
 DOC_END
 
-NAME: main_processes
+NAME: workers
 TYPE: int
-LOC: Config.main_processes
+LOC: Config.workers
 DEFAULT: 1
 DOC_START
-       Number of main Squid processes to fork.
+       Number of main Squid processes or "workers" to fork and maintain.
        0: "no daemon" mode, like running "squid -N ..."
        1: "no SMP" mode, start one main Squid process daemon (default)
-       N: start N main Squid process daemons
+       N: start N main Squid process daemons (i.e., SMP mode)
+
+        In SMP mode, each worker does nearly all what a single Squid daemon
+        does (e.g., listen on http_port and forward HTTP requests).
 DOC_END
 
 EOF
index 892bc85038183a1a02b8b9e37d5599646ecb91df..554d0610606b9f6c83c77e7c779b50b0f40fa509 100644 (file)
@@ -745,16 +745,16 @@ mainReconfigureFinish(void *)
         Config2.onoff.enable_purge = 2;
 
     // parse the config returns a count of errors encountered.
-    const int oldMainProcesses = Config.main_processes;
+    const int oldWorkers = Config.workers;
     if ( parseConfigFile(ConfigFile) != 0) {
         // for now any errors are a fatal condition...
         self_destruct();
     }
-    if (oldMainProcesses != Config.main_processes) {
-        debugs(1, DBG_CRITICAL, "WARNING: Changing 'main_processes' (from " <<
-            oldMainProcesses << " to " << Config.main_processes <<
+    if (oldWorkers != Config.workers) {
+        debugs(1, DBG_CRITICAL, "WARNING: Changing 'workers' (from " <<
+            oldWorkers << " to " << Config.workers <<
             ") is not supported and ignored");
-        Config.main_processes = oldMainProcesses;
+        Config.workers = oldWorkers;
     }
 
     setUmask(Config.umask);
@@ -1375,7 +1375,7 @@ SquidMain(int argc, char **argv)
         return 0;
     }
 
-    if (!opt_no_daemon && Config.main_processes > 0)
+    if (!opt_no_daemon && Config.workers > 0)
         watch_child(argv);
 
     setMaxFD();
@@ -1638,12 +1638,12 @@ watch_child(char *argv[])
         dup2(nullfd, 2);
     }
 
-    if (Config.main_processes > 128) {
-        syslog(LOG_ALERT, "Suspiciously high main_processes value: %d",
-            Config.main_processes);
+    if (Config.workers > 128) {
+        syslog(LOG_ALERT, "Suspiciously high workers value: %d",
+            Config.workers);
         // but we keep going in hope that user knows best
        }
-    TheKids.init(Config.main_processes);
+    TheKids.init(Config.workers);
 
     // keep [re]starting kids until it is time to quit
     for (;;) {
index e96faeb1582760d56792279951f9ff7796ff5400..09806d00497d4d1148dc0dc58f23e7e4d8376a4a 100644 (file)
@@ -617,7 +617,7 @@ struct SquidConfig {
 
     char *accept_filter;
     int umask;
-    int main_processes;
+    int workers;
 
 #if USE_LOADABLE_MODULES
     wordlist *loadable_module_names;
index 8b2e45f43f1299c8a343806902d8b7d198ee7d03..50768dbe5228d80ba4f38c051c893bd9a4331383 100644 (file)
@@ -814,34 +814,34 @@ bool
 IamWorkerProcess()
 {
     // when there is only one process, it has to be the worker
-    if (opt_no_daemon || Config.main_processes == 0)
+    if (opt_no_daemon || Config.workers == 0)
         return true;
 
-    return 0 < KidIdentifier && KidIdentifier <= Config.main_processes;
+    return 0 < KidIdentifier && KidIdentifier <= Config.workers;
 }
 
 bool
 UsingSmp()
 {
-    return !opt_no_daemon && Config.main_processes > 1;
+    return !opt_no_daemon && Config.workers > 1;
 }
 
 bool
 IamCoordinatorProcess()
 {
-    return UsingSmp() && KidIdentifier == Config.main_processes + 1;
+    return UsingSmp() && KidIdentifier == Config.workers + 1;
 }
 
 bool
 IamPrimaryProcess()
 {
     // when there is only one process, it has to be primary
-    if (opt_no_daemon || Config.main_processes == 0)
+    if (opt_no_daemon || Config.workers == 0)
         return true;
 
     // when there is a master and worker process, the master delegates
     // primary functions to its only kid
-    if (Config.main_processes == 1)
+    if (Config.workers == 1)
         return IamWorkerProcess();
 
     // in SMP mode, multiple kids delegate primary functions to the coordinator