From bcae86196c44baf198534ecec20dc1b8908992f8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 4 Nov 2013 20:10:46 +0100 Subject: [PATCH] event/ServerSocket: open sockets in the order they were configured Use a std::list which can be appended at the end. --- NEWS | 1 + src/event/ServerSocket.cxx | 6 +++--- src/event/ServerSocket.hxx | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 64529812e..0d973584a 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ver 0.18.1 (2013/11/??) - always ignore whitespace at the end of the line * networking: - log UNIX domain path names instead of "localhost" + - open listener sockets in the order they were configured * filter: - autoconvert: fix "volume_normalization" with mp3 files * add missing files to source tarball diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx index 081362882..24213ab9e 100644 --- a/src/event/ServerSocket.cxx +++ b/src/event/ServerSocket.cxx @@ -297,10 +297,10 @@ ServerSocket::Close() OneServerSocket & ServerSocket::AddAddress(const sockaddr &address, size_t address_length) { - sockets.emplace_front(loop, *this, next_serial, - &address, address_length); + sockets.emplace_back(loop, *this, next_serial, + &address, address_length); - return sockets.front(); + return sockets.back(); } bool diff --git a/src/event/ServerSocket.hxx b/src/event/ServerSocket.hxx index 6143d273a..facb10371 100644 --- a/src/event/ServerSocket.hxx +++ b/src/event/ServerSocket.hxx @@ -20,7 +20,7 @@ #ifndef MPD_SERVER_SOCKET_HXX #define MPD_SERVER_SOCKET_HXX -#include +#include #include @@ -41,7 +41,7 @@ class ServerSocket { EventLoop &loop; - std::forward_list sockets; + std::list sockets; unsigned next_serial;