------------------------------------------------------------ revno: 13663 revision-id: squid3@treenet.co.nz-20141121092722-p2p9si46dh8jqbht parent: squid3@treenet.co.nz-20141121092643-r0qq3lhntneh3g8a committer: Amos Jeffries branch nick: 3.5 timestamp: Fri 2014-11-21 01:27:22 -0800 message: Fix output from squid.conf parser DBG_CRITICAL level messages before self_destruct() require a FATAL: tag to highlight the reason for the crash and obscure "BUNGLED" text which is about to follow. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20141121092722-p2p9si46dh8jqbht # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: b3c066e308031dcbc276b7afc4213c86249962b1 # timestamp: 2014-11-21 09:37:22 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20141121092643-\ # r0qq3lhntneh3g8a # # Begin patch === modified file 'src/ConfigParser.cc' --- src/ConfigParser.cc 2014-09-13 13:59:43 +0000 +++ src/ConfigParser.cc 2014-11-21 09:27:22 +0000 @@ -108,7 +108,7 @@ *t = '\0'; if ((wordFile = fopen(fn, "r")) == NULL) { - debugs(3, DBG_CRITICAL, "Can not open file " << t << " for reading"); + debugs(3, DBG_CRITICAL, "ERROR: Can not open file " << fn << " for reading"); return NULL; } @@ -217,7 +217,7 @@ if (PreviewMode_) strncpy(UnQuoted, SQUID_ERROR_TOKEN, sizeof(UnQuoted)); else { - debugs(3, DBG_CRITICAL, errorStr << ": " << errorPos); + debugs(3, DBG_CRITICAL, "FATAL: " << errorStr << ": " << errorPos); self_destruct(); } } @@ -276,7 +276,7 @@ CfgLineTokens_.push(err); return err; } else { - debugs(3, DBG_CRITICAL, "Unknown cfg function: " << tokenStart); + debugs(3, DBG_CRITICAL, "FATAL: Unknown cfg function: " << tokenStart); self_destruct(); } } @@ -300,7 +300,7 @@ CfgLineTokens_.push(err); return err; } else { - debugs(3, DBG_CRITICAL, "Not alphanumeric character '"<< *s << "' in unquoted token " << tokenStart); + debugs(3, DBG_CRITICAL, "FATAL: Not alphanumeric character '"<< *s << "' in unquoted token " << tokenStart); self_destruct(); } } @@ -363,7 +363,7 @@ char *path = NextToken(); if (LastTokenType != ConfigParser::QuotedToken) { - debugs(3, DBG_CRITICAL, "Quoted filename missing: " << token); + debugs(3, DBG_CRITICAL, "FATAL: Quoted filename missing: " << token); self_destruct(); return NULL; } @@ -372,20 +372,20 @@ char *end = NextToken(); ConfigParser::PreviewMode_ = savePreview; if (LastTokenType != ConfigParser::SimpleToken || strcmp(end, ")") != 0) { - debugs(3, DBG_CRITICAL, "missing ')' after " << token << "(\"" << path << "\""); + debugs(3, DBG_CRITICAL, "FATAL: missing ')' after " << token << "(\"" << path << "\""); self_destruct(); return NULL; } if (CfgFiles.size() > 16) { - debugs(3, DBG_CRITICAL, "WARNING: can't open %s for reading parameters: includes are nested too deeply (>16)!\n" << path); + debugs(3, DBG_CRITICAL, "FATAL: can't open %s for reading parameters: includes are nested too deeply (>16)!\n" << path); self_destruct(); return NULL; } ConfigParser::CfgFile *wordfile = new ConfigParser::CfgFile(); if (!path || !wordfile->startParse(path)) { - debugs(3, DBG_CRITICAL, "Error opening config file: " << token); + debugs(3, DBG_CRITICAL, "FATAL: Error opening config file: " << token); delete wordfile; self_destruct(); return NULL; @@ -429,7 +429,7 @@ ConfigParser::RegexStrtokFile() { if (ConfigParser::RecognizeQuotedValues) { - debugs(3, DBG_CRITICAL, "Can not read regex expresion while configuration_includes_quoted_values is enabled"); + debugs(3, DBG_CRITICAL, "FATAL: Can not read regex expression while configuration_includes_quoted_values is enabled"); self_destruct(); } char * token = strtokFile(); @@ -440,7 +440,7 @@ ConfigParser::RegexPattern() { if (ConfigParser::RecognizeQuotedValues) { - debugs(3, DBG_CRITICAL, "Can not read regex expresion while configuration_includes_quoted_values is enabled"); + debugs(3, DBG_CRITICAL, "FATAL: Can not read regex expression while configuration_includes_quoted_values is enabled"); self_destruct(); } @@ -488,7 +488,7 @@ assert(wordFile == NULL); debugs(3, 3, "Parsing from " << path); if ((wordFile = fopen(path, "r")) == NULL) { - debugs(3, DBG_CRITICAL, "file :" << path << " not found"); + debugs(3, DBG_CRITICAL, "WARNING: file :" << path << " not found"); return false; }