err_type.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_ERR_TYPE_H
10 #define _SQUID_ERR_TYPE_H
11 
12 typedef enum {
14 
15  /* Access Permission Errors. Prefix new with ERR_ACCESS_ */
22 
23  /* TCP Errors. */
31 
32  /* DNS Errors */
35 
36  /* HTTP Errors */
37  ERR_ONLY_IF_CACHED_MISS, /* failure to satisfy only-if-cached request */
40  ERR_UNSUP_HTTPVERSION, /* HTTP version is not supported */
47 
48  /* FTP Errors */
55  ERR_FTP_PUT_CREATED, /* !error,a note that the file was created */
56  ERR_FTP_PUT_MODIFIED, /* modified, !created */
57 
58  /* ESI Errors */
59  ERR_ESI, /* Failure to perform ESI processing */
60 
61  /* ICAP Errors */
63 
64  /* Squid problem */
66 
67  /* Special Cases */
68  ERR_DIR_LISTING, /* Display of remote directory (FTP, Gopher) */
69  ERR_SQUID_SIGNATURE, /* not really an error */
72 
73  // NOTE: error types defined below TCP_RESET are optional and do not generate
74  // a log warning if the files are missing
75  TCP_RESET, // Send TCP RST packet instead of error page
76 
77  ERR_SECURE_ACCEPT_FAIL, // Rejects the SSL connection intead of error page
78  ERR_REQUEST_START_TIMEOUT, // Aborts the connection instead of error page
79  ERR_RELAY_REMOTE, // Sends server reply instead of error page
80 
81  /* Cache Manager GUI can install a manager index/home page */
83 
85 } err_type;
86 
87 extern const char *err_type_str[];
88 
89 inline
91 errorTypeByName(const char *name)
92 {
93  for (int i = 0; i < ERR_MAX; ++i)
94  if (strcmp(name, err_type_str[i]) == 0)
95  return (err_type)i;
96  return ERR_MAX;
97 }
98 
99 inline
100 const char *
102 {
103  if (err < ERR_NONE || err >= ERR_MAX)
104  return "UNKNOWN";
105  return err_type_str[err];
106 }
107 
108 #endif /* _SQUID_ERR_TYPE_H */
109 
int i
Definition: membanger.c:49
const char * err_type_str[]
err_type errorTypeByName(const char *name)
Definition: err_type.h:91
const char * errorTypeName(err_type err)
Definition: err_type.h:101
err_type
Definition: err_type.h:12

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors