fixed buffer not empty

This commit is contained in:
Benedikt Galbavy 2023-10-18 01:11:49 +02:00
parent 49b4daae83
commit e0501259a7

View File

@ -190,7 +190,7 @@ void *clientCommunication(void *data)
return NULL;
}
std::string incomplete_message;
std::string incomplete_message = "";
do {
size = recv(*current_socket, buffer, BUF - 1, 0);
@ -267,11 +267,13 @@ void *clientCommunication(void *data)
break;
}
if (send(*current_socket, "OK", 3, 0) == -1) {
if (send(*current_socket, "OK\n", 3, 0) == -1) {
perror("send answer failed");
return NULL;
}
incomplete_message.clear();
} while (strcmp(buffer, "quit") != 0 && !abortRequested);
// closes/frees the descriptor if not already