From: hno <> Date: Sun, 30 Dec 2007 01:20:22 +0000 (+0000) Subject: Bug #2063: Hide debugging messages before cache.log is opened X-Git-Tag: BASIC_TPROXY4~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb6a61d1d0eb9e58850ac288e271dca87c8d2a5d;p=thirdparty%2Fsquid.git Bug #2063: Hide debugging messages before cache.log is opened various submodules tries to log informal debug messages while starting, which ends up on stderr if these is called before cache.log is opened. this patch changes the default debug level to 0 before cache.log is opened only allowing critical errors to be reported on stderr. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 2a23779a43..bef3b35207 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.531 2007/12/27 15:48:53 hno Exp $ + * $Id: cache_cf.cc,v 1.532 2007/12/29 18:20:22 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2356,18 +2356,6 @@ parse_eol(char *volatile *var) #define dump_eol dump_string #define free_eol free_string -void -parse_debug(char *volatile *var) -{ - parse_eol(var); - safe_free(debug_options) - debug_options = xstrdup(Config.debugOptions); - Debug::parseOptions(Config.debugOptions); -} - -#define dump_debug dump_string -#define free_debug free_string - static void dump_time_t(StoreEntry * entry, const char *name, time_t var) { diff --git a/src/cf.data.pre b/src/cf.data.pre index f9e15f2f1f..34b1cd21fe 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.491 2007/12/27 15:48:53 hno Exp $ +# $Id: cf.data.pre,v 1.492 2007/12/29 18:20:22 hno Exp $ # # SQUID Web Proxy Cache http://www.squid-cache.org/ # ---------------------------------------------------------- @@ -2203,7 +2203,7 @@ DOC_START DOC_END NAME: debug_options -TYPE: debug +TYPE: eol DEFAULT: ALL,1 LOC: Config.debugOptions DOC_START @@ -2276,6 +2276,7 @@ NAME: netdb_filename TYPE: string DEFAULT: @DEFAULT_NETDB_FILE@ LOC: Config.netdbFilename +IFDEF: USE_ICMP DOC_START A filename where Squid stores it's netdb state between restarts. To disable, enter "none". diff --git a/src/debug.cc b/src/debug.cc index e14f25dc22..3e8a4b72ed 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,5 +1,5 @@ /* - * $Id: debug.cc,v 1.107 2007/12/14 23:11:46 amosjeffries Exp $ + * $Id: debug.cc,v 1.108 2007/12/29 18:20:22 hno Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -445,7 +445,7 @@ Debug::parseOptions(char const *options) { } for (i = 0; i < MAX_DEBUG_SECTIONS; i++) - Debug::Levels[i] = -1; + Debug::Levels[i] = 0; if (options) { p = xstrdup(options); diff --git a/src/main.cc b/src/main.cc index ed11df33db..1873745afb 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.452 2007/12/14 23:11:47 amosjeffries 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 @@ -1078,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)