diff --git a/include/ircd/rfc3986.h b/include/ircd/rfc3986.h index fa855c8d0..200e719ed 100644 --- a/include/ircd/rfc3986.h +++ b/include/ircd/rfc3986.h @@ -146,6 +146,8 @@ namespace ircd::rfc3986::parser extern const rule<> absolute_uri; extern const rule<> uri; extern const rule<> uri_ref; // uri | relative_ref + + extern const rule uri_parse; } #pragma GCC visibility pop diff --git a/ircd/rfc3986.cc b/ircd/rfc3986.cc index 019b59386..df1d4cd71 100644 --- a/ircd/rfc3986.cc +++ b/ircd/rfc3986.cc @@ -398,20 +398,24 @@ BOOST_FUSION_ADAPT_STRUCT ) #pragma GCC visibility pop -ircd::rfc3986::uri::uri(const string_view &input) +decltype(ircd::rfc3986::parser::uri_parse) +ircd::rfc3986::parser::uri_parse { - static const parser::rule rule - { + expect + [ raw[parser::scheme] >> lit("://") >> -raw[parser::userinfo >> lit('@')] >> raw[parser::remote] >> raw[parser::path_abempty] >> -raw[lit('?') >> parser::query] >> -raw[lit('#') >> parser::fragment] - }; + ] +}; +ircd::rfc3986::uri::uri(const string_view &input) +{ const char *start(begin(input)), *const stop(end(input)); - qi::parse(start, stop, eps > rule, *this); + ircd::parse(start, stop, parser::uri_parse, *this); //TODO: XXX Can this go? this->user = rstrip(this->user, '@');