diff options
author | Avuton Olrich <avuton@gmail.com> | 2010-05-08 16:48:01 -0700 |
---|---|---|
committer | Avuton Olrich <avuton@gmail.com> | 2010-05-08 16:48:01 -0700 |
commit | 8341daca4a7b9d0274636f760b00539347ac13fb (patch) | |
tree | 9c6d575e791797db90b4f74d5088e9d7b57d7196 /src/client_new.c | |
parent | 136759a298606b9f0c83763962e9d7819ba120c6 (diff) | |
download | mpd-8341daca4a7b9d0274636f760b00539347ac13fb.tar.gz mpd-8341daca4a7b9d0274636f760b00539347ac13fb.tar.xz mpd-8341daca4a7b9d0274636f760b00539347ac13fb.zip |
client_new: Send greeting using send() rather than write().
This is portable for win32 and fixes client logins there.
Diffstat (limited to 'src/client_new.c')
-rw-r--r-- | src/client_new.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client_new.c b/src/client_new.c index beb8e14b7..781a36524 100644 --- a/src/client_new.c +++ b/src/client_new.c @@ -24,6 +24,12 @@ #include "permission.h" #include <assert.h> +#include <sys/types.h> +#ifdef WIN32 +#include <winsock2.h> +#else +#include <sys/socket.h> +#endif #include <unistd.h> #ifdef HAVE_LIBWRAP @@ -111,7 +117,7 @@ void client_new(int fd, const struct sockaddr *sa, size_t sa_length, int uid) client->send_buf_used = 0; - (void)write(fd, GREETING, sizeof(GREETING) - 1); + (void)send(fd, GREETING, sizeof(GREETING) - 1, 0); client_list_add(client); |