From: Francesco Chemolli Date: Tue, 10 Feb 2009 09:17:18 +0000 (+0100) Subject: Hacked in delayed initialization of constants, to avoid asserts in mempools at shutdo... X-Git-Tag: SQUID_3_2_0_1~1189^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=811d914ca92d224fe1634a0819de5ee4a1f476da;p=thirdparty%2Fsquid.git Hacked in delayed initialization of constants, to avoid asserts in mempools at shutdown time. --- diff --git a/src/ftp.cc b/src/ftp.cc index 096278205f..dfccaf3e63 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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]); diff --git a/src/store_log.cc b/src/store_log.cc index 9003443206..ee34680178 100644 --- a/src/store_log.cc +++ b/src/store_log.cc @@ -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;