Skip to content
Snippets Groups Projects
Commit 7b94a85b authored by Abhisha Nirmalathas's avatar Abhisha Nirmalathas
Browse files

Merge branch 'master' into 'feat/cookie'

# Conflicts:
#   http-server.c
parents c2eaa8f5 ec839110
No related branches found
No related tags found
2 merge requests!2Feat/cookie,!1Feat/cookie
......@@ -41,10 +41,14 @@ static int const HTTP_400_LENGTH = 47;
static char const * const HTTP_404 = "HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\n\r\n";
static int const HTTP_404_LENGTH = 45;
<<<<<<< http-server.c
// global structures required for memory deallocation
static Request* req;
static User_list* user_list;
int keep_alive = 1;
=======
volatile sig_atomic_t kill;
>>>>>>> http-server.c
bool player_session(char* buff, int sockfd, char* file_name, char* response){
......@@ -371,14 +375,19 @@ static bool handle_http_request(int sockfd, User_list *user_list){
return true;
}
static void exit_handler(int sig){
void exit_handler(int signum){
/**
* Closes TCP Connection
*/
<<<<<<< http-server.c
keep_alive = 0;
if (user_list){
free_users(user_list);
}
=======
kill = 1;
printf("keep alive changed");
>>>>>>> http-server.c
}
......@@ -435,7 +444,7 @@ int main(int argc, char * argv[])
// game players
user_list = initialise_player_list();
signal(SIGINT, exit_handler);
while (keep_alive)
while (!kill)
{
// monitor file descriptors
fd_set readfds = masterfds;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment