diff --git a/src/Server/Server.cpp b/src/Server/Server.cpp index 4e68fc1..b164d7e 100644 --- a/src/Server/Server.cpp +++ b/src/Server/Server.cpp @@ -110,46 +110,39 @@ void Server::sendData(Client &client, int fd) void Server::readSocket(Client &client, int fd) { - int status; int bytes_read; - // char buf[BUFFSIZE + 1]; std::string stringBUF(BUFFSIZE, 0); DBOUT << TURQ << "IN readSocket" << ENDL; - DBOUT << "client in readSocket "<< &client << ENDL; + // DBOUT << "client in readSocket "<< &client << ENDL; bytes_read = recv(fd, &stringBUF[0], BUFFSIZE, 0); if (bytes_read == 0) { - DBOUT << RED << "bytes_read = 0" << ENDL; - client.allRead = true; - throw std::logic_error("JOPA CLIENTU"); - return; + DBOUT << RED << "bytes_read 0" << ENDL; + client.done = true; } - /* else if (bytes_read == -1) */ - /* throw std::logic_error("JOPA CLIENTU"); */ - // buf[bytes_read + 1] = '\0'; - // DBOUT << stringBUF << ENDL; - stringBUF.erase(bytes_read, stringBUF.size()); - /* DBOUT << "after erase" < &client_map, int fd)