mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-29 13:27:59 +03:00
Merge remote-tracking branch 'origin/fara' into roman
This commit is contained in:
@@ -88,18 +88,21 @@ void Server::readSocket(Client &client, int fd)
|
||||
|
||||
int status;
|
||||
int bytes_read;
|
||||
char buf[BUFFSIZE + 1];
|
||||
// char buf[BUFFSIZE + 1];
|
||||
std::string stringBUF(BUFFSIZE, 0);
|
||||
|
||||
DBOUT << TURQ << "IN readSocket" << ENDL;
|
||||
DBOUT << "client in readSocket "<< &client << ENDL;
|
||||
bytes_read = recv(fd, buf, BUFFSIZE, 0);
|
||||
bytes_read = recv(fd, &stringBUF[0], BUFFSIZE, 0);
|
||||
if (bytes_read == 0)
|
||||
{
|
||||
client.allRead = true;
|
||||
return;
|
||||
}
|
||||
buf[bytes_read + 1] = '\0';
|
||||
client.setRawData(buf);
|
||||
// buf[bytes_read + 1] = '\0';
|
||||
stringBUF.erase(bytes_read, stringBUF.size());
|
||||
client.setRawData(stringBUF);
|
||||
// client.setRawData(buf);
|
||||
client.increaseRecvCounter(bytes_read);
|
||||
status = client.parseRequest();
|
||||
// client_map[fd].printClientInfo();
|
||||
|
||||
Reference in New Issue
Block a user