Browse Source

Slightly more error resistant.

cl-refactor
Gav Wood 11 years ago
parent
commit
69aed5087e
  1. 8
      libethereum/PeerNetwork.cpp

8
libethereum/PeerNetwork.cpp

@ -340,6 +340,8 @@ void PeerSession::doRead()
if (ec) if (ec)
dropped(); dropped();
else else
{
try
{ {
m_incoming.resize(m_incoming.size() + length); m_incoming.resize(m_incoming.size() + length);
memcpy(m_incoming.data() + m_incoming.size() - length, m_data.data(), length); memcpy(m_incoming.data() + m_incoming.size() - length, m_data.data(), length);
@ -369,6 +371,12 @@ void PeerSession::doRead()
} }
doRead(); doRead();
} }
catch (std::exception const& _e)
{
cout << std::setw(2) << m_socket.native_handle() << " | ERROR: " << _e.what() << endl;
dropped();
}
}
}); });
} }

Loading…
Cancel
Save