]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2111 - squid.conf, others overwrite -X
authoramosjeffries <>
Sun, 2 Dec 2007 15:23:56 +0000 (15:23 +0000)
committeramosjeffries <>
Sun, 2 Dec 2007 15:23:56 +0000 (15:23 +0000)
Add configuration option to store knowledge of -X command-line option
and use it to abort any parsing of future debug_options.

Add call to first set all debug levels to '9' (full) before freezing
the debug state.

src/debug.cc
src/main.cc
src/structs.h

index 550797320e9f3bb8f447da2cfd95251d90569e7b..9390d5147e3ecb1ee86c8c106316f01fa926e646 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: debug.cc,v 1.104 2007/10/31 04:52:16 amosjeffries Exp $
+ * $Id: debug.cc,v 1.105 2007/12/02 08:23:56 amosjeffries Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -439,6 +439,11 @@ Debug::parseOptions(char const *options) {
     char *p = NULL;
     char *s = NULL;
 
+    if(Config.onoff.debug_override_X) {
+        debugs(0, 9, "command-line -X overrides: " << options);
+        return;
+    }
+
     for (i = 0; i < MAX_DEBUG_SECTIONS; i++)
         Debug::Levels[i] = -1;
 
index 26ffe7cb2310553f08cc89a9901643cb689c703b..cd3f631f756e099dc78ebad223b279c91fa61875 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.451 2007/12/02 08:23:56 amosjeffries Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -292,8 +292,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':
index 95d5e26681472b68e4775bf8054c86414d2dddc0..ce2a077bf36d0cf161010550ace3ff695bdc496d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.567 2007/11/15 23:33:05 wessels Exp $
+ * $Id: structs.h,v 1.568 2007/12/02 08:23:56 amosjeffries Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -553,6 +553,7 @@ struct _SquidConfig
         int emailErrData;
         int httpd_suppress_version_string;
         int global_internal_static;
+        int debug_override_X;
     }
 
     onoff;