Nick fixed

This commit is contained in:
aortigos
2026-04-17 14:34:15 +02:00
parent 49fa432411
commit c84178c9bc
2 changed files with 8 additions and 4 deletions

View File

@@ -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);