]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Hacked in delayed initialization of constants, to avoid asserts in mempools at shutdo...
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 10 Feb 2009 09:17:18 +0000 (10:17 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 10 Feb 2009 09:17:18 +0000 (10:17 +0100)
src/ftp.cc
src/store_log.cc

index 096278205f492198ca83df109d842b0effa2577f..dfccaf3e6330a819495664888bdaed12c6bdec26 100644 (file)
@@ -1445,13 +1445,16 @@ FtpStateData::checkAuth(const HttpHeader * req_hdr)
     return 0;                  /* different username */
 }
 
-static const String str_type_eq("type=");
+static String str_type_eq;
 void
 FtpStateData::checkUrlpath()
 {
     int l;
     size_t t;
 
+    if (str_type_eq.undefined()) //hack. String doesn't support global-static
+        str_type_eq="type=";
+
     if ((t = request->urlpath.rfind(';')) != std::string::npos) {
         if (request->urlpath.substr(t+1,t+1+str_type_eq.size())==str_type_eq) {
             typecode = (char)xtoupper(request->urlpath[t+str_type_eq.size()+1]);
index 9003443206881fbacdd968a47c4989fd97e5cd1e..ee346801782b0c943ea6e1c23f1410d04e06a33f 100644 (file)
@@ -52,7 +52,7 @@ static OBJH storeLogTagsHist;
 
 static Logfile *storelog = NULL;
 
-static const String str_unknown="unknown";
+static String str_unknown;
 
 void
 storeLog(int tag, const StoreEntry * e)
@@ -60,6 +60,9 @@ storeLog(int tag, const StoreEntry * e)
     MemObject *mem = e->mem_obj;
     HttpReply const *reply;
 
+    if (str_unknown.undefined())
+        str_unknown="unknown"; //hack. Delay initialization as string doesn't support global variables..
+
     if (NULL == storelog)
         return;