From: Alex Rousskov Date: Mon, 30 Mar 2009 03:11:26 +0000 (-0600) Subject: Disable HERE prefix calculation heuristic if it does not work instead of X-Git-Tag: SQUID_3_2_0_1~1085 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd31e8964e8120b04e24c0567e41a0115699281c;p=thirdparty%2Fsquid.git Disable HERE prefix calculation heuristic if it does not work instead of asserting that the heuristic always works (it does not). Polished comments. More work needed to come up with a better heuristic. --- diff --git a/src/debug.cc b/src/debug.cc index bbd9da8c6d..2d32598ee2 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -751,16 +751,15 @@ std::ostringstream (*Debug::CurrentDebug)(NULL); const size_t BuildPrefixInit() { - - /* Anyone moving the src/Debug.cc file MUST record its new location here, - * or there will be issues in the debugging statements, possibly fatal! - */ - + // XXX: This must be kept in sync with the actual debug.cc location const char *ThisFileNameTail = "src/debug.cc"; - //leave immediately if misconfigured. Unfortunately not possible to detect at build const char *file=__FILE__; - assert(strstr(file,ThisFileNameTail)!=NULL); + + // Disable heuristic if it does not work. + if (!strstr(file, ThisFileNameTail)) + return 0; + return strlen(file)-strlen(ThisFileNameTail); }