aboutsummaryrefslogtreecommitdiffstats
path: root/src/client_new.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/client_new.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/client_new.c b/src/client_new.c
index e764a6550..cf28c43c5 100644
--- a/src/client_new.c
+++ b/src/client_new.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
#include "client_internal.h"
#include "fd_util.h"
#include "fifo_buffer.h"
-#include "socket_util.h"
+#include "resolver.h"
#include "permission.h"
#include "glib_socket.h"
@@ -43,12 +43,15 @@
static const char GREETING[] = "OK MPD " PROTOCOL_VERSION "\n";
-void client_new(int fd, const struct sockaddr *sa, size_t sa_length, int uid)
+void
+client_new(struct player_control *player_control,
+ int fd, const struct sockaddr *sa, size_t sa_length, int uid)
{
static unsigned int next_client_num;
struct client *client;
char *remote;
+ assert(player_control != NULL);
assert(fd >= 0);
#ifdef HAVE_LIBWRAP
@@ -83,6 +86,7 @@ void client_new(int fd, const struct sockaddr *sa, size_t sa_length, int uid)
}
client = g_new0(struct client, 1);
+ client->player_control = player_control;
client->channel = g_io_channel_new_socket(fd);
/* GLib is responsible for closing the file descriptor */
@@ -115,6 +119,10 @@ void client_new(int fd, const struct sockaddr *sa, size_t sa_length, int uid)
client->send_buf_used = 0;
+ client->subscriptions = NULL;
+ client->messages = NULL;
+ client->num_messages = 0;
+
(void)send(fd, GREETING, sizeof(GREETING) - 1, 0);
client_list_add(client);