mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Fix beast::asio failures on OS X.
There are 38 unittest failures on OS X. These changes address all of them by adjusting which side of the socket (send or receive) gets shut down. In each case, the failure was 'Socket is not connected'. I've interpreted that to mean that the other thread had already shut down its side of the connection.
This commit is contained in:
committed by
Vinnie Falco
parent
adc4c855ca
commit
09570996a9
@@ -108,7 +108,7 @@ void TestPeerLogicAsyncClient::on_read_final (error_code const& ec, std::size_t)
|
||||
{
|
||||
// on_shutdown will call finished ()
|
||||
error_code ec;
|
||||
on_shutdown (socket ().shutdown (Socket::shutdown_both, ec));
|
||||
on_shutdown (socket ().shutdown (Socket::shutdown_send, ec));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -137,7 +137,7 @@ void TestPeerLogicAsyncClient::on_shutdown (error_code const& ec)
|
||||
{
|
||||
if (socket ().needs_handshake ())
|
||||
{
|
||||
socket ().shutdown (Socket::shutdown_both, error ());
|
||||
socket ().shutdown (Socket::shutdown_send, error ());
|
||||
}
|
||||
|
||||
if (! error ())
|
||||
|
||||
@@ -90,7 +90,7 @@ void TestPeerLogicAsyncServer::on_write (error_code const& ec, std::size_t bytes
|
||||
// on_shutdown will call finished ()
|
||||
// we need another instance of ec so we can call on_shutdown()
|
||||
error_code ec;
|
||||
on_shutdown (socket ().shutdown (Socket::shutdown_both, ec));
|
||||
on_shutdown (socket ().shutdown (Socket::shutdown_receive, ec));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ void TestPeerLogicAsyncServer::on_shutdown (error_code const& ec)
|
||||
{
|
||||
if (socket ().needs_handshake ())
|
||||
{
|
||||
socket ().shutdown (Socket::shutdown_both, error ());
|
||||
socket ().shutdown (Socket::shutdown_receive, error ());
|
||||
}
|
||||
|
||||
if (success (socket ().close (error ())))
|
||||
|
||||
@@ -94,9 +94,10 @@ void TestPeerLogicSyncClient::on_connect ()
|
||||
{
|
||||
if (failure (socket ().shutdown (error ()), true))
|
||||
return;
|
||||
error () = error_code ();
|
||||
}
|
||||
|
||||
if (failure (socket ().shutdown (Socket::shutdown_both, error ())))
|
||||
if (failure (socket ().shutdown (Socket::shutdown_send, error ())))
|
||||
return;
|
||||
|
||||
if (failure (socket ().close (error ())))
|
||||
|
||||
@@ -72,7 +72,7 @@ void TestPeerLogicSyncServer::on_connect ()
|
||||
return;
|
||||
}
|
||||
|
||||
if (failure (socket ().shutdown (Socket::shutdown_both, error ())))
|
||||
if (failure (socket ().shutdown (Socket::shutdown_send, error ())))
|
||||
return;
|
||||
|
||||
if (failure (socket ().close (error ())))
|
||||
|
||||
Reference in New Issue
Block a user