mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-02-02 03:06:27 +00:00
TCPServer: fix incoming connection counting
This commit is contained in:
parent
38a6d3e549
commit
7468af0779
1 changed files with 2 additions and 1 deletions
|
@ -744,6 +744,8 @@ void TCPServer<READ_BUF_SIZE, WRITE_BUF_SIZE>::on_new_client(uv_stream_t* server
|
||||||
client->m_isIncoming = (server != nullptr);
|
client->m_isIncoming = (server != nullptr);
|
||||||
|
|
||||||
if (client->m_isIncoming) {
|
if (client->m_isIncoming) {
|
||||||
|
++m_numIncomingConnections;
|
||||||
|
|
||||||
client->m_isV6 = (std::find(m_listenSockets6.begin(), m_listenSockets6.end(), reinterpret_cast<uv_tcp_t*>(server)) != m_listenSockets6.end());
|
client->m_isV6 = (std::find(m_listenSockets6.begin(), m_listenSockets6.end(), reinterpret_cast<uv_tcp_t*>(server)) != m_listenSockets6.end());
|
||||||
|
|
||||||
sockaddr_storage peer_addr;
|
sockaddr_storage peer_addr;
|
||||||
|
@ -768,7 +770,6 @@ void TCPServer<READ_BUF_SIZE, WRITE_BUF_SIZE>::on_new_client(uv_stream_t* server
|
||||||
}
|
}
|
||||||
|
|
||||||
client->init_addr_string();
|
client->init_addr_string();
|
||||||
++m_numIncomingConnections;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGINFO(5, "new connection " << (client->m_isIncoming ? "from " : "to ") << log::Gray() << static_cast<char*>(client->m_addrString));
|
LOGINFO(5, "new connection " << (client->m_isIncoming ? "from " : "to ") << log::Gray() << static_cast<char*>(client->m_addrString));
|
||||||
|
|
Loading…
Reference in a new issue