mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-04 19:25:51 +00:00
Move MultiSocket, RippleSSLContext to common module
This commit is contained in:
@@ -34,12 +34,24 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\MultiSocket.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\ResolverAsio.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\RippleSSLContext.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\TaggedCache.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1763,12 +1775,6 @@
|
||||
<ClCompile Include="..\..\src\ripple_data\ripple_data.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_hyperleveldb\ripple_hyperleveldb.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_leveldb\ripple_leveldb.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\RippleSSLContext.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\HTTPRequest.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1781,12 +1787,6 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\MultiSocket.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\RPCDoor.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -2232,9 +2232,12 @@
|
||||
<ClInclude Include="..\..\src\ripple\algorithm\api\DecayingSample.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\byte_view.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\counted_bind.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\impl\MultiSocketType.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\KeyCache.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\MultiSocket.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\Resolver.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\ResolverAsio.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\RippleSSLContext.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\seconds_clock.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\TaggedCache.h" />
|
||||
<ClInclude Include="..\..\src\ripple\http\api\Handler.h" />
|
||||
@@ -2635,12 +2638,9 @@
|
||||
<ClInclude Include="..\..\src\ripple_data\utility\UptimeTimerAdapter.h" />
|
||||
<ClInclude Include="..\..\src\ripple_hyperleveldb\ripple_hyperleveldb.h" />
|
||||
<ClInclude Include="..\..\src\ripple_leveldb\ripple_leveldb.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\impl\MultiSocketType.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\impl\RPCServerImp.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\RippleSSLContext.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\HTTPRequest.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\HTTPClient.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\MultiSocket.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\RPCDoor.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\RPCServer.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\SNTPClient.h" />
|
||||
|
||||
@@ -765,18 +765,12 @@
|
||||
<ClCompile Include="..\..\src\ripple_data\protocol\BuildInfo.cpp">
|
||||
<Filter>[2] Old Ripple\ripple_data\protocol</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\RippleSSLContext.cpp">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\HTTPRequest.cpp">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\HTTPClient.cpp">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\MultiSocket.cpp">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\SNTPClient.cpp">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClCompile>
|
||||
@@ -1494,6 +1488,12 @@
|
||||
<ClCompile Include="..\..\src\ripple_app\transactors\WalletAddTransactor.cpp">
|
||||
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\MultiSocket.cpp">
|
||||
<Filter>[1] Ripple\common\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\common\impl\RippleSSLContext.cpp">
|
||||
<Filter>[1] Ripple\common\impl</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\ripple_basics\containers\RangeSet.h">
|
||||
@@ -1997,27 +1997,18 @@
|
||||
<ClInclude Include="..\..\src\ripple_data\protocol\BuildInfo.h">
|
||||
<Filter>[2] Old Ripple\ripple_data\protocol</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\RippleSSLContext.h">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\HTTPRequest.h">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\HTTPClient.h">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\MultiSocket.h">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\RPCServer.h">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\SNTPClient.h">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\impl\MultiSocketType.h">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\RPCDoor.h">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClInclude>
|
||||
@@ -3048,6 +3039,16 @@
|
||||
<ClInclude Include="..\..\src\ripple_app\transactors\WalletAddTransactor.h">
|
||||
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\BeastConfig\BeastConfig.h" />
|
||||
<ClInclude Include="..\..\src\ripple\common\impl\MultiSocketType.h">
|
||||
<Filter>[1] Ripple\common\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\common\MultiSocket.h">
|
||||
<Filter>[1] Ripple\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\common\RippleSSLContext.h">
|
||||
<Filter>[1] Ripple\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\common\byte_view.h">
|
||||
<Filter>[1] Ripple\common</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -22,9 +22,6 @@ David Features:
|
||||
|
||||
- std::priority_queue for DeadlineTimer
|
||||
|
||||
- Change ProxyInfo to use IP::Endpoint, get rid of IPv4Address from the parsing
|
||||
code
|
||||
|
||||
- Validators should delay the application of newly downloaded lists from
|
||||
sources, to mitigate the effects of attacks. Unless there's no validators
|
||||
in the list.
|
||||
|
||||
@@ -17,12 +17,15 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_NET_BASICS_MULTISOCKET_H_INCLUDED
|
||||
#define RIPPLE_NET_BASICS_MULTISOCKET_H_INCLUDED
|
||||
#ifndef RIPPLE_COMMON_MULTISOCKET_H_INCLUDED
|
||||
#define RIPPLE_COMMON_MULTISOCKET_H_INCLUDED
|
||||
|
||||
/** A Socket that can handshake with multiple protocols.
|
||||
*/
|
||||
class MultiSocket : public Socket
|
||||
#include "../beast/modules/beast_asio/beast_asio.h"
|
||||
|
||||
namespace ripple {
|
||||
|
||||
/** A Socket that can handshake with multiple protocols. */
|
||||
class MultiSocket : public beast::Socket
|
||||
{
|
||||
public:
|
||||
// immutable flags
|
||||
@@ -98,13 +101,13 @@ public:
|
||||
server_proxy = 8
|
||||
};
|
||||
|
||||
typedef HandshakeDetectLogicPROXY::ProxyInfo ProxyInfo;
|
||||
typedef beast::HandshakeDetectLogicPROXY::ProxyInfo ProxyInfo;
|
||||
|
||||
// Note that this returns the original flags
|
||||
virtual Flag getFlags () = 0;
|
||||
|
||||
virtual IP::Endpoint local_endpoint() = 0;
|
||||
virtual IP::Endpoint remote_endpoint() = 0;
|
||||
virtual beast::IP::Endpoint local_endpoint() = 0;
|
||||
virtual beast::IP::Endpoint remote_endpoint() = 0;
|
||||
virtual ProxyInfo getProxyInfo () = 0;
|
||||
|
||||
/** Returns a pointer to the SSL handle or nullptr if no SSL. */
|
||||
@@ -123,4 +126,6 @@ public:
|
||||
int flags = 0);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -17,8 +17,14 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_NET_BASICS_RIPPLESSLCONTEXT_H_INCLUDED
|
||||
#define RIPPLE_NET_BASICS_RIPPLESSLCONTEXT_H_INCLUDED
|
||||
#ifndef RIPPLE_COMMON_SSLCONTEXT_H_INCLUDED
|
||||
#define RIPPLE_COMMON_SSLCONTEXT_H_INCLUDED
|
||||
|
||||
#include "../beast/modules/beast_asio/beast_asio.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
/** The SSL contexts used by Ripple.
|
||||
|
||||
@@ -27,7 +33,7 @@
|
||||
sslv23, Transport Layer Security / General. This is primarily used for peer to peer servers that don't care
|
||||
about certificates or identity verification.
|
||||
*/
|
||||
class RippleSSLContext : public SSLContext
|
||||
class RippleSSLContext : public beast::SSLContext
|
||||
{
|
||||
public:
|
||||
/** Retrieve raw DH parameters.
|
||||
@@ -52,7 +58,7 @@ public:
|
||||
No certificates are required. Peers use this context.
|
||||
If the cipher list is invalid, a fatal error is raised.
|
||||
*/
|
||||
static RippleSSLContext* createAnonymous (String const& cipherList);
|
||||
static RippleSSLContext* createAnonymous (std::string const& cipherList);
|
||||
|
||||
/** Create a context with authentication requirements.
|
||||
This is used for WebSocket connections.
|
||||
@@ -66,4 +72,6 @@ protected:
|
||||
explicit RippleSSLContext (ContextType& context);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -17,6 +17,12 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "MultiSocketType.h"
|
||||
|
||||
#include "../RippleSSLContext.h"
|
||||
|
||||
namespace ripple {
|
||||
|
||||
MultiSocket* MultiSocket::New (
|
||||
boost::asio::ip::tcp::socket& socket,
|
||||
boost::asio::ssl::context& ssl_context,
|
||||
@@ -39,10 +45,10 @@ MultiSocket* MultiSocket::New (
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class MultiSocketTests : public UnitTest
|
||||
class MultiSocketTests : public beast::UnitTest
|
||||
{
|
||||
public:
|
||||
class MultiSocketDetails : public TestPeerDetails
|
||||
class MultiSocketDetails : public beast::TestPeerDetails
|
||||
{
|
||||
public:
|
||||
typedef int arg_type;
|
||||
@@ -52,9 +58,9 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static String getArgName (arg_type arg)
|
||||
static beast::String getArgName (arg_type arg)
|
||||
{
|
||||
String s;
|
||||
beast::String s;
|
||||
|
||||
if (arg & MultiSocket::Flag::client_role)
|
||||
s << "client,";
|
||||
@@ -71,7 +77,7 @@ public:
|
||||
if (arg & MultiSocket::Flag::proxy)
|
||||
s << "proxy,";
|
||||
|
||||
if (s != String::empty)
|
||||
if (s != beast::String::empty)
|
||||
{
|
||||
s = "(" + s.substring (0, s.length () - 1) + ")";
|
||||
}
|
||||
@@ -92,7 +98,7 @@ public:
|
||||
boost::asio::ssl::verify_none);
|
||||
}
|
||||
|
||||
ScopedPointer <RippleSSLContext> context;
|
||||
std::unique_ptr <RippleSSLContext> context;
|
||||
};
|
||||
|
||||
static ContextHolder holder;
|
||||
@@ -100,7 +106,7 @@ public:
|
||||
return holder.context->get ();
|
||||
}
|
||||
|
||||
String name () const
|
||||
beast::String name () const
|
||||
{
|
||||
return getArgName (m_flags);
|
||||
}
|
||||
@@ -139,12 +145,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
Socket& get_socket ()
|
||||
beast::Socket& get_socket ()
|
||||
{
|
||||
return m_multiSocket;
|
||||
}
|
||||
|
||||
Socket& get_acceptor ()
|
||||
beast::Socket& get_acceptor ()
|
||||
{
|
||||
return m_acceptor_wrapper;
|
||||
}
|
||||
@@ -159,9 +165,9 @@ public:
|
||||
return m_acceptor;
|
||||
}
|
||||
|
||||
endpoint_type get_endpoint (PeerRole role)
|
||||
endpoint_type get_endpoint (beast::PeerRole role)
|
||||
{
|
||||
if (role == PeerRole::server)
|
||||
if (role == beast::PeerRole::server)
|
||||
return endpoint_type (boost::asio::ip::tcp::v6 (), 1052);
|
||||
else
|
||||
return endpoint_type (boost::asio::ip::address_v6 ().from_string ("::1"), 1052);
|
||||
@@ -171,7 +177,7 @@ public:
|
||||
socket_type m_socket;
|
||||
acceptor_type m_acceptor;
|
||||
MultiSocketType <socket_type&> m_multiSocket;
|
||||
SocketWrapper <acceptor_type&> m_acceptor_wrapper;
|
||||
beast::SocketWrapper <acceptor_type&> m_acceptor_wrapper;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -288,3 +294,4 @@ public:
|
||||
|
||||
static MultiSocketTests multiSocketTests;
|
||||
|
||||
}
|
||||
@@ -17,11 +17,16 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_NET_BASICS_IMPOL_MULTISOCKETTYPE_H_INCLUDED
|
||||
#define RIPPLE_NET_BASICS_IMPOL_MULTISOCKETTYPE_H_INCLUDED
|
||||
#ifndef RIPPLE_COMMON_MULTISOCKETTYPE_H_INCLUDED
|
||||
#define RIPPLE_COMMON_MULTISOCKETTYPE_H_INCLUDED
|
||||
|
||||
/** Template for producing instances of MultiSocket
|
||||
*/
|
||||
#include "../MultiSocket.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
/** Template for producing instances of MultiSocket */
|
||||
template <class StreamSocket>
|
||||
class MultiSocketType
|
||||
: public MultiSocket
|
||||
@@ -43,8 +48,8 @@ private:
|
||||
State m_state;
|
||||
boost::asio::ssl::context& m_ssl_context;
|
||||
int m_verify_mode;
|
||||
ScopedPointer <Socket> m_stream;
|
||||
ScopedPointer <Socket> m_ssl_stream; // the ssl portion of our stream if it exists
|
||||
std::unique_ptr <Socket> m_stream;
|
||||
std::unique_ptr <Socket> m_ssl_stream; // the ssl portion of our stream if it exists
|
||||
bool m_needsShutdown;
|
||||
StreamSocket m_next_layer;
|
||||
ProxyInfo m_proxyInfo;
|
||||
@@ -89,13 +94,13 @@ protected:
|
||||
return m_origFlags;
|
||||
}
|
||||
|
||||
IP::Endpoint local_endpoint()
|
||||
beast::IP::Endpoint local_endpoint()
|
||||
{
|
||||
return IPAddressConversion::from_asio (
|
||||
m_next_layer.local_endpoint());
|
||||
}
|
||||
|
||||
IP::Endpoint remote_endpoint()
|
||||
beast::IP::Endpoint remote_endpoint()
|
||||
{
|
||||
if (m_proxyInfoSet)
|
||||
{
|
||||
@@ -145,7 +150,7 @@ protected:
|
||||
This object gets dynamically created and replaced with other
|
||||
objects as we process the various flags for handshaking.
|
||||
*/
|
||||
Socket& stream () const noexcept
|
||||
beast::Socket& stream () const noexcept
|
||||
{
|
||||
bassert (m_stream != nullptr);
|
||||
return *m_stream;
|
||||
@@ -219,26 +224,26 @@ protected:
|
||||
// basic_stream_socket
|
||||
//
|
||||
|
||||
std::size_t read_some (MutableBuffers const& buffers, error_code& ec)
|
||||
std::size_t read_some (beast::MutableBuffers const& buffers, error_code& ec)
|
||||
{
|
||||
return stream ().read_some (buffers, ec);
|
||||
}
|
||||
|
||||
std::size_t write_some (ConstBuffers const& buffers, error_code& ec)
|
||||
std::size_t write_some (beast::ConstBuffers const& buffers, error_code& ec)
|
||||
{
|
||||
return stream ().write_some (buffers, ec);
|
||||
}
|
||||
|
||||
void async_read_some (MutableBuffers const& buffers, SharedHandlerPtr handler)
|
||||
void async_read_some (beast::MutableBuffers const& buffers, beast::SharedHandlerPtr handler)
|
||||
{
|
||||
stream ().async_read_some (buffers,
|
||||
BOOST_ASIO_MOVE_CAST(SharedHandlerPtr)(handler));
|
||||
BOOST_ASIO_MOVE_CAST(beast::SharedHandlerPtr)(handler));
|
||||
}
|
||||
|
||||
void async_write_some (ConstBuffers const& buffers, SharedHandlerPtr handler)
|
||||
void async_write_some (beast::ConstBuffers const& buffers, beast::SharedHandlerPtr handler)
|
||||
{
|
||||
stream ().async_write_some (buffers,
|
||||
BOOST_ASIO_MOVE_CAST(SharedHandlerPtr)(handler));
|
||||
BOOST_ASIO_MOVE_CAST(beast::SharedHandlerPtr)(handler));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -291,28 +296,28 @@ protected:
|
||||
// we need the ability to re-use data for multiple handshake stages anyway.
|
||||
//
|
||||
error_code handshake (handshake_type type,
|
||||
ConstBuffers const& buffers, error_code& ec)
|
||||
beast::ConstBuffers const& buffers, error_code& ec)
|
||||
{
|
||||
return do_handshake (type, buffers, ec);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void async_handshake (handshake_type type, SharedHandlerPtr handler)
|
||||
void async_handshake (handshake_type type, beast::SharedHandlerPtr handler)
|
||||
{
|
||||
do_async_handshake (type, ConstBuffers (), handler);
|
||||
do_async_handshake (type, beast::ConstBuffers (), handler);
|
||||
}
|
||||
|
||||
void async_handshake (handshake_type type,
|
||||
ConstBuffers const& buffers, SharedHandlerPtr handler)
|
||||
beast::ConstBuffers const& buffers, beast::SharedHandlerPtr handler)
|
||||
{
|
||||
do_async_handshake (type, buffers, handler);
|
||||
}
|
||||
|
||||
void do_async_handshake (handshake_type type,
|
||||
ConstBuffers const& buffers, SharedHandlerPtr const& handler)
|
||||
beast::ConstBuffers const& buffers, beast::SharedHandlerPtr const& handler)
|
||||
{
|
||||
return get_io_service ().dispatch (SharedHandlerPtr (
|
||||
return get_io_service ().dispatch (beast::SharedHandlerPtr (
|
||||
new AsyncOp <next_layer_type> (*this, m_next_layer, type, buffers, handler)));
|
||||
}
|
||||
|
||||
@@ -332,7 +337,7 @@ protected:
|
||||
return ec = handshake_error ();
|
||||
}
|
||||
|
||||
void async_shutdown (SharedHandlerPtr handler)
|
||||
void async_shutdown (beast::SharedHandlerPtr handler)
|
||||
{
|
||||
error_code ec;
|
||||
|
||||
@@ -341,7 +346,7 @@ protected:
|
||||
if (stream ().needs_handshake ())
|
||||
{
|
||||
stream ().async_shutdown (
|
||||
BOOST_ASIO_MOVE_CAST(SharedHandlerPtr)(handler));
|
||||
BOOST_ASIO_MOVE_CAST(beast::SharedHandlerPtr)(handler));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -355,7 +360,7 @@ protected:
|
||||
}
|
||||
|
||||
get_io_service ().wrap (
|
||||
BOOST_ASIO_MOVE_CAST(SharedHandlerPtr)(handler))
|
||||
BOOST_ASIO_MOVE_CAST(beast::SharedHandlerPtr)(handler))
|
||||
(ec);
|
||||
}
|
||||
|
||||
@@ -441,17 +446,17 @@ protected:
|
||||
|
||||
// Client sends PROXY in the plain so make
|
||||
// sure they have an underlying stream right away.
|
||||
m_stream = new_plain_stream ();
|
||||
m_stream.reset (new_plain_stream ());
|
||||
}
|
||||
else if (m_flags.set (Flag::ssl))
|
||||
{
|
||||
m_state = stateHandshakeFinal;
|
||||
m_stream = nullptr;
|
||||
m_stream.reset (nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_state = stateReady;
|
||||
m_stream = new_plain_stream ();
|
||||
m_stream.reset (new_plain_stream ());
|
||||
}
|
||||
}
|
||||
else if (is_server ())
|
||||
@@ -461,27 +466,27 @@ protected:
|
||||
// We expect a PROXY handshake.
|
||||
// Create the plain stream at handshake time.
|
||||
m_state = stateHandshake;
|
||||
m_stream = nullptr;
|
||||
m_stream.reset (nullptr);
|
||||
}
|
||||
else if (m_flags.set (Flag::ssl_required))
|
||||
{
|
||||
// We require an SSL handshake.
|
||||
// Create the stream at handshake time.
|
||||
m_state = stateHandshakeFinal;
|
||||
m_stream = nullptr;
|
||||
m_stream.reset (nullptr);
|
||||
}
|
||||
else if (m_flags.set (Flag::ssl))
|
||||
{
|
||||
// We will use the SSL detector at handshake
|
||||
// time decide which type of stream to create.
|
||||
m_state = stateHandshake;
|
||||
m_stream = nullptr;
|
||||
m_stream.reset (nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No handshaking required.
|
||||
m_state = stateReady;
|
||||
m_stream = new_plain_stream ();
|
||||
m_stream.reset (new_plain_stream ());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -496,12 +501,12 @@ protected:
|
||||
{
|
||||
// We will decide stream type at handshake time
|
||||
m_state = stateHandshake;
|
||||
m_stream = nullptr;
|
||||
m_stream.reset (nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_state = stateReady;
|
||||
m_stream = new_plain_stream ();
|
||||
m_stream.reset (new_plain_stream ());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,7 +522,7 @@ protected:
|
||||
//
|
||||
error_code initHandshake (handshake_type type)
|
||||
{
|
||||
return initHandshake (type, ConstBuffers ());
|
||||
return initHandshake (type, beast::ConstBuffers ());
|
||||
}
|
||||
|
||||
// Updates the state based on the now-known handshake type. The
|
||||
@@ -525,7 +530,7 @@ protected:
|
||||
// This can come from the results of SSL detection, or from the buffered
|
||||
// handshake API calls added in Boost v1.54.0.
|
||||
//
|
||||
error_code initHandshake (handshake_type type, ConstBuffers const& buffers)
|
||||
error_code initHandshake (handshake_type type, beast::ConstBuffers const& buffers)
|
||||
{
|
||||
switch (m_state)
|
||||
{
|
||||
@@ -582,7 +587,7 @@ protected:
|
||||
return handshake_error ();
|
||||
|
||||
m_state = stateHandshakeFinal;
|
||||
m_stream = new_ssl_stream (buffers);
|
||||
m_stream.reset (new_ssl_stream (buffers));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -593,26 +598,26 @@ protected:
|
||||
// We will expect and consume a PROXY handshake,
|
||||
// then come back here with the flag cleared.
|
||||
m_state = stateExpectPROXY;
|
||||
m_stream = new_plain_stream ();
|
||||
m_stream.reset (new_plain_stream ());
|
||||
}
|
||||
else if (m_flags.set (Flag::ssl_required))
|
||||
{
|
||||
// WE will perform a required final SSL handshake.
|
||||
m_state = stateHandshakeFinal;
|
||||
m_stream = new_ssl_stream (buffers);
|
||||
m_stream.reset (new_ssl_stream (buffers));
|
||||
}
|
||||
else if (m_flags.set (Flag::ssl))
|
||||
{
|
||||
// We will use the SSL detector to update
|
||||
// our flags and come back through here.
|
||||
m_state = stateDetectSSL;
|
||||
m_stream = nullptr;
|
||||
m_stream.reset (nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Done with auto-detect
|
||||
m_state = stateReady;
|
||||
m_stream = new_plain_stream (buffers);
|
||||
m_stream.reset (new_plain_stream (buffers));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,8 +629,8 @@ protected:
|
||||
template <typename Stream>
|
||||
void set_ssl_stream (boost::asio::ssl::stream <Stream>& ssl_stream)
|
||||
{
|
||||
m_ssl_stream = new SocketWrapper <boost::asio::ssl::stream <Stream>&>
|
||||
(ssl_stream);
|
||||
m_ssl_stream.reset (new SocketWrapper <boost::asio::ssl::stream <Stream>&>
|
||||
(ssl_stream));
|
||||
m_ssl_stream->set_verify_mode (m_verify_mode);
|
||||
m_native_ssl_handle = ssl_stream.native_handle ();
|
||||
}
|
||||
@@ -634,7 +639,7 @@ protected:
|
||||
|
||||
// Create a plain stream that just wraps the next layer.
|
||||
//
|
||||
Socket* new_plain_stream ()
|
||||
beast::Socket* new_plain_stream ()
|
||||
{
|
||||
typedef SocketWrapper <next_layer_type&> Wrapper;
|
||||
Wrapper* const socket (new Wrapper (m_next_layer));
|
||||
@@ -645,7 +650,7 @@ protected:
|
||||
// A copy of the buffers is made.
|
||||
//
|
||||
template <typename ConstBufferSequence>
|
||||
Socket* new_plain_stream (ConstBufferSequence const& buffers)
|
||||
beast::Socket* new_plain_stream (ConstBufferSequence const& buffers)
|
||||
{
|
||||
if (boost::asio::buffer_size (buffers) > 0)
|
||||
{
|
||||
@@ -659,7 +664,7 @@ protected:
|
||||
|
||||
// Creates an ssl stream
|
||||
//
|
||||
Socket* new_ssl_stream ()
|
||||
beast::Socket* new_ssl_stream ()
|
||||
{
|
||||
typedef typename boost::asio::ssl::stream <next_layer_type&> SslStream;
|
||||
typedef SocketWrapper <SslStream> Wrapper;
|
||||
@@ -672,7 +677,7 @@ protected:
|
||||
// A copy of the buffers is made.
|
||||
//
|
||||
template <typename ConstBufferSequence>
|
||||
Socket* new_ssl_stream (ConstBufferSequence const& buffers)
|
||||
beast::Socket* new_ssl_stream (ConstBufferSequence const& buffers)
|
||||
{
|
||||
if (boost::asio::buffer_size (buffers) > 0)
|
||||
{
|
||||
@@ -693,7 +698,7 @@ protected:
|
||||
//
|
||||
|
||||
error_code do_handshake (handshake_type type,
|
||||
ConstBuffers const& buffers, error_code& ec)
|
||||
beast::ConstBuffers const& buffers, error_code& ec)
|
||||
{
|
||||
ec = initHandshake (type);
|
||||
if (ec)
|
||||
@@ -823,22 +828,22 @@ protected:
|
||||
//
|
||||
|
||||
template <typename Stream>
|
||||
struct AsyncOp : ComposedAsyncOperation
|
||||
struct AsyncOp : beast::ComposedAsyncOperation
|
||||
{
|
||||
typedef SharedHandlerAllocator <char> Allocator;
|
||||
typedef beast::SharedHandlerAllocator <char> Allocator;
|
||||
|
||||
SharedHandlerPtr m_handler;
|
||||
beast::SharedHandlerPtr m_handler;
|
||||
MultiSocketType <StreamSocket>& m_owner;
|
||||
Stream& m_stream;
|
||||
handshake_type const m_type;
|
||||
boost::asio::basic_streambuf <Allocator> m_buffer;
|
||||
HandshakeDetectorType <next_layer_type, HandshakeDetectLogicPROXY> m_proxy;
|
||||
HandshakeDetectorType <next_layer_type, HandshakeDetectLogicSSL3> m_ssl;
|
||||
beast::HandshakeDetectorType <next_layer_type, beast::HandshakeDetectLogicPROXY> m_proxy;
|
||||
beast::HandshakeDetectorType <next_layer_type, beast::HandshakeDetectLogicSSL3> m_ssl;
|
||||
bool m_running;
|
||||
|
||||
AsyncOp (MultiSocketType <StreamSocket>& owner, Stream& stream,
|
||||
handshake_type type, ConstBuffers const& buffers,
|
||||
SharedHandlerPtr const& handler)
|
||||
handshake_type type, beast::ConstBuffers const& buffers,
|
||||
beast::SharedHandlerPtr const& handler)
|
||||
: ComposedAsyncOperation (handler)
|
||||
, m_handler (handler)
|
||||
, m_owner (owner)
|
||||
@@ -884,7 +889,7 @@ protected:
|
||||
|
||||
// Call the original handler with the error code and end.
|
||||
m_owner.get_io_service ().wrap (
|
||||
BOOST_ASIO_MOVE_CAST (SharedHandlerPtr)(m_handler))
|
||||
BOOST_ASIO_MOVE_CAST (beast::SharedHandlerPtr)(m_handler))
|
||||
(ec);
|
||||
}
|
||||
|
||||
@@ -914,7 +919,7 @@ protected:
|
||||
//
|
||||
m_owner.m_state = stateReady;
|
||||
m_owner.stream ().async_handshake (m_type,
|
||||
SharedHandlerPtr (this));
|
||||
beast::SharedHandlerPtr (this));
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -941,7 +946,7 @@ protected:
|
||||
}
|
||||
|
||||
m_proxy.async_detect (m_stream,
|
||||
m_buffer, SharedHandlerPtr (this));
|
||||
m_buffer, beast::SharedHandlerPtr (this));
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -968,7 +973,7 @@ protected:
|
||||
}
|
||||
|
||||
m_ssl.async_detect (m_stream,
|
||||
m_buffer, SharedHandlerPtr (this));
|
||||
m_buffer, beast::SharedHandlerPtr (this));
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -985,7 +990,7 @@ protected:
|
||||
|
||||
// Call the original handler with the error code and end.
|
||||
m_owner.get_io_service ().wrap (
|
||||
BOOST_ASIO_MOVE_CAST(SharedHandlerPtr)(m_handler))
|
||||
BOOST_ASIO_MOVE_CAST(beast::SharedHandlerPtr)(m_handler))
|
||||
(ec);
|
||||
}
|
||||
|
||||
@@ -996,4 +1001,6 @@ protected:
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "../../beast/modules/beast_asio/async/AsyncObject.h"
|
||||
#include "../../beast/modules/beast_asio/beast_asio.h"
|
||||
#include "../../beast/beast/asio/IPAddressConversion.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
@@ -17,6 +17,14 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "../RippleSSLContext.h"
|
||||
|
||||
#include "../../beast/modules/beast_core/beast_core.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
class RippleSSLContextImp : public RippleSSLContext
|
||||
{
|
||||
private:
|
||||
@@ -55,7 +63,7 @@ public:
|
||||
{
|
||||
// These are the DH parameters that OpenCoin has chosen for Ripple
|
||||
//
|
||||
uint8 const raw [] = {
|
||||
std::uint8_t const raw [] = {
|
||||
0x30, 0x46, 0x02, 0x41, 0x00, 0x98, 0x15, 0xd2, 0xd0, 0x08, 0x32, 0xda,
|
||||
0xaa, 0xac, 0xc4, 0x71, 0xa3, 0x1b, 0x11, 0xf0, 0x6c, 0x62, 0xb2, 0x35,
|
||||
0x8a, 0x10, 0x92, 0xc6, 0x0a, 0xa3, 0x84, 0x7e, 0xaf, 0x17, 0x29, 0x0b,
|
||||
@@ -90,16 +98,16 @@ public:
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void initAnonymous (String const& cipherList)
|
||||
void initAnonymous (std::string const& cipherList)
|
||||
{
|
||||
initCommon ();
|
||||
|
||||
int const result = SSL_CTX_set_cipher_list (
|
||||
m_context.native_handle (),
|
||||
cipherList.toStdString ().c_str ());
|
||||
cipherList.c_str ());
|
||||
|
||||
if (result != 1)
|
||||
FatalError ("invalid cipher list", __FILE__, __LINE__);
|
||||
beast::FatalError ("invalid cipher list", __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -122,7 +130,7 @@ public:
|
||||
|
||||
if (error)
|
||||
{
|
||||
FatalError ("Problem with SSL certificate file.",
|
||||
beast::FatalError ("Problem with SSL certificate file.",
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
|
||||
@@ -136,7 +144,7 @@ public:
|
||||
|
||||
if (!f)
|
||||
{
|
||||
FatalError ("Problem opening SSL chain file.",
|
||||
beast::FatalError ("Problem opening SSL chain file.",
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
|
||||
@@ -152,7 +160,7 @@ public:
|
||||
if (! cert_set)
|
||||
{
|
||||
if (SSL_CTX_use_certificate (ssl, x) != 1)
|
||||
FatalError ("Problem retrieving SSL certificate from chain file.",
|
||||
beast::FatalError ("Problem retrieving SSL certificate from chain file.",
|
||||
__FILE__, __LINE__);
|
||||
|
||||
cert_set = true;
|
||||
@@ -160,7 +168,7 @@ public:
|
||||
else if (SSL_CTX_add_extra_chain_cert (ssl, x) != 1)
|
||||
{
|
||||
X509_free (x);
|
||||
FatalError ("Problem adding SSL chain certificate.",
|
||||
beast::FatalError ("Problem adding SSL chain certificate.",
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
@@ -170,7 +178,7 @@ public:
|
||||
catch (...)
|
||||
{
|
||||
fclose (f);
|
||||
FatalError ("Reading the SSL chain file generated an exception.",
|
||||
beast::FatalError ("Reading the SSL chain file generated an exception.",
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
@@ -184,14 +192,14 @@ public:
|
||||
|
||||
if (error)
|
||||
{
|
||||
FatalError ("Problem using the SSL private key file.",
|
||||
beast::FatalError ("Problem using the SSL private key file.",
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
if (SSL_CTX_check_private_key (ssl) != 1)
|
||||
{
|
||||
FatalError ("Invalid key in SSL private key file.",
|
||||
beast::FatalError ("Invalid key in SSL private key file.",
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
@@ -213,10 +221,11 @@ public:
|
||||
//
|
||||
explicit ScopedDHPointer (std::string const& params)
|
||||
{
|
||||
uint8 const* p (reinterpret_cast <uint8 const*>(¶ms [0]));
|
||||
auto const* p (
|
||||
reinterpret_cast <std::uint8_t const*>(¶ms [0]));
|
||||
m_dh = d2i_DHparams (nullptr, &p, params.size ());
|
||||
if (m_dh == nullptr)
|
||||
FatalError ("d2i_DHparams returned nullptr.",
|
||||
beast::FatalError ("d2i_DHparams returned nullptr.",
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
|
||||
@@ -252,7 +261,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalError ("unsupported key length", __FILE__, __LINE__);
|
||||
beast::FatalError ("unsupported key length", __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
@@ -268,23 +277,23 @@ RippleSSLContext::RippleSSLContext (ContextType& context)
|
||||
|
||||
RippleSSLContext* RippleSSLContext::createBare ()
|
||||
{
|
||||
ScopedPointer <RippleSSLContextImp> context (new RippleSSLContextImp ());
|
||||
std::unique_ptr <RippleSSLContextImp> context (new RippleSSLContextImp ());
|
||||
|
||||
return context.release ();
|
||||
}
|
||||
|
||||
RippleSSLContext* RippleSSLContext::createWebSocket ()
|
||||
{
|
||||
ScopedPointer <RippleSSLContextImp> context (new RippleSSLContextImp ());
|
||||
std::unique_ptr <RippleSSLContextImp> context (new RippleSSLContextImp ());
|
||||
|
||||
context->initCommon ();
|
||||
|
||||
return context.release ();
|
||||
}
|
||||
|
||||
RippleSSLContext* RippleSSLContext::createAnonymous (String const& cipherList)
|
||||
RippleSSLContext* RippleSSLContext::createAnonymous (std::string const& cipherList)
|
||||
{
|
||||
ScopedPointer <RippleSSLContextImp> context (new RippleSSLContextImp ());
|
||||
std::unique_ptr <RippleSSLContextImp> context (new RippleSSLContextImp ());
|
||||
|
||||
context->initAnonymous (cipherList);
|
||||
|
||||
@@ -294,7 +303,7 @@ RippleSSLContext* RippleSSLContext::createAnonymous (String const& cipherList)
|
||||
RippleSSLContext* RippleSSLContext::createAuthenticated (
|
||||
std::string key_file, std::string cert_file, std::string chain_file)
|
||||
{
|
||||
ScopedPointer <RippleSSLContextImp> context (new RippleSSLContextImp ());
|
||||
std::unique_ptr <RippleSSLContextImp> context (new RippleSSLContextImp ());
|
||||
|
||||
context->initAuthenticated (key_file, cert_file, chain_file);
|
||||
|
||||
@@ -306,3 +315,4 @@ std::string RippleSSLContext::getRawDHParams (int keySize)
|
||||
return RippleSSLContextImp::getRawDHParams (keySize);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,14 +24,6 @@
|
||||
#include "impl/counted_bind.cpp"
|
||||
#include "impl/KeyCache.cpp"
|
||||
#include "impl/TaggedCache.cpp"
|
||||
|
||||
using namespace beast;
|
||||
|
||||
#ifndef NDEBUG
|
||||
# define consistency_check(cond) bassert(cond)
|
||||
#else
|
||||
# define consistency_check(cond)
|
||||
#endif
|
||||
|
||||
#include "impl/ResolverAsio.cpp"
|
||||
|
||||
#include "impl/MultiSocket.cpp"
|
||||
#include "impl/RippleSSLContext.cpp"
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "../../ripple/common/MultiSocket.h"
|
||||
|
||||
namespace ripple {
|
||||
namespace HTTP {
|
||||
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "../../ripple/common/RippleSSLContext.h"
|
||||
|
||||
namespace ripple {
|
||||
|
||||
class RPCHTTPServerImp
|
||||
: public RPCHTTPServer
|
||||
, public LeakChecked <RPCHTTPServerImp>
|
||||
@@ -287,3 +291,4 @@ RPCHTTPServer* RPCHTTPServer::New (Stoppable& parent,
|
||||
return new RPCHTTPServerImp (parent, journal, jobQueue, networkOPs, resourceManager);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_APP_RPCHTTPSERVER_H_INCLUDED
|
||||
#define RIPPLE_APP_RPCHTTPSERVER_H_INCLUDED
|
||||
|
||||
namespace ripple {
|
||||
|
||||
class RPCHTTPServer : public Stoppable
|
||||
{
|
||||
protected:
|
||||
@@ -35,4 +37,6 @@ public:
|
||||
virtual void setup (Journal journal) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -63,13 +63,13 @@ namespace ripple {
|
||||
|
||||
# include "rpc/RPCHandler.h"
|
||||
}
|
||||
namespace ripple {
|
||||
#include "rpc/RPCHandler.cpp"
|
||||
|
||||
# include "rpc/RPCServerHandler.h"
|
||||
# include "main/RPCHTTPServer.h"
|
||||
#include "main/RPCHTTPServer.cpp"
|
||||
#include "rpc/RPCServerHandler.cpp"
|
||||
namespace ripple {
|
||||
#include "rpc/RPCHandler.cpp"
|
||||
|
||||
#include "websocket/WSConnection.h"
|
||||
|
||||
# include "tx/TxQueueEntry.h"
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
#include "../ripple/peerfinder/ripple_peerfinder.h"
|
||||
#include "../ripple/resource/ripple_resource.h"
|
||||
#include "../ripple/validators/ripple_validators.h"
|
||||
|
||||
#include "../ripple/common/ResolverAsio.h"
|
||||
#include "../ripple/common/RippleSSLContext.h"
|
||||
|
||||
#include <deque>
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
namespace ripple {
|
||||
|
||||
RPCServerHandler::RPCServerHandler (NetworkOPs& networkOPs, Resource::Manager& resourceManager)
|
||||
: m_networkOPs (networkOPs)
|
||||
, m_resourceManager (resourceManager)
|
||||
@@ -147,3 +149,5 @@ std::string RPCServerHandler::processRequest (std::string const& request, IP::En
|
||||
|
||||
return createResponse (200, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_RPCSERVERHANDLER_H_INCLUDED
|
||||
#define RIPPLE_RPCSERVERHANDLER_H_INCLUDED
|
||||
|
||||
namespace ripple {
|
||||
|
||||
class NetworkOPs;
|
||||
|
||||
/** Handles RPC requests.
|
||||
@@ -40,4 +42,6 @@ private:
|
||||
Resource::Manager& m_resourceManager;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#include "nodestore/NodeStore.cpp"
|
||||
|
||||
#include "../beast/beast/http/ParsedURL.h"
|
||||
#include "../ripple_net/ripple_net.h" // for HTTPClient
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "../../ripple/common/RippleSSLContext.h"
|
||||
|
||||
namespace ripple {
|
||||
|
||||
SETUP_LOG (RPCDoor)
|
||||
|
||||
class RPCDoorImp : public RPCDoor, public LeakChecked <RPCDoorImp>
|
||||
@@ -137,3 +141,5 @@ RPCDoor* RPCDoor::New (boost::asio::io_service& io_service, RPCServer::Handler&
|
||||
|
||||
return result.release ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,25 +48,16 @@
|
||||
//
|
||||
#include "../ripple_rpc/api/ErrorCodes.h"
|
||||
|
||||
namespace ripple
|
||||
{
|
||||
|
||||
namespace ripple {
|
||||
#include "basics/HTTPRequest.cpp"
|
||||
#include "basics/HTTPClient.cpp"
|
||||
|
||||
# include "basics/impl/MultiSocketType.h"
|
||||
#include "basics/MultiSocket.cpp"
|
||||
|
||||
#include "basics/RippleSSLContext.cpp"
|
||||
|
||||
# include "basics/impl/RPCServerImp.h"
|
||||
#include "basics/RPCDoor.cpp"
|
||||
#include "basics/SNTPClient.cpp"
|
||||
|
||||
#include "rpc/RPCCall.cpp"
|
||||
#include "rpc/RPCErr.cpp"
|
||||
#include "rpc/RPCSub.cpp"
|
||||
#include "rpc/RPCUtil.cpp"
|
||||
#include "rpc/InfoSub.cpp"
|
||||
|
||||
}
|
||||
|
||||
#include "basics/RPCDoor.cpp"
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
#include "beast/modules/beast_core/system/BeforeBoost.h"
|
||||
#include <boost/unordered_set.hpp> // For InfoSub
|
||||
|
||||
#include "beast/modules/beast_asio/beast_asio.h"
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/asio/ssl.hpp>
|
||||
|
||||
#include "../ripple/resource/ripple_resource.h"
|
||||
|
||||
@@ -34,8 +35,6 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
#include "basics/RippleSSLContext.h"
|
||||
#include "basics/MultiSocket.h"
|
||||
#include "basics/HTTPRequest.h"
|
||||
#include "basics/HTTPClient.h"
|
||||
#include "basics/RPCServer.h"
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_OVERLAY_PEERIMP_H_INCLUDED
|
||||
#define RIPPLE_OVERLAY_PEERIMP_H_INCLUDED
|
||||
|
||||
#include "../../ripple/common/MultiSocket.h"
|
||||
|
||||
namespace ripple {
|
||||
|
||||
class PeerImp;
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#ifndef WEBSOCKETPP_SOCKET_MULTITLS_HPP
|
||||
#define WEBSOCKETPP_SOCKET_MULTITLS_HPP
|
||||
|
||||
#include "../../ripple/common/MultiSocket.h"
|
||||
|
||||
namespace websocketpp {
|
||||
namespace socket {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user