From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Thu, 2 Nov 2023 23:24:56 +0000 (+0000) Subject: Use SBuf instead of SquidString in MemObject (#1558) X-Git-Tag: SQUID_7_0_1~298 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=709274c6e9d513696fcc165cd695e17184155c14;p=thirdparty%2Fsquid.git Use SBuf instead of SquidString in MemObject (#1558) --- diff --git a/src/MemObject.cc b/src/MemObject.cc index d8f6687fe7..6e6f301e16 100644 --- a/src/MemObject.cc +++ b/src/MemObject.cc @@ -52,24 +52,24 @@ MemObject::inUseCount() const char * MemObject::storeId() const { - if (!storeId_.size()) { + if (storeId_.isEmpty()) { debugs(20, DBG_IMPORTANT, "ERROR: Squid BUG: Missing MemObject::storeId value"); dump(); storeId_ = "[unknown_URI]"; } - return storeId_.termedBuf(); + return storeId_.c_str(); } const char * MemObject::logUri() const { - return logUri_.size() ? logUri_.termedBuf() : storeId(); + return logUri_.isEmpty() ? storeId() : logUri_.c_str(); } bool MemObject::hasUris() const { - return storeId_.size(); + return !storeId_.isEmpty(); } void @@ -83,7 +83,7 @@ MemObject::setUris(char const *aStoreId, char const *aLogUri, const HttpRequestM // fast pointer comparison for a common storeCreateEntry(url,url,...) case if (!aLogUri || aLogUri == aStoreId) - logUri_.clean(); // use storeId_ by default to minimize copying + logUri_.clear(); // use storeId_ by default to minimize copying else logUri_ = aLogUri; diff --git a/src/MemObject.h b/src/MemObject.h index 1e842d2b2b..5e90a4734a 100644 --- a/src/MemObject.h +++ b/src/MemObject.h @@ -14,7 +14,7 @@ #include "http/RequestMethod.h" #include "HttpReply.h" #include "RemovalPolicy.h" -#include "SquidString.h" +#include "sbuf/SBuf.h" #include "stmem.h" #include "store/forward.h" #include "StoreIOBuffer.h" @@ -234,8 +234,8 @@ private: HttpReplyPointer reply_; ///< \see baseReply() HttpReplyPointer updatedReply_; ///< \see updatedReply() - mutable String storeId_; ///< StoreId for our entry (usually request URI) - mutable String logUri_; ///< URI used for logging (usually request URI) + mutable SBuf storeId_; ///< StoreId for our entry (usually request URI) + mutable SBuf logUri_; ///< URI used for logging (usually request URI) DelayedAsyncCalls deferredReads; };