diff options
author | Max Kellermann <max@duempel.org> | 2015-02-10 20:30:10 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-02-10 22:06:06 +0100 |
commit | 4e30e747390ac6bb6a6e5ededfbcdae937579393 (patch) | |
tree | beb2d9acd687a62d476e796114efd8ea6b2f69ad /src/output/plugins | |
parent | 42890b9acf50c4406b61b3b37078c00ec79411fa (diff) |
net/SocketAddress: light wrapper for struct sockaddr
Diffstat (limited to 'src/output/plugins')
-rw-r--r-- | src/output/plugins/httpd/HttpdInternal.hxx | 3 | ||||
-rw-r--r-- | src/output/plugins/httpd/HttpdOutputPlugin.cxx | 10 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/output/plugins/httpd/HttpdInternal.hxx b/src/output/plugins/httpd/HttpdInternal.hxx index d3ea49cd4..c9f983e17 100644 --- a/src/output/plugins/httpd/HttpdInternal.hxx +++ b/src/output/plugins/httpd/HttpdInternal.hxx @@ -259,8 +259,7 @@ public: private: virtual void RunDeferred() override; - virtual void OnAccept(int fd, const sockaddr &address, - size_t address_length, int uid) override; + void OnAccept(int fd, SocketAddress address, int uid) override; }; extern const class Domain httpd_output_domain; diff --git a/src/output/plugins/httpd/HttpdOutputPlugin.cxx b/src/output/plugins/httpd/HttpdOutputPlugin.cxx index 05e3d53d0..89dbcb85f 100644 --- a/src/output/plugins/httpd/HttpdOutputPlugin.cxx +++ b/src/output/plugins/httpd/HttpdOutputPlugin.cxx @@ -26,6 +26,7 @@ #include "encoder/EncoderPlugin.hxx" #include "encoder/EncoderList.hxx" #include "net/Resolver.hxx" +#include "net/SocketAddress.hxx" #include "Page.hxx" #include "IcyMetaDataServer.hxx" #include "system/fd_util.h" @@ -201,16 +202,14 @@ HttpdOutput::RunDeferred() } void -HttpdOutput::OnAccept(int fd, const sockaddr &address, - size_t address_length, gcc_unused int uid) +HttpdOutput::OnAccept(int fd, SocketAddress address, gcc_unused int uid) { /* the listener socket has become readable - a client has connected */ #ifdef HAVE_LIBWRAP - if (address.sa_family != AF_UNIX) { - const auto hostaddr = sockaddr_to_string(&address, - address_length); + if (address.GetFamily() != AF_UNIX) { + const auto hostaddr = sockaddr_to_string(address); // TODO: shall we obtain the program name from argv[0]? const char *progname = "mpd"; @@ -230,7 +229,6 @@ HttpdOutput::OnAccept(int fd, const sockaddr &address, } #else (void)address; - (void)address_length; #endif /* HAVE_WRAP */ const ScopeLock protect(mutex); |