From: Amos Jeffries Date: Mon, 21 May 2012 02:53:31 +0000 (-0600) Subject: Register RFC 6585 status codes X-Git-Tag: BumpSslServerFirst.take09~3^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e85b99812235188bd1db62031f1619e7d96b27b4;p=thirdparty%2Fsquid.git Register RFC 6585 status codes --- diff --git a/src/HttpStatusCode.h b/src/HttpStatusCode.h index 7ce73526b8..edb66b4c9a 100644 --- a/src/HttpStatusCode.h +++ b/src/HttpStatusCode.h @@ -46,6 +46,9 @@ typedef enum { HTTP_UNPROCESSABLE_ENTITY = 422, /**< RFC2518 section 10.3 */ HTTP_LOCKED = 423, /**< RFC2518 section 10.4 */ HTTP_FAILED_DEPENDENCY = 424, /**< RFC2518 section 10.5 */ + HTTP_PRECONDITION_REQUIRED = 428, /**< RFC6585 */ + HTTP_TOO_MANY_REQUESTS = 429, /**< RFC6585 */ + HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431, /**< RFC6585 */ HTTP_INTERNAL_SERVER_ERROR = 500, HTTP_NOT_IMPLEMENTED = 501, HTTP_BAD_GATEWAY = 502, @@ -53,6 +56,7 @@ typedef enum { HTTP_GATEWAY_TIMEOUT = 504, HTTP_HTTP_VERSION_NOT_SUPPORTED = 505, HTTP_INSUFFICIENT_STORAGE = 507, /**< RFC2518 section 10.6 */ + HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511, /**< RFC6585 */ // The 6xx codes below are for internal use only: Bad requests result // in HTTP_BAD_REQUEST; bad responses in HTTP_GATEWAY_TIMEOUT. diff --git a/src/HttpStatusLine.cc b/src/HttpStatusLine.cc index 67dc2f3cfc..5f6676fdd0 100644 --- a/src/HttpStatusLine.cc +++ b/src/HttpStatusLine.cc @@ -320,6 +320,23 @@ httpStatusString(http_status status) p = "HTTP Version not supported"; break; + // RFC 6585 + case HTTP_PRECONDITION_REQUIRED: // 428 + p = "Precondition Required"; + break; + + case HTTP_TOO_MANY_REQUESTS: // 429 + p = "Too Many Requests"; + break; + + case HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE: // 431 + p = "Request Header Fields Too Large"; + break; + + case HTTP_NETWORK_AUTHENTICATION_REQUIRED: // 511 + p = "Network Authentication Required"; + break; + default: p = "Unknown"; debugs(57, 3, "Unknown HTTP status code: " << status);