From c84178c9bcbab5cb8fcff7a576a6892fcec23cc7 Mon Sep 17 00:00:00 2001 From: aortigos Date: Fri, 17 Apr 2026 14:34:15 +0200 Subject: [PATCH] Nick fixed --- Server/Server.cpp | 6 ++++-- commands/nick.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Server/Server.cpp b/Server/Server.cpp index 0de9cb7..febd771 100644 --- a/Server/Server.cpp +++ b/Server/Server.cpp @@ -60,7 +60,9 @@ int Server::run() { while (true) { - poll(this->fds.data(), this->fds.size(), -1); + int ret = poll(this->fds.data(), this->fds.size(), -1); + if (ret < 0) + break ; for(unsigned int i = 0; i < this->fds.size(); i++) { @@ -114,7 +116,7 @@ void Server::readClient(int fd) while ((pos = clientBuf.find('\n')) != std::string::npos) { std::string line = clientBuf.substr(0, pos); - clients[fd].clearBuffer(); + clientBuf = clientBuf.substr(pos + 1); if (!line.empty() && line[line.size() - 1] == '\r') line.erase(line.size() - 1); diff --git a/commands/nick.cpp b/commands/nick.cpp index 4a129b6..bec31bc 100644 --- a/commands/nick.cpp +++ b/commands/nick.cpp @@ -6,7 +6,7 @@ /* By: aortigos