fixed bug with /c command

This commit is contained in:
2025-08-10 00:03:01 -06:00
parent 7ff2842d89
commit 17687e3d13
+8 -1
View File
@@ -86,8 +86,15 @@ void *sender(void *arg) {
ListFirst(sendlist);
strcpy(msg, (char*)ListCurr(sendlist));
ListRemove(sendlist);
bytes = send(confd, msg, 128, 0);
bytes = send(confd, msg, 128, 0);
/* Stop execution if the user closes the connection */
if ((strncmp(msg, "/c", 2)) == 0) {
pthread_cancel(receive_thread);
pthread_cancel(input_thread);
pthread_cancel(output_thread);
pthread_exit(&closed);
}
/* Check if the message was the command to close the connection */
if ((strncmp(msg, "/c", 2)) == 0) {
pthread_cancel(receive_thread);