Fix daemon issues

This commit is contained in:
Daniel Zaoui 2017-05-27 20:44:50 +03:00
parent e947be1b85
commit d6146b0778
1 changed files with 2 additions and 1 deletions

View File

@ -360,6 +360,7 @@ _data_receive(Client *c, unsigned char *buffer)
rret = recv(c->fd, &size, sizeof(int), MSG_PEEK);
if (rret == -1 || !size) goto error;
if (rret == sizeof(int))
{
unsigned int cur_packet_size = 0;
@ -549,7 +550,7 @@ static int
_listening_tcp_socket_create()
{
struct sockaddr_in server;
int curstate = 0;
int curstate = 1;
// create the socket
int fd = socket(AF_INET, SOCK_STREAM, 0);
if (fd < 0) goto err;