From d707347519fe5a8947a324de7cfb00076b3de633 Mon Sep 17 00:00:00 2001 From: Rapha Date: Mon, 21 Sep 2026 19:45:07 +0200 Subject: [PATCH] fix: remove Server GoodBye Message, because of catch 22: we can only have one poll and must only write if socket has POLLOUT state --- includes/Server.hpp | 2 +- srcs/server/Server.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Server.hpp b/includes/Server.hpp index c16ecde..7235612 100644 --- a/includes/Server.hpp +++ b/includes/Server.hpp @@ -59,7 +59,7 @@ class Server { void processServerSocketData_(); void acceptClient_(int const serverFd); void processClientSockets_(); - void removeClientSocketPfd_(int const fd, std::string const &msg); + void removeClientSocketPfd_(int const fd, std::string const &msg = ""); void storePollFd_(int const socketFd, bool srvSocket); void removePollFd_(int const fd); void setPolloutInterest_(int const fd); diff --git a/srcs/server/Server.cpp b/srcs/server/Server.cpp index a7121b1..1db2f8b 100644 --- a/srcs/server/Server.cpp +++ b/srcs/server/Server.cpp @@ -35,7 +35,7 @@ Server::Server(int const port, std::string const &password) Server::~Server() { while (!pollFds_.empty()) { int const fd = pollFds_.back().fd; - removeClientSocketPfd_(fd, "Server shutdown - goodbye"); + removeClientSocketPfd_(fd); } }