diff --git a/src/tcp_server.h b/src/tcp_server.h index 217528f..314a7cd 100644 --- a/src/tcp_server.h +++ b/src/tcp_server.h @@ -89,7 +89,7 @@ public: int m_port; char m_addrString[64]; - std::atomic m_resetCounter{ 0 }; + std::atomic m_resetCounter; }; struct WriteBuf diff --git a/src/tcp_server.inl b/src/tcp_server.inl index b90bde5..6abf54b 100644 --- a/src/tcp_server.inl +++ b/src/tcp_server.inl @@ -819,10 +819,21 @@ void TCPServer::on_new_client_nolock(uv_stream_t* template TCPServer::Client::Client() + : m_owner(nullptr) + , m_prev(nullptr) + , m_next(nullptr) + , m_socket{} + , m_isV6(false) + , m_isIncoming(false) + , m_readBufInUse(false) + , m_numRead(0) + , m_addr{} + , m_port(0) + , m_addrString{} + , m_resetCounter{ 0 } { - Client::reset(); - m_readBuf[0] = '\0'; + m_readBuf[READ_BUF_SIZE - 1] = '\0'; } template