mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove legacy protocol version (1.2)
This commit is contained in:
committed by
manojsdoshi
parent
ab9039e77d
commit
2e456a835d
@@ -152,8 +152,7 @@ appropriate HTTP error code (e.g. by sending an HTTP 400 "Bad Request" response)
|
||||
|
||||
Protocol versions are string of the form `XRPL/` followed by a dotted major
|
||||
and minor protocol version number, where the major number is greater than or
|
||||
equal to 2 and the minor is greater than or equal to 0. The legacy version
|
||||
`RTXP/1.2` is also supported at this time and is an alias for `XRPL/2.0`.
|
||||
equal to 2 and the minor is greater than or equal to 0.
|
||||
|
||||
See [RFC 2616 §14.42](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.42)
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ namespace ripple {
|
||||
// clang-format off
|
||||
constexpr ProtocolVersion const supportedProtocolList[]
|
||||
{
|
||||
{1, 2},
|
||||
{2, 0},
|
||||
{2, 1},
|
||||
{2, 2}
|
||||
@@ -73,11 +72,6 @@ static_assert(
|
||||
std::string
|
||||
to_string(ProtocolVersion const& p)
|
||||
{
|
||||
// The legacy protocol uses a different name. This can be removed when we
|
||||
// migrate away from it and require 2.0 or later.
|
||||
if (p == ProtocolVersion{1, 2})
|
||||
return "RTXP/1.2";
|
||||
|
||||
return "XRPL/" + std::to_string(p.first) + "." + std::to_string(p.second);
|
||||
}
|
||||
|
||||
@@ -100,12 +94,6 @@ parseProtocolVersions(boost::beast::string_view const& value)
|
||||
|
||||
for (auto const& s : beast::rfc2616::split_commas(value))
|
||||
{
|
||||
if (s == "RTXP/1.2")
|
||||
{
|
||||
result.push_back(make_protocol(1, 2));
|
||||
continue;
|
||||
}
|
||||
|
||||
boost::smatch m;
|
||||
|
||||
if (boost::regex_match(s, m, re))
|
||||
|
||||
@@ -49,9 +49,8 @@ to_string(ProtocolVersion const& p);
|
||||
/** Parse a set of protocol versions.
|
||||
|
||||
Given a comma-separated string, extract and return all those that look
|
||||
like valid protocol versions (i.e. RTXP/1.2 and XRPL/2.0 and later). Any
|
||||
strings that are not parseable as valid protocol strings are excluded
|
||||
from the result set.
|
||||
like valid protocol versions (i.e. XRPL/2.0 and later). Strings that are
|
||||
not parseable as valid protocol strings are excluded from the result set.
|
||||
|
||||
@return A list of all apparently valid protocol versions.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user