Compare commits
No commits in common. "07eb5961803775a55f0d9cc0fa86e78c181a5876" and "b3924514861ab51f51117d93fd2e4e520f71f4ff" have entirely different histories.
07eb596180
...
b392451486
@ -46,7 +46,6 @@ typedef struct _connection_node
|
||||
pthread_t thread;
|
||||
char *username;
|
||||
unsigned long id;
|
||||
char *key; //EACH USER WILL USE DIFFERENT KEY FOR COMMUNICATION
|
||||
} connection_node_t; //SINGLE LINKED LIST
|
||||
|
||||
why2_list_t connection_list = WHY2_LIST_EMPTY;
|
||||
@ -659,8 +658,7 @@ void *why2_communicate_thread(void *arg)
|
||||
connection,
|
||||
pthread_self(),
|
||||
why2_strdup(username),
|
||||
get_latest_id(),
|
||||
why2_generate_key(why2_get_key_length())
|
||||
get_latest_id()
|
||||
};
|
||||
|
||||
why2_list_push(&connection_list, &node, sizeof(node)); //ADD TO LIST
|
||||
@ -858,7 +856,6 @@ void *why2_communicate_thread(void *arg)
|
||||
//DEALLOCATION
|
||||
close(connection);
|
||||
why2_deallocate(node.username);
|
||||
why2_deallocate(node.key);
|
||||
|
||||
why2_list_remove(&connection_list, find_connection(connection));
|
||||
|
||||
@ -962,8 +959,6 @@ void *why2_listen_server(void *socket)
|
||||
|
||||
if (server_uname == NULL) //GET SERVER USERNAME
|
||||
{
|
||||
if (code == NULL || strcmp(code, WHY2_CHAT_CODE_ACCEPT_MESSAGES) != 0) goto deallocation;
|
||||
|
||||
server_uname = why2_strdup(username); //GET USERNAME
|
||||
|
||||
//GET INFO
|
||||
@ -1099,14 +1094,13 @@ void *why2_listen_server(void *socket)
|
||||
printf("\n\n%s%s: %s\n\n", WHY2_CLEAR_AND_GO_UP, username, message);
|
||||
}
|
||||
|
||||
|
||||
if (!exiting && !continuing)
|
||||
{
|
||||
printf(">>> ");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
deallocation:
|
||||
|
||||
//DEALLOCATION
|
||||
why2_deallocate(read);
|
||||
why2_deallocate(username);
|
||||
|
Loading…
x
Reference in New Issue
Block a user