From 7950f626f9b47761864c7f27eecf77c7204e6828 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 11 Mar 2025 19:09:54 +0800 Subject: bump: compile_commands --- src/session.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/session.cpp') diff --git a/src/session.cpp b/src/session.cpp index 64dbda1..b37d896 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -3,20 +3,21 @@ #include "log.hpp" #include "server.hpp" #include "sessionManager.hpp" +#include #include #include #include -#include -CSession::CSession() : m_addrLen(sizeof(m_addr)) { - m_sockfd = Hyprutils::OS::CFileDescriptor{accept(g_pServer->getSocket()->get(), reinterpret_cast(&m_addr), &m_addrLen)}; // if this is in the init list, it will run before m_addrLen, so it won't work :/ +CSession::CSession() + : m_addrLen(sizeof(m_addr)) { + m_sockfd = Hyprutils::OS::CFileDescriptor{accept(g_pServer->getSocket()->get(), reinterpret_cast(&m_addr), &m_addrLen)}; // if this is in the init list, it will run before m_addrLen, so it won't work :/ if (!m_sockfd.isValid()) throw std::runtime_error("session: Failed to create socket"); - inet_ntop(AF_INET, &m_addr.sin_addr, m_ip, INET_ADDRSTRLEN); - m_port = ntohs(m_addr.sin_port); - log(TRACE, "session({}): connected on port {}", m_ip, m_port); + inet_ntop(AF_INET, &m_addr.sin_addr, m_ip, INET_ADDRSTRLEN); + m_port = ntohs(m_addr.sin_port); + log(TRACE, "session({}): connected on port {}", m_ip, m_port); log(TRACE, "session: initialized"); } -- cgit v1.2.3