tester is better, but still cannot reproduce trace error

This commit is contained in:
asus
2023-02-23 02:41:28 +01:00
parent 1e38829e31
commit b3493cf2e5
11 changed files with 35890 additions and 232 deletions

View File

@@ -52,7 +52,7 @@ int main(int argc, char** argv)
exit(1);
}
init(atoi(argv[1]));
fcntl(lsocket, F_SETFL, O_NONBLOCK); // debug
// fcntl(lsocket, F_SETFL, O_NONBLOCK); // debug
while (1)
{
@@ -78,7 +78,7 @@ int main(int argc, char** argv)
if (FD_ISSET(lsocket, &rfds))
{
new_fd = accept(lsocket, NULL, NULL);
fcntl(new_fd, F_SETFL, O_NONBLOCK); // debug
// fcntl(new_fd, F_SETFL, O_NONBLOCK); // debug
last_connected = new_client(new_fd);
sprintf(announce_msg, "server: client %d just arrived\n", last_connected->id);
broadcast(last_connected, announce_msg);
@@ -203,8 +203,8 @@ int read_client(t_client *client)
if (recv_ret > 0)
{
buf[recv_ret] = '\0';
if (recv_ret == 420000) // debug
ft_print(STDERR_FILENO, "Oupsi, ca depasse. Il faut malloc mon petit\n");
// if (recv_ret == 420000) // debug
// ft_print(STDERR_FILENO, "Oupsi, ca depasse. Il faut malloc mon petit\n");
char buf_sprintf[420];
char *msg;