Skip to content

Commit

Permalink
fluid_server_handle_connection() now returns an integer. There was no…
Browse files Browse the repository at this point in the history
… return value before, which was causing TCP/IP connections to immediately close in an undefined manner.
  • Loading branch information
Element-Green committed Jan 19, 2015
1 parent d519d93 commit b75c8fd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fluidsynth/src/bindings/fluid_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,7 @@ struct _fluid_server_t {
fluid_mutex_t mutex;
};

static void fluid_server_handle_connection(fluid_server_t* server,
static int fluid_server_handle_connection(fluid_server_t* server,
fluid_socket_t client_socket,
char* addr);
static void fluid_server_close(fluid_server_t* server);
Expand Down Expand Up @@ -1896,22 +1896,24 @@ static void fluid_server_close(fluid_server_t* server)
}
}

static void
static int
fluid_server_handle_connection(fluid_server_t* server, fluid_socket_t client_socket, char* addr)
{
fluid_client_t* client;
fluid_cmd_handler_t* handler;

handler = server->newclient(server->data, addr);
if (handler == NULL) {
return;
return -1;
}

client = new_fluid_client(server, server->settings, handler, client_socket);
if (client == NULL) {
return;
return -1;
}
fluid_server_add_client(server, client);

return 0;
}

void fluid_server_add_client(fluid_server_t* server, fluid_client_t* client)
Expand Down

0 comments on commit b75c8fd

Please sign in to comment.