summaryrefslogtreecommitdiff
path: root/src/Listen.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-11-10 20:43:14 +0100
committerMax Kellermann <max@musicpd.org>2017-11-10 20:43:14 +0100
commit0ff4350352e58bcd633b328871a423665143dfd9 (patch)
tree1c0f7627c1e2b417e2998cae3c784d3899c0769f /src/Listen.cxx
parent5fd2b7cc796ffa5003604a0ed55da8e79b8307a5 (diff)
event/ServerSocket: pass UniqueSocketDescriptor by value
Passing it by value is actually smaller (32 bit) than the rvalue reference (64 bit pointer), and it ensures that the object is consumed after the call returns, no matter how the methods are implemented.
Diffstat (limited to 'src/Listen.cxx')
-rw-r--r--src/Listen.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Listen.cxx b/src/Listen.cxx
index 3faccc954..987737f9f 100644
--- a/src/Listen.cxx
+++ b/src/Listen.cxx
@@ -24,6 +24,7 @@
#include "config/ConfigGlobal.hxx"
#include "config/ConfigOption.hxx"
#include "net/SocketAddress.hxx"
+#include "net/UniqueSocketDescriptor.hxx"
#include "event/ServerSocket.hxx"
#include "system/Error.hxx"
#include "util/RuntimeError.hxx"
@@ -50,7 +51,7 @@ public:
:ServerSocket(_loop), partition(_partition) {}
private:
- void OnAccept(UniqueSocketDescriptor &&fd,
+ void OnAccept(UniqueSocketDescriptor fd,
SocketAddress address, int uid) override {
client_new(GetEventLoop(), partition,
std::move(fd), address, uid);