Refactored wmud_client_close()

Removed the error checking TODO comment from wmud_client_close()
as g_socket_close() doesn't necessarily needs to be checked for errors.

Signed-off-by: Gergely POLONKAI <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely POLONKAI 2012-03-23 14:34:49 +01:00
parent 4f601bb3dd
commit 42e0254457

View File

@ -26,15 +26,11 @@ void wmud_client_interpret_newplayer_mailconfirm(wmudClient *client_data);
void void
wmud_client_close(wmudClient *client, gboolean send_goodbye) wmud_client_close(wmudClient *client, gboolean send_goodbye)
{ {
GError *err = NULL;
if (send_goodbye) if (send_goodbye)
{
wmud_client_send(client, "\r\nHave a nice real-world day!\r\n\r\n"); wmud_client_send(client, "\r\nHave a nice real-world day!\r\n\r\n");
}
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "Connection closed."); g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "Connection closed.");
/* TODO: Error checking */ g_socket_close(client->socket, NULL);
g_socket_close(client->socket, &err);
clients = g_slist_remove(clients, client); clients = g_slist_remove(clients, client);
wmud_player_free(&(client->player)); wmud_player_free(&(client->player));
if (client->buffer) if (client->buffer)