]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/main.cc
Bug #2063: Hide debugging messages before cache.log is opened
[thirdparty/squid.git] / src / main.cc
index 26ffe7cb2310553f08cc89a9901643cb689c703b..1873745afb6a906eb667c7db66e57be0f917c3cf 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.450 2007/09/25 13:24:59 hno Exp $
+ * $Id: main.cc,v 1.453 2007/12/29 18:20:22 hno Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -72,6 +72,7 @@
 #include "SwapDir.h"
 #include "forward.h"
 #include "MemPool.h"
+#include "ICMPSquid.h"
 
 #if USE_WIN32_SERVICE
 
@@ -292,8 +293,9 @@ mainParseOptions(int argc, char *argv[])
 
         case 'X':
             /* force full debugging */
+            Debug::parseOptions("debug_options ALL,9");
+            Config.onoff.debug_override_X = 1;
             sigusr2_handle(SIGUSR2);
-
             break;
 
         case 'Y':
@@ -560,7 +562,7 @@ serverConnectionsOpen(void)
 #endif
 
     clientdbInit();
-    icmpOpen();
+    icmpEngine.Open();
     netdbInit();
     asnInit();
     ACL::Initialize();
@@ -582,7 +584,7 @@ serverConnectionsClose(void)
     htcpSocketShutdown();
 #endif
 
-    icmpClose();
+    icmpEngine.Close();
 #ifdef SQUID_SNMP
 
     snmpConnectionShutdown();
@@ -692,7 +694,7 @@ mainReconfigure(void)
 static void
 mainRotate(void)
 {
-    icmpClose();
+    icmpEngine.Close();
 #if USE_DNSSERVERS
 
     dnsShutdown();
@@ -712,7 +714,7 @@ mainRotate(void)
     fwdLogRotate();
 #endif
 
-    icmpOpen();
+    icmpEngine.Open();
 #if USE_DNSSERVERS
 
     dnsInit();
@@ -1076,7 +1078,7 @@ main(int argc, char **argv)
     sbrk_start = sbrk(0);
 #endif
 
-    Debug::parseOptions("ALL,1");
+    Debug::parseOptions(NULL);
     debug_log = stderr;
 
 #if defined(SQUID_MAXFD_LIMIT)
@@ -1123,18 +1125,6 @@ main(int argc, char **argv)
     if (oldmask)
         umask(oldmask);
 
-    memset(&local_addr, '\0', sizeof(struct IN_ADDR));
-
-    safe_inet_addr(localhost, &local_addr);
-
-    memset(&any_addr, '\0', sizeof(struct IN_ADDR));
-
-    safe_inet_addr("0.0.0.0", &any_addr);
-
-    memset(&no_addr, '\0', sizeof(struct IN_ADDR));
-
-    safe_inet_addr("255.255.255.255", &no_addr);
-
     squid_srandom(time(NULL));
 
     getCurrentTime();
@@ -1549,8 +1539,8 @@ watch_child(char *argv[])
                    pid, WEXITSTATUS(status));
         } else if (WIFSIGNALED(status)) {
             syslog(LOG_NOTICE,
-                   "Squid Parent: child process %d exited due to signal %d",
-                   pid, WTERMSIG(status));
+                   "Squid Parent: child process %d exited due to signal %d with status %d",
+                   pid, WTERMSIG(status), WEXITSTATUS(status));
         } else {
             syslog(LOG_NOTICE, "Squid Parent: child process %d exited", pid);
         }