From fa1a10b2350cbf46da42c235557e0ca0a5abb2b8 Mon Sep 17 00:00:00 2001 From: Denes Matetelki Date: Sat, 27 Jul 2013 13:11:18 +0200 Subject: [PATCH] socket accept mistery finally solved: client address lenght had to be initialized --- lib/cpp_utils/Socket.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/cpp_utils/Socket.cpp b/lib/cpp_utils/Socket.cpp index 809fc93..75737fd 100644 --- a/lib/cpp_utils/Socket.cpp +++ b/lib/cpp_utils/Socket.cpp @@ -136,12 +136,7 @@ bool Socket::accept(int client_socket) { TRACE; sockaddr clientAddr; - socklen_t clientAddrLen; - - /// @bug This needs to be investigated ASAP: if the m_socket is not used before accept, it fails. - LOG_BEGIN(Logger::INFO) - LOG_SPROP(m_socket) - LOG_END("Accept mystery."); + socklen_t clientAddrLen = sizeof(clientAddr); client_socket = ::accept( m_socket, &clientAddr, &clientAddrLen ) ; if ( client_socket == -1 ) {