StatusCode.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2020 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_SRC_HTTP_STATUSCODE_H
10 #define _SQUID_SRC_HTTP_STATUSCODE_H
11 
12 namespace Http
13 {
14 
20 typedef enum {
21  scNone = 0,
22  scContinue = 100,
24  scProcessing = 102,
25  scEarlyHints = 103,
26  scOkay = 200,
27  scCreated = 201,
28  scAccepted = 202,
30  scNoContent = 204,
33  scMultiStatus = 207,
35  scImUsed = 226,
38  scFound = 302,
39  scSeeOther = 303,
41  scUseProxy = 305,
44  scBadRequest = 400,
47  scForbidden = 403,
48  scNotFound = 404,
53  scConflict = 409,
54  scGone = 410,
58  scUriTooLong = 414,
64  scLocked = 423,
73  scBadGateway = 502,
80  scNotExtended = 510,
83  // The 6xx codes below are for internal use only: Bad requests result
84  // in scBadRequest; bad responses in scGatewayTimeout.
85 
87  scHeaderTooLarge = 601 /* Header too large to process */
88 } StatusCode;
89 
90 const char *StatusCodeString(const Http::StatusCode status);
92 inline bool Is1xx(const int sc) { return scContinue <= sc && sc < scOkay; }
94 inline bool ProhibitsContentLength(const StatusCode sc) { return sc == scNoContent || Is1xx(sc); }
95 
96 } // namespace Http
97 
98 #endif /* _SQUID_SRC_HTTP_STATUSCODE_H */
99 
@ scNetworkAuthenticationRequired
Definition: StatusCode.h:81
@ scMethodNotAllowed
Definition: StatusCode.h:49
@ scAccepted
Definition: StatusCode.h:28
@ scNonAuthoritativeInformation
Definition: StatusCode.h:29
@ scUnauthorized
Definition: StatusCode.h:45
@ scPayloadTooLarge
Definition: StatusCode.h:57
@ scProcessing
Definition: StatusCode.h:24
@ scImUsed
Definition: StatusCode.h:35
@ scBadRequest
Definition: StatusCode.h:44
@ scNone
Definition: StatusCode.h:21
@ scResetContent
Definition: StatusCode.h:31
@ scMisdirectedRequest
Definition: StatusCode.h:62
const char * StatusCodeString(const Http::StatusCode status)
Definition: StatusCode.cc:14
@ scLengthRequired
Definition: StatusCode.h:55
@ scUnsupportedMediaType
Definition: StatusCode.h:59
@ scUseProxy
Definition: StatusCode.h:41
@ scVariantAlsoNegotiates
Definition: StatusCode.h:77
@ scMovedPermanently
Definition: StatusCode.h:37
StatusCode
Definition: StatusCode.h:20
Definition: forward.h:21
@ scRequestedRangeNotSatisfied
Definition: StatusCode.h:60
bool Is1xx(const int sc)
whether this is an informational 1xx response status code
Definition: StatusCode.h:92
@ scSeeOther
Definition: StatusCode.h:39
@ scNotAcceptable
Definition: StatusCode.h:50
@ scGatewayTimeout
Definition: StatusCode.h:75
@ scTemporaryRedirect
Definition: StatusCode.h:42
@ scFailedDependency
Definition: StatusCode.h:65
@ scSwitchingProtocols
Definition: StatusCode.h:23
@ scForbidden
Definition: StatusCode.h:47
@ scInsufficientStorage
Definition: StatusCode.h:78
@ scNotImplemented
Definition: StatusCode.h:72
@ scPreconditionFailed
Definition: StatusCode.h:56
@ scTooManyRequests
Definition: StatusCode.h:68
@ scBadGateway
Definition: StatusCode.h:73
@ scPartialContent
Definition: StatusCode.h:32
@ scGone
Definition: StatusCode.h:54
@ scLoopDetected
Definition: StatusCode.h:79
@ scUnavailableForLegalReasons
Definition: StatusCode.h:70
@ scUnprocessableEntity
Definition: StatusCode.h:63
@ scCreated
Definition: StatusCode.h:27
@ scPermanentRedirect
Definition: StatusCode.h:43
@ scRequestHeaderFieldsTooLarge
Definition: StatusCode.h:69
@ scUriTooLong
Definition: StatusCode.h:58
@ scContinue
Definition: StatusCode.h:22
@ scServiceUnavailable
Definition: StatusCode.h:74
@ scInternalServerError
Definition: StatusCode.h:71
static int sc[16]
Definition: smbdes.c:121
@ scNotModified
Definition: StatusCode.h:40
@ scUpgradeRequired
Definition: StatusCode.h:66
@ scHttpVersionNotSupported
Definition: StatusCode.h:76
@ scFound
Definition: StatusCode.h:38
@ scRequestTimeout
Definition: StatusCode.h:52
@ scEarlyHints
Definition: StatusCode.h:25
@ scNotFound
Definition: StatusCode.h:48
@ scNotExtended
Definition: StatusCode.h:80
@ scPreconditionRequired
Definition: StatusCode.h:67
bool ProhibitsContentLength(const StatusCode sc)
whether this response status code prohibits sending Content-Length
Definition: StatusCode.h:94
@ scNoContent
Definition: StatusCode.h:30
@ scProxyAuthenticationRequired
Definition: StatusCode.h:51
@ scInvalidHeader
Definition: StatusCode.h:86
@ scPaymentRequired
Definition: StatusCode.h:46
@ scLocked
Definition: StatusCode.h:64
@ scConflict
Definition: StatusCode.h:53
@ scMultiStatus
Definition: StatusCode.h:33
@ scMultipleChoices
Definition: StatusCode.h:36
@ scOkay
Definition: StatusCode.h:26
@ scHeaderTooLarge
Definition: StatusCode.h:87
@ scAlreadyReported
Definition: StatusCode.h:34
@ scExpectationFailed
Definition: StatusCode.h:61

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors