Commit 811ee766 authored by Simon Wüllhorst's avatar Simon Wüllhorst

Return from message handling after client is freed.

parent 690ae3aa
......@@ -107,9 +107,11 @@ void handle_client_rec(client_info* a_client)
{
printf("handle_client_rec\n");
ssize_t n;
if ((n = Recv(a_client->client_fd, (void*)(a_client->message.buf + a_client->message.buf_offset), BUFFER_SIZE - a_client->message.buf_offset, 0)) == 0)
if ((n = Recv(a_client->client_fd, (void*)(a_client->message.buf + a_client->message.buf_offset), BUFFER_SIZE - a_client->message.buf_offset, 0)) == 0) {
finalize_client(a_client);
printf("Received %zd bytes.\n", n);
return;
}
printf("Received %zd bytes, buf offset: %zd \n", n, a_client->message.buf_offset);
a_client->message.buf_offset = packet_sequenzer(a_client, n);
}
client_info* initialize_client(game_server_info* server_info, int a_client_fd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment