]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Hack to resolve crash on shutdown from global String(",null,")
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 26 Jul 2009 11:15:35 +0000 (23:15 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 26 Jul 2009 11:15:35 +0000 (23:15 +1200)
Not even close to the best solution. But it will get us a running
3.1 release which we need right about now.

configure.in
src/String.cc
src/adaptation/History.cc

index fe160274adb7ca56cf3cdb35495f001b125dd7ee..e4610e8988cbb7ffa10bae5bd5166ce84fc6968d 100644 (file)
@@ -34,7 +34,7 @@ new_configure_args="$ac_configure_args --with-squid=$ac_abs_confdir"
 ac_configure_args="$new_configure_args"
 
 
-use_loadable_modules=1
+use_loadable_modules=0
 AC_MSG_CHECKING(whether to use loadable modules)
 AC_ARG_ENABLE(loadable-modules,
     AC_HELP_STRING( [--disable-loadable-modules], [do not support loadable modules]) ,
@@ -51,6 +51,7 @@ AC_ARG_ENABLE(loadable-modules,
         AC_MSG_RESULT([$use_loadable_modules, implicitly])
     ]
 )
+use_loadable_modules=0
 
 AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes)
 
index 9fc2ad80a463a445406b05b8ddddf469e5db878f..40eae2c59e644b40278cdc9bbd4f15a8b1743ed5 100644 (file)
@@ -150,6 +150,7 @@ String::clean()
     PROF_start(StringClean);
     assert(this);
 
+    /* TODO if mempools has already closed this will FAIL!! */
     if (defined())
         memFreeString(size_, buf_);
 
index c8775c5cdfe514270b4571374e5257f9f6890290..e7598dd4cddf2d20314cb045b68dfef08c8a52fc 100644 (file)
@@ -7,7 +7,7 @@
 #include "adaptation/History.h"
 
 /// impossible services value to identify unset theNextServices
-const static String TheNullServices(",null,");
+const static char *TheNullServices = ",null,";
 
 Adaptation::History::Entry::Entry(const String &sid, const timeval &when):
     service(sid), start(when), theRptm(-1), retried(false)
@@ -33,7 +33,7 @@ int Adaptation::History::Entry::rptm()
 }
 
 
-Adaptation::History::History(): theNextServices(TheNullServices) {
+Adaptation::History::History(): theNextServices(String(TheNullServices)) {
 }
 
 int Adaptation::History::recordXactStart(const String &sid, const timeval &when, bool retrying)
@@ -120,19 +120,19 @@ bool Adaptation::History::getXxRecord(String &name, String &value) const
 
 void Adaptation::History::updateNextServices(const String &services)
 {
-    if (theNextServices != TheNullServices)
+    if (theNextServices != String(TheNullServices))
        debugs(93,3, HERE << "old services: " << theNextServices);
     debugs(93,3, HERE << "new services: " << services);
-    Must(services != TheNullServices);
+    Must(services != String(TheNullServices));
     theNextServices = services;
 }
 
 bool Adaptation::History::extractNextServices(String &value)
 {
-    if (theNextServices == TheNullServices)
+    if (theNextServices == String(TheNullServices))
        return false;
 
     value = theNextServices;
-    theNextServices = TheNullServices; // prevents resetting the plan twice
+    theNextServices = String(TheNullServices); // prevents resetting the plan twice
     return true;
 }