From ad9f4b8f2dac4202d3d6a83c984157f40a963d4f Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Tue, 21 Feb 2023 12:41:35 +0100 Subject: [PATCH] implemented linked list in chat-server --- src/chat/main/server.c | 1 + src/chat/misc.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/chat/main/server.c b/src/chat/main/server.c index 051d092..8e6f111 100644 --- a/src/chat/main/server.c +++ b/src/chat/main/server.c @@ -48,6 +48,7 @@ int main(void) if (accepted == -1) continue; pthread_create(&thread, NULL, why2_communicate_thread, &accepted); + why2_register_connection(accepted); //PUSH TO LIST } return 0; diff --git a/src/chat/misc.c b/src/chat/misc.c index 0bc7942..8dc14c5 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -152,6 +152,7 @@ void *why2_communicate_thread(void *arg) printf("User exited.\t%d\n", *((int*) arg)); //DEALLOCATION + remove_node(get_node(why2_communicate_thread)); close(*((int*) arg)); why2_deallocate(received);