diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/listensocket.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/listensocket.cpp b/src/listensocket.cpp index 8c5fda59a..d7217650e 100644 --- a/src/listensocket.cpp +++ b/src/listensocket.cpp @@ -83,6 +83,11 @@ ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_t #endif } + SocketEngine::SetReuse(fd); + int rv = SocketEngine::Bind(this->fd, bind_to); + if (rv >= 0) + rv = SocketEngine::Listen(this->fd, ServerInstance->Config->MaxConn); + if (bind_to.family() == AF_UNIX) { const std::string permissionstr = tag->getString("permissions"); @@ -91,11 +96,6 @@ ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_t chmod(bind_to.str().c_str(), permissions); } - SocketEngine::SetReuse(fd); - int rv = SocketEngine::Bind(this->fd, bind_to); - if (rv >= 0) - rv = SocketEngine::Listen(this->fd, ServerInstance->Config->MaxConn); - // Default defer to on for TLS listeners because in TLS the client always speaks first int timeout = tag->getDuration("defer", (tag->getString("ssl").empty() ? 0 : 3)); if (timeout && !rv) |