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:
Howard Hinnant
2014-03-04 14:56:48 -05:00
committed by Vinnie Falco
parent adc4c855ca
commit 09570996a9
4 changed files with 7 additions and 6 deletions

View File

@@ -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 ())

View File

@@ -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 ())))

View File

@@ -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 ())))

View File

@@ -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 ())))