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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors