mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Always use HTTP handshaking in overlay:
Inbound and outbound peer connections always use HTTP handshakes to negotiate connections, instead of the deprecated TMHello protocol message. rippled versions 0.27.0 and later support both optional HTTP handshakes and legacy TMHello messages, so always using HTTP handshakes should not cause disruption. However, versions before 0.27.0 will no longer be able to participate in the overlay network - support for handshaking via the TMHello message is removed.
This commit is contained in:
committed by
Tom Ritchford
parent
e43ffa6f2b
commit
f56e37398c
@@ -27,6 +27,7 @@
|
||||
#include <beast/crypto/base64.h>
|
||||
#include <beast/http/rfc2616.h>
|
||||
#include <beast/module/core/text/LexicalCast.h>
|
||||
#include <beast/utility/static_initializer.h>
|
||||
#include <boost/regex.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -170,7 +171,7 @@ appendHello (beast::http::message& m,
|
||||
std::vector<ProtocolVersion>
|
||||
parse_ProtocolVersions (std::string const& s)
|
||||
{
|
||||
static boost::regex const re (
|
||||
static beast::static_initializer<boost::regex> re (
|
||||
"^" // start of line
|
||||
"RTXP/" // the string "RTXP/"
|
||||
"([1-9][0-9]*)" // a number (non-zero and with no leading zeroes)
|
||||
@@ -184,7 +185,7 @@ parse_ProtocolVersions (std::string const& s)
|
||||
for (auto const& s : list)
|
||||
{
|
||||
boost::smatch m;
|
||||
if (! boost::regex_match (s, m, re))
|
||||
if (! boost::regex_match (s, m, *re))
|
||||
continue;
|
||||
int major;
|
||||
int minor;
|
||||
|
||||
Reference in New Issue
Block a user