P2PServer: ban peers that disconnect without finishing handshake

This commit is contained in:
SChernykh
2021-09-06 16:17:20 +02:00
parent d3dc4c731f
commit 7b0cc256c5
4 changed files with 18 additions and 1 deletions
+3 -1
View File
@@ -835,7 +835,9 @@ void TCPServer<READ_BUF_SIZE, WRITE_BUF_SIZE>::Client::on_read(uv_stream_t* stre
}
else if (nread < 0) {
if (nread != UV_EOF) {
LOGWARN(5, "client " << static_cast<const char*>(pThis->m_addrString) << " failed to read response, err = " << uv_err_name(static_cast<int>(nread)));
const int err = static_cast<int>(nread);
LOGWARN(5, "client " << static_cast<const char*>(pThis->m_addrString) << " failed to read response, err = " << uv_err_name(err));
pThis->on_read_failed(err);
}
pThis->close();
}