fix socket close

This commit is contained in:
Xuan Sang LE 2018-03-08 12:38:53 +01:00
parent d39832b981
commit 0733bec252

View File

@ -225,6 +225,7 @@ int main(int argc, char* argv[])
continue; continue;
} }
/* accept_request(client_sock); */ /* accept_request(client_sock); */
client->sock = client_sock;
server_config.connection++; server_config.connection++;
//LOG("Unclosed connection: %d\n", server_config.connection); //LOG("Unclosed connection: %d\n", server_config.connection);
#ifdef USE_OPENSSL #ifdef USE_OPENSSL
@ -241,7 +242,6 @@ int main(int argc, char* argv[])
} }
} }
#endif #endif
client->sock = client_sock;
if (pthread_create(&newthread , NULL,(void *(*)(void *))accept_request, (void *)client) != 0) if (pthread_create(&newthread , NULL,(void *(*)(void *))accept_request, (void *)client) != 0)
{ {
perror("pthread_create"); perror("pthread_create");