ErrorDetailManager.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef _SQUID_SSL_ERRORDETAILMANAGER_H
10#define _SQUID_SSL_ERRORDETAILMANAGER_H
11
12#include "base/RefCount.h"
13#include "HttpRequest.h"
14#include "sbuf/SBuf.h"
15#include "SquidString.h"
16#include "ssl/support.h"
17
18#include <map>
19#include <string>
20
21class HttpRequest;
22
23namespace Ssl
24{
25
27{
28public:
30 ErrorDetailEntry(const SBuf &aName, const HttpHeader &);
31
35};
36
42{
43public:
45
49
51 typedef std::map<Security::ErrorCode, ErrorDetailEntry> ErrorDetails;
53};
54
60{
61public:
63
65 static void Shutdown();
66
74 const ErrorDetailEntry *findDetail(Security::ErrorCode value, const HttpRequest::Pointer &request) const;
75
80
81private:
83 ErrorDetailsList::Pointer getCachedDetails(const char *lang) const;
85 void cacheDetails(const ErrorDetailsList::Pointer &errorDetails) const;
86
87 typedef std::map<std::string, ErrorDetailsList::Pointer> Cache;
88 mutable Cache cache;
90
93};
94
96void errorDetailClean();
97} //namespace Ssl
98#endif
99
#define RefCountable
The locking interface for use on Reference-Counted classes.
Definition: Lock.h:66
Definition: SBuf.h:94
SBuf detail
for error page D macro expansion; may contain macros
SBuf name
a name for the error
SBuf descr
short error description (for use in debug messages or error pages)
ErrorDetailEntry(const SBuf &aName, const HttpHeader &)
extracts quoted detail and descr fields from the given header
RefCount< ErrorDetailsList > Pointer
String errLanguage
The language of the error-details.txt template, if any.
std::map< Security::ErrorCode, ErrorDetailEntry > ErrorDetails
const ErrorDetailEntry * findRecord(Security::ErrorCode) const
ErrorDetails theList
The list of error details entries.
static void Shutdown()
reset the ErrorDetailsManager instance
ErrorDetailsList::Pointer getCachedDetails(const char *lang) const
Return cached error details list for a given language if exist.
const ErrorDetailEntry * findDefaultDetail(Security::ErrorCode) const
Cache cache
the error details list cache
static ErrorDetailsManager * TheDetailsManager
An instance of ErrorDetailsManager to be used by squid (ssl/ErrorDetails.*)
static ErrorDetailsManager & GetInstance()
Instance class.
void cacheDetails(const ErrorDetailsList::Pointer &errorDetails) const
cache the given error details list.
ErrorDetailsList::Pointer theDefaultErrorDetails
the default error details list
const ErrorDetailEntry * findDetail(Security::ErrorCode value, const HttpRequest::Pointer &request) const
std::map< std::string, ErrorDetailsList::Pointer > Cache
int ErrorCode
Squid-defined error code (<0), an error code returned by X.509 API, or zero.
Definition: forward.h:132
Definition: Xaction.cc:40
void errorDetailClean()
void errorDetailInitialize()

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors