From 37296f4c931c51faedebaae57147ebc1c7dc03d9 Mon Sep 17 00:00:00 2001 From: amosjeffries <> Date: Sun, 2 Dec 2007 15:23:56 +0000 Subject: [PATCH] Bug 2111 - squid.conf, others overwrite -X 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 | 7 ++++++- src/main.cc | 5 +++-- src/structs.h | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/debug.cc b/src/debug.cc index 550797320e..9390d5147e 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -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; diff --git a/src/main.cc b/src/main.cc index 26ffe7cb23..cd3f631f75 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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': diff --git a/src/structs.h b/src/structs.h index 95d5e26681..ce2a077bf3 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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; -- 2.47.2