Ssl::ErrorDetailsManager::getCachedDetails(const char * const lang) const
{
Cache::iterator it;
- it = cache.find(lang);
+ it = cache.find(SBuf(lang));
if (it != cache.end()) {
debugs(83, 8, "Found template details in cache for language: " << lang);
return it->second;
void
Ssl::ErrorDetailsManager::cacheDetails(const ErrorDetailsList::Pointer &errorDetails) const
{
- const char *lang = errorDetails->errLanguage.termedBuf();
- assert(lang);
+ const auto &lang = errorDetails->errLanguage;
if (cache.find(lang) == cache.end())
cache[lang] = errorDetails;
}
#include "base/RefCount.h"
#include "HttpRequest.h"
#include "sbuf/SBuf.h"
-#include "SquidString.h"
#include "ssl/support.h"
#include <map>
-#include <string>
class HttpRequest;
/// is invalidated by any non-constant operation on the list object
const ErrorDetailEntry *findRecord(Security::ErrorCode) const;
- String errLanguage; ///< The language of the error-details.txt template, if any
+ SBuf errLanguage; ///< The language of the error-details.txt template, if any
typedef std::map<Security::ErrorCode, ErrorDetailEntry> ErrorDetails;
ErrorDetails theList; ///< The list of error details entries
};
/// cache the given error details list.
void cacheDetails(const ErrorDetailsList::Pointer &errorDetails) const;
- typedef std::map<std::string, ErrorDetailsList::Pointer> Cache;
+ using Cache = std::map<SBuf, ErrorDetailsList::Pointer>;
mutable Cache cache; ///< the error details list cache
ErrorDetailsList::Pointer theDefaultErrorDetails; ///< the default error details list