mirror of
https://github.com/matrix-construct/construct
synced 2024-09-28 19:58:53 +02:00
ircd::http: Simplify line ctor; move eoi into grammar.
This commit is contained in:
parent
e70d26b23e
commit
01c2c55054
1 changed files with 2 additions and 10 deletions
12
ircd/http.cc
12
ircd/http.cc
|
@ -765,7 +765,7 @@ namespace ircd::http::parser
|
||||||
decltype(ircd::http::parser::parse_header)
|
decltype(ircd::http::parser::parse_header)
|
||||||
ircd::http::parser::parse_header
|
ircd::http::parser::parse_header
|
||||||
{
|
{
|
||||||
expect[header]
|
eoi | expect[header]
|
||||||
,"header"
|
,"header"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -786,9 +786,6 @@ ircd::http::parser::parse_response
|
||||||
ircd::http::header::header(const line &line)
|
ircd::http::header::header(const line &line)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(line.empty())
|
|
||||||
return;
|
|
||||||
|
|
||||||
const char
|
const char
|
||||||
*start(line.data()),
|
*start(line.data()),
|
||||||
*const stop(line.data() + line.size());
|
*const stop(line.data() + line.size());
|
||||||
|
@ -881,9 +878,8 @@ ircd::http::line::terminator
|
||||||
};
|
};
|
||||||
|
|
||||||
ircd::http::line::line(parse::capstan &pc)
|
ircd::http::line::line(parse::capstan &pc)
|
||||||
:string_view{[&pc]
|
|
||||||
{
|
{
|
||||||
string_view ret;
|
auto &ret(static_cast<string_view &>(*this));
|
||||||
pc([&ret](const char *&start, const char *const &stop)
|
pc([&ret](const char *&start, const char *const &stop)
|
||||||
{
|
{
|
||||||
if(start == stop)
|
if(start == stop)
|
||||||
|
@ -897,10 +893,6 @@ ircd::http::line::line(parse::capstan &pc)
|
||||||
assert(ok);
|
assert(ok);
|
||||||
return ok;
|
return ok;
|
||||||
});
|
});
|
||||||
|
|
||||||
return ret;
|
|
||||||
}()}
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue