]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Disable HERE prefix calculation heuristic if it does not work instead of
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 30 Mar 2009 03:11:26 +0000 (21:11 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 30 Mar 2009 03:11:26 +0000 (21:11 -0600)
asserting that the heuristic always works (it does not).

Polished comments.

More work needed to come up with a better heuristic.

src/debug.cc

index bbd9da8c6dadb29bc19be091bc682eab2e825633..2d32598ee2858257bc3772cb091a7b376500c0a1 100644 (file)
@@ -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);
 }