mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Update MultiSocket to use new beast asio APIs
This commit is contained in:
@@ -143,6 +143,18 @@
|
||||
#define BEAST_DISABLE_CONTRACT_CHECKS 0
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Config: BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES
|
||||
|
||||
Setting this option makes Socket-derived classes generate compile errors if
|
||||
they forget any of the virtual overrides As some Socket-derived classes
|
||||
intentionally omit member functions that are not applicable, this macro
|
||||
should only be enabled temporarily when writing your own Socket-derived class,
|
||||
to make sure that the function signatures match as expected.
|
||||
*/
|
||||
#define BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES 0
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// Ripple compilation settings
|
||||
@@ -161,7 +173,7 @@
|
||||
#define RIPPLE_USES_BEAST_SOCKETS 0
|
||||
|
||||
|
||||
#define BEAST_ASIO_HAS_BUFFEREDHANDSHAKE 0
|
||||
//#define BEAST_ASIO_HAS_BUFFEREDHANDSHAKE 0
|
||||
//#define BEAST_ASIO_HAS_FUTURE_RETURNS 0
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1665,7 +1665,6 @@
|
||||
<None Include="..\QtCreator\rippled.pro" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\..\Notes\VFALCO_LOG.txt" />
|
||||
<Text Include="..\..\Notes\VFALCO_TODO.txt" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
|
||||
@@ -1724,9 +1724,6 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\..\Notes\VFALCO_LOG.txt">
|
||||
<Filter>%28Notes%29</Filter>
|
||||
</Text>
|
||||
<Text Include="..\..\Notes\VFALCO_TODO.txt">
|
||||
<Filter>%28Notes%29</Filter>
|
||||
</Text>
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#define MULTISOCKET_TEST_PROXY 1
|
||||
|
||||
MultiSocket* MultiSocket::New (boost::asio::io_service& io_service, int flags)
|
||||
{
|
||||
return new MultiSocketType <boost::asio::ip::tcp::socket> (io_service, flags);
|
||||
@@ -183,6 +181,7 @@ public:
|
||||
TestPeerLogicSyncClient, TestPeerLogicAsyncServer>
|
||||
(clientArg, serverArg, timeoutSeconds).report (*this);
|
||||
|
||||
|
||||
PeerTest::run <MultiSocketDetailsType <Protocol>,
|
||||
TestPeerLogicAsyncClient, TestPeerLogicAsyncServer>
|
||||
(clientArg, serverArg, timeoutSeconds).report (*this);
|
||||
@@ -213,21 +212,41 @@ public:
|
||||
template <typename Protocol>
|
||||
void testProtocol ()
|
||||
{
|
||||
// These should pass.
|
||||
run <Protocol> (0, 0);
|
||||
run <Protocol> (MultiSocket::Flag::client_role, 0);
|
||||
// Simple tests
|
||||
run <Protocol> (0,
|
||||
0);
|
||||
|
||||
run <Protocol> (MultiSocket::Flag::client_role,
|
||||
0);
|
||||
|
||||
run <Protocol> (0, MultiSocket::Flag::server_role);
|
||||
run <Protocol> (MultiSocket::Flag::client_role, MultiSocket::Flag::server_role);
|
||||
|
||||
// These should pass
|
||||
testFlags <Protocol> (MultiSocket::Flag::ssl, MultiSocket::Flag::ssl_required);
|
||||
testFlags <Protocol> (0, MultiSocket::Flag::ssl);
|
||||
testFlags <Protocol> (MultiSocket::Flag::ssl, MultiSocket::Flag::ssl);
|
||||
run <Protocol> (MultiSocket::Flag::client_role,
|
||||
MultiSocket::Flag::server_role);
|
||||
|
||||
testProxyFlags <Protocol> (MultiSocket::Flag::proxy, MultiSocket::Flag::proxy);
|
||||
testProxyFlags <Protocol> (MultiSocket::Flag::proxy | MultiSocket::Flag::ssl, MultiSocket::Flag::proxy | MultiSocket::Flag::ssl_required);
|
||||
testProxyFlags <Protocol> (MultiSocket::Flag::proxy, MultiSocket::Flag::proxy | MultiSocket::Flag::ssl);
|
||||
testProxyFlags <Protocol> (MultiSocket::Flag::proxy | MultiSocket::Flag::ssl, MultiSocket::Flag::proxy | MultiSocket::Flag::ssl);
|
||||
testFlags <Protocol> (MultiSocket::Flag::ssl,
|
||||
MultiSocket::Flag::ssl_required);
|
||||
|
||||
// SSL-Detect tests
|
||||
testFlags <Protocol> (0,
|
||||
MultiSocket::Flag::ssl);
|
||||
|
||||
testFlags <Protocol> (MultiSocket::Flag::ssl,
|
||||
MultiSocket::Flag::ssl);
|
||||
|
||||
// PROXY Handshake tests
|
||||
testProxyFlags <Protocol> (MultiSocket::Flag::proxy,
|
||||
MultiSocket::Flag::proxy);
|
||||
|
||||
testProxyFlags <Protocol> (MultiSocket::Flag::proxy | MultiSocket::Flag::ssl,
|
||||
MultiSocket::Flag::proxy | MultiSocket::Flag::ssl_required);
|
||||
|
||||
// PROXY + SSL-Detect tests
|
||||
testProxyFlags <Protocol> (MultiSocket::Flag::proxy,
|
||||
MultiSocket::Flag::proxy | MultiSocket::Flag::ssl);
|
||||
|
||||
testProxyFlags <Protocol> (MultiSocket::Flag::proxy | MultiSocket::Flag::ssl,
|
||||
MultiSocket::Flag::proxy | MultiSocket::Flag::ssl);
|
||||
}
|
||||
|
||||
void runTest ()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user