From 5da82c7e9328878641a98ffd2e3dd02e71a9e376 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 20 May 2018 17:37:50 -0700 Subject: [PATCH] ircd::http: Minor cleanup: move the code enum. --- include/ircd/http.h | 102 ++++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/include/ircd/http.h b/include/ircd/http.h index 637b3a49e..1ac425019 100644 --- a/include/ircd/http.h +++ b/include/ircd/http.h @@ -36,56 +36,6 @@ namespace ircd::http const_buffer writechunk(const mutable_buffer &, const uint32_t &size); } -// -// Add more as you go... -// -enum ircd::http::code -:ushort -{ - CONTINUE = 100, - SWITCHING_PROTOCOLS = 101, - - OK = 200, - CREATED = 201, - ACCEPTED = 202, - NON_AUTHORITATIVE_INFORMATION = 203, - NO_CONTENT = 204, - PARTIAL_CONTENT = 206, - - MULTIPLE_CHOICES = 300, - MOVED_PERMANENTLY = 301, - FOUND = 302, - SEE_OTHER = 303, - NOT_MODIFIED = 304, - TEMPORARY_REDIRECT = 305, - PERMANENT_REDIRECT = 306, - - BAD_REQUEST = 400, - UNAUTHORIZED = 401, - FORBIDDEN = 403, - NOT_FOUND = 404, - METHOD_NOT_ALLOWED = 405, - NOT_ACCEPTABLE = 406, - REQUEST_TIMEOUT = 408, - CONFLICT = 409, - LENGTH_REQUIRED = 411, - PAYLOAD_TOO_LARGE = 413, - REQUEST_URI_TOO_LONG = 414, - UNSUPPORTED_MEDIA_TYPE = 415, - EXPECTATION_FAILED = 417, - IM_A_TEAPOT = 418, - UNPROCESSABLE_ENTITY = 422, - TOO_MANY_REQUESTS = 429, - REQUEST_HEADER_FIELDS_TOO_LARGE = 431, - - INTERNAL_SERVER_ERROR = 500, - NOT_IMPLEMENTED = 501, - BAD_GATEWAY = 502, - SERVICE_UNAVAILABLE = 503, - HTTP_VERSION_NOT_SUPPORTED = 505, - INSUFFICIENT_STORAGE = 507, -}; - /// Root exception for HTTP. struct ircd::http::error :ircd::error @@ -273,7 +223,7 @@ struct ircd::http::response // compose a response into buffer response(window_buffer &, - const code & = code::OK, + const code &, const size_t &content_length = 0, const string_view &content_type = {}, const string_view &headers = {}, @@ -308,6 +258,56 @@ struct ircd::http::response::chunk chunk() = default; }; +// +// Add more as you go... +// +enum ircd::http::code +:ushort +{ + CONTINUE = 100, + SWITCHING_PROTOCOLS = 101, + + OK = 200, + CREATED = 201, + ACCEPTED = 202, + NON_AUTHORITATIVE_INFORMATION = 203, + NO_CONTENT = 204, + PARTIAL_CONTENT = 206, + + MULTIPLE_CHOICES = 300, + MOVED_PERMANENTLY = 301, + FOUND = 302, + SEE_OTHER = 303, + NOT_MODIFIED = 304, + TEMPORARY_REDIRECT = 305, + PERMANENT_REDIRECT = 306, + + BAD_REQUEST = 400, + UNAUTHORIZED = 401, + FORBIDDEN = 403, + NOT_FOUND = 404, + METHOD_NOT_ALLOWED = 405, + NOT_ACCEPTABLE = 406, + REQUEST_TIMEOUT = 408, + CONFLICT = 409, + LENGTH_REQUIRED = 411, + PAYLOAD_TOO_LARGE = 413, + REQUEST_URI_TOO_LONG = 414, + UNSUPPORTED_MEDIA_TYPE = 415, + EXPECTATION_FAILED = 417, + IM_A_TEAPOT = 418, + UNPROCESSABLE_ENTITY = 422, + TOO_MANY_REQUESTS = 429, + REQUEST_HEADER_FIELDS_TOO_LARGE = 431, + + INTERNAL_SERVER_ERROR = 500, + NOT_IMPLEMENTED = 501, + BAD_GATEWAY = 502, + SERVICE_UNAVAILABLE = 503, + HTTP_VERSION_NOT_SUPPORTED = 505, + INSUFFICIENT_STORAGE = 507, +}; + template T ircd::http::query::string::get(const string_view &key,