added waitall flag for socket
This commit is contained in:
4
fiche.c
4
fiche.c
@@ -58,7 +58,7 @@ void *thread_connection(void *args)
|
||||
int n;
|
||||
char buffer[BUFSIZE];
|
||||
bzero(buffer, BUFSIZE);
|
||||
int status = recv(connection_socket, buffer, BUFSIZE, 0);
|
||||
int status = recv(connection_socket, buffer, BUFSIZE, MSG_WAITALL);
|
||||
|
||||
if (BANLIST != NULL)
|
||||
if (check_banlist(data.ip_address) != NULL)
|
||||
@@ -102,7 +102,7 @@ void perform_connection(int listen_socket)
|
||||
int connection_socket = accept(listen_socket, (struct sockaddr *) &client_address, (void *) &address_lenght);
|
||||
|
||||
struct timeval timeout;
|
||||
timeout.tv_sec = 10;
|
||||
timeout.tv_sec = 120;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
if (setsockopt (connection_socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout)) < 0)
|
||||
|
||||
Reference in New Issue
Block a user