0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::http: Fix enum decl related and struct packing of error.

This commit is contained in:
Jason Volk 2018-03-05 00:37:05 -08:00
parent 96eca6c744
commit cc7dd13e4e
2 changed files with 9 additions and 9 deletions

View file

@ -24,8 +24,8 @@ namespace ircd::http
struct request;
struct response;
string_view status(const enum code &);
enum code status(const string_view &);
string_view status(const code &);
code status(const string_view &);
void writeline(window_buffer &);
void writeline(window_buffer &, const window_buffer::closure &);
@ -87,12 +87,12 @@ enum ircd::http::code
struct ircd::http::error
:ircd::error
{
enum code code;
std::string content;
std::string headers;
http::code code;
error(const enum code &, std::string content = {}, std::string headers = {});
error(const enum code &, std::string content, const vector_view<const header> &);
error(const http::code &, std::string content = {}, std::string headers = {});
error(const http::code &, std::string content, const vector_view<const header> &);
};
/// Represents a single \r\n delimited line used in HTTP.

View file

@ -853,23 +853,23 @@ ircd::http::throw_error(const qi::expectation_failure<const char *> &e)
};
}
ircd::http::error::error(const enum code &code,
ircd::http::error::error(const http::code &code,
std::string content,
const vector_view<const header> &headers)
:error
:http::error
{
code, std::move(content), strung(headers)
}
{
}
ircd::http::error::error(const enum code &code,
ircd::http::error::error(const http::code &code,
std::string content,
std::string headers)
:ircd::error{generate_skip}
,code{code}
,content{std::move(content)}
,headers{std::move(headers)}
,code{code}
{
snprintf(buf, sizeof(buf), "%d %s", int(code), status(code).c_str());
}