Browse Source

Merge pull request #283 from giact/develop-net-hang

Fixed peer hanging when receiving a bad synchronisation token
cl-refactor
Gav Wood 11 years ago
parent
commit
c44e734b1d
  1. 6
      libethereum/PeerSession.cpp

6
libethereum/PeerSession.cpp

@ -564,7 +564,11 @@ void PeerSession::doRead()
while (m_incoming.size() > 8)
{
if (m_incoming[0] != 0x22 || m_incoming[1] != 0x40 || m_incoming[2] != 0x08 || m_incoming[3] != 0x91)
doRead();
{
cwarn << "INVALID SYNCHRONISATION TOKEN; expected = 22400891; received = " << toHex(bytesConstRef(m_incoming.data(), 4));
disconnect(BadProtocol);
return;
}
else
{
uint32_t len = fromBigEndian<uint32_t>(bytesConstRef(m_incoming.data() + 4, 4));

Loading…
Cancel
Save