aboutsummaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/client/Client.cxx2
-rw-r--r--src/client/Client.hxx9
-rw-r--r--src/client/ClientEvent.cxx2
-rw-r--r--src/client/ClientExpire.cxx2
-rw-r--r--src/client/ClientFile.cxx12
-rw-r--r--src/client/ClientGlobal.cxx8
-rw-r--r--src/client/ClientIdle.cxx2
-rw-r--r--src/client/ClientInternal.hxx2
-rw-r--r--src/client/ClientList.cxx2
-rw-r--r--src/client/ClientList.hxx2
-rw-r--r--src/client/ClientMessage.cxx2
-rw-r--r--src/client/ClientMessage.hxx2
-rw-r--r--src/client/ClientNew.cxx11
-rw-r--r--src/client/ClientProcess.cxx2
-rw-r--r--src/client/ClientRead.cxx2
-rw-r--r--src/client/ClientSubscribe.cxx2
-rw-r--r--src/client/ClientWrite.cxx2
17 files changed, 33 insertions, 33 deletions
diff --git a/src/client/Client.cxx b/src/client/Client.cxx
index 01ead4645..d5d153a46 100644
--- a/src/client/Client.cxx
+++ b/src/client/Client.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/Client.hxx b/src/client/Client.hxx
index c0a940ded..83909f68b 100644
--- a/src/client/Client.hxx
+++ b/src/client/Client.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -36,7 +36,7 @@
#include <stddef.h>
#include <stdarg.h>
-struct sockaddr;
+class SocketAddress;
class EventLoop;
class Path;
struct Partition;
@@ -200,11 +200,12 @@ private:
virtual void OnTimeout() override;
};
-void client_manager_init(void);
+void
+client_manager_init();
void
client_new(EventLoop &loop, Partition &partition,
- int fd, const sockaddr *sa, size_t sa_length, int uid);
+ int fd, SocketAddress address, int uid);
/**
* Write a C string to the client.
diff --git a/src/client/ClientEvent.cxx b/src/client/ClientEvent.cxx
index fd9f24b0d..cfc638f63 100644
--- a/src/client/ClientEvent.cxx
+++ b/src/client/ClientEvent.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientExpire.cxx b/src/client/ClientExpire.cxx
index 5891756b6..70527312d 100644
--- a/src/client/ClientExpire.cxx
+++ b/src/client/ClientExpire.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientFile.cxx b/src/client/ClientFile.cxx
index 3ea8034d2..72e9d9931 100644
--- a/src/client/ClientFile.cxx
+++ b/src/client/ClientFile.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 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.hxx"
#include "protocol/Ack.hxx"
#include "fs/Path.hxx"
-#include "fs/FileSystem.hxx"
+#include "fs/FileInfo.hxx"
#include "util/Error.hxx"
#include <sys/stat.h>
@@ -47,13 +47,11 @@ Client::AllowFile(Path path_fs, Error &error) const
return false;
}
- struct stat st;
- if (!StatFile(path_fs, st)) {
- error.SetErrno();
+ FileInfo fi;
+ if (!GetFileInfo(path_fs, fi, error))
return false;
- }
- if (st.st_uid != (uid_t)uid && (st.st_mode & 0444) != 0444) {
+ if (fi.GetUid() != (uid_t)uid && (fi.GetMode() & 0444) != 0444) {
/* client is not owner */
error.Set(ack_domain, ACK_ERROR_PERMISSION, "Access denied");
return false;
diff --git a/src/client/ClientGlobal.cxx b/src/client/ClientGlobal.cxx
index 8d90721e9..078fd0981 100644
--- a/src/client/ClientGlobal.cxx
+++ b/src/client/ClientGlobal.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -31,15 +31,15 @@ size_t client_max_output_buffer_size;
void client_manager_init(void)
{
- client_timeout = config_get_positive(CONF_CONN_TIMEOUT,
+ client_timeout = config_get_positive(ConfigOption::CONN_TIMEOUT,
CLIENT_TIMEOUT_DEFAULT);
client_max_command_list_size =
- config_get_positive(CONF_MAX_COMMAND_LIST_SIZE,
+ config_get_positive(ConfigOption::MAX_COMMAND_LIST_SIZE,
CLIENT_MAX_COMMAND_LIST_DEFAULT / 1024)
* 1024;
client_max_output_buffer_size =
- config_get_positive(CONF_MAX_OUTPUT_BUFFER_SIZE,
+ config_get_positive(ConfigOption::MAX_OUTPUT_BUFFER_SIZE,
CLIENT_MAX_OUTPUT_BUFFER_SIZE_DEFAULT / 1024)
* 1024;
}
diff --git a/src/client/ClientIdle.cxx b/src/client/ClientIdle.cxx
index 0b4fa5751..b43647b6c 100644
--- a/src/client/ClientIdle.cxx
+++ b/src/client/ClientIdle.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientInternal.hxx b/src/client/ClientInternal.hxx
index a819d64b8..66bdfbb0f 100644
--- a/src/client/ClientInternal.hxx
+++ b/src/client/ClientInternal.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientList.cxx b/src/client/ClientList.cxx
index a1f286928..43a35798f 100644
--- a/src/client/ClientList.cxx
+++ b/src/client/ClientList.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientList.hxx b/src/client/ClientList.hxx
index 7d20a8737..68292097c 100644
--- a/src/client/ClientList.hxx
+++ b/src/client/ClientList.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientMessage.cxx b/src/client/ClientMessage.cxx
index be6d2f007..84838219e 100644
--- a/src/client/ClientMessage.cxx
+++ b/src/client/ClientMessage.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientMessage.hxx b/src/client/ClientMessage.hxx
index bc6a4cd41..3c39fb9d5 100644
--- a/src/client/ClientMessage.hxx
+++ b/src/client/ClientMessage.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientNew.cxx b/src/client/ClientNew.cxx
index a080e9ec6..8dca9f81f 100644
--- a/src/client/ClientNew.cxx
+++ b/src/client/ClientNew.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -23,7 +23,8 @@
#include "Partition.hxx"
#include "Instance.hxx"
#include "system/fd_util.h"
-#include "system/Resolver.hxx"
+#include "net/SocketAddress.hxx"
+#include "net/Resolver.hxx"
#include "Permission.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
@@ -58,15 +59,15 @@ Client::Client(EventLoop &_loop, Partition &_partition,
void
client_new(EventLoop &loop, Partition &partition,
- int fd, const struct sockaddr *sa, size_t sa_length, int uid)
+ int fd, SocketAddress address, int uid)
{
static unsigned int next_client_num;
- const auto remote = sockaddr_to_string(sa, sa_length);
+ const auto remote = sockaddr_to_string(address);
assert(fd >= 0);
#ifdef HAVE_LIBWRAP
- if (sa->sa_family != AF_UNIX) {
+ if (address.GetFamily() != AF_UNIX) {
// TODO: shall we obtain the program name from argv[0]?
const char *progname = "mpd";
diff --git a/src/client/ClientProcess.cxx b/src/client/ClientProcess.cxx
index 0b6953371..2aec79297 100644
--- a/src/client/ClientProcess.cxx
+++ b/src/client/ClientProcess.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientRead.cxx b/src/client/ClientRead.cxx
index 9cfb1271f..7a1e937ed 100644
--- a/src/client/ClientRead.cxx
+++ b/src/client/ClientRead.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientSubscribe.cxx b/src/client/ClientSubscribe.cxx
index 8ea2e363b..ebc4848f5 100644
--- a/src/client/ClientSubscribe.cxx
+++ b/src/client/ClientSubscribe.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
diff --git a/src/client/ClientWrite.cxx b/src/client/ClientWrite.cxx
index b5d172a8d..a06719770 100644
--- a/src/client/ClientWrite.cxx
+++ b/src/client/ClientWrite.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify