ErrorDetailManager.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2019 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 "SquidString.h"
15 #include "ssl/support.h"
16 
17 #include <map>
18 #include <string>
19 
20 class HttpRequest;
21 
22 namespace Ssl
23 {
24 
26 {
27 public:
32 };
33 
39 {
40 public:
46  bool getRecord(Security::ErrorCode value, ErrorDetailEntry &entry);
47  const char *getErrorDescr(Security::ErrorCode value);
48  const char *getErrorDetail(Security::ErrorCode value);
49 
51  typedef std::map<Security::ErrorCode, ErrorDetailEntry> ErrorDetails;
52  ErrorDetails theList;
53 };
54 
60 {
61 public:
63 
64  static ErrorDetailsManager &GetInstance();
65  static void Shutdown();
66 
76  bool getErrorDetail(Security::ErrorCode value, const HttpRequest::Pointer &request, ErrorDetailEntry &entry);
77  const char *getDefaultErrorDescr(Security::ErrorCode value);
78  const char *getDefaultErrorDetail(Security::ErrorCode value);
79 
80 private:
82  ErrorDetailsList::Pointer getCachedDetails(const char *lang);
84  void cacheDetails(ErrorDetailsList::Pointer &errorDetails);
85 
86  typedef std::map<std::string, ErrorDetailsList::Pointer> Cache;
87  Cache cache;
89 
92 };
93 
95 void errorDetailClean();
96 } //namespace Ssl
97 #endif
98 
std::map< Security::ErrorCode, ErrorDetailEntry > ErrorDetails
String detail
for error page D macro expansion; may contain macros
struct _request * request(char *urlin)
Definition: tcp-banger2.c:291
ErrorDetails theList
The list of error details entries.
String errLanguage
The language of the error-details.txt template, if any.
int ErrorCode
Squid defined error code (<0), an error code returned by X.509 API, or SSL_ERROR_NONE.
Definition: forward.h:91
std::map< std::string, ErrorDetailsList::Pointer > Cache
RefCount< ErrorDetailsList > Pointer
void errorDetailClean()
Security::ErrorCode error_no
The SSL error code.
String descr
short error description (for use in debug messages or error pages)
Definition: Xaction.cc:47
void errorDetailInitialize()
ErrorDetailsList::Pointer theDefaultErrorDetails
the default error details list
Cache cache
the error details list cache
static ErrorDetailsManager * TheDetailsManager
An instance of ErrorDetailsManager to be used by squid (ssl/ErrorDetails.*)
String name
a name for the error

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors