Skip to content

Commit cbd817f

Browse files
committed
Remove error check for ICMP socket shutdown (throws error on Linux)
1 parent 8883f35 commit cbd817f

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

hardware/plugins/PluginTransports.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ namespace Plugins {
330330
m_Socket->shutdown(boost::asio::ip::tcp::socket::shutdown_both, e);
331331
if (e)
332332
{
333-
_log.Log(LOG_ERROR, "Plugin: Disconnect Exception: %d, %s", e.value(), e.message().c_str());
333+
_log.Log(LOG_ERROR, "(%s): Socket Shutdown Error: %d, %s", ((CConnection*)m_pConnection)->pPlugin->Name.c_str(), e.value(), e.message().c_str());
334334
}
335335
else
336336
{
@@ -589,7 +589,7 @@ namespace Plugins {
589589
m_Endpoint = *iter;
590590

591591
//
592-
// Async resolve/connect based on http://www.boost.org/doc/libs/1_45_0/doc/html/boost_asio/example/http/client/async_client.cpp
592+
// Async resolve/connect based on http://www.boost.org/doc/libs/1_51_0/doc/html/boost_asio/example/icmp/ping.cpp
593593
//
594594
m_Resolver->async_resolve(query, boost::bind(&CPluginTransportICMP::handleAsyncResolve, this, boost::asio::placeholders::error, boost::asio::placeholders::iterator));
595595

@@ -756,14 +756,7 @@ namespace Plugins {
756756
{
757757
boost::system::error_code e;
758758
m_Socket->shutdown(boost::asio::ip::icmp::socket::shutdown_both, e);
759-
if (e)
760-
{
761-
_log.Log(LOG_ERROR, "Plugin: Disconnect Exception: %d, %s", e.value(), e.message().c_str());
762-
}
763-
else
764-
{
765-
m_Socket->close();
766-
}
759+
m_Socket->close();
767760
delete m_Socket;
768761
m_Socket = NULL;
769762
}

0 commit comments

Comments
 (0)