/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions>
+ * Copyright (C) 2019-2020 Matt Schatz <genius3000@g3k.solutions>
* Copyright (C) 2013-2016 Attila Molnar <attilamolnar@hush.com>
- * Copyright (C) 2013, 2016-2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2013, 2016-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2013 Daniel Vassdal <shutter@canternet.org>
* Copyright (C) 2013 Adam <Adam@anope.org>
* Copyright (C) 2012 Robby <robby@chatbelgie.be>
#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");
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)
FIRST_MOD_RESULT(OnAcceptConnection, res, (incomingSockfd, this, &client, &server));
if (res == MOD_RES_PASSTHRU)
{
- std::string type = bind_tag->getString("type", "clients");
+ const std::string type = bind_tag->getString("type", "clients", 1);
if (stdalgo::string::equalsci(type, "clients"))
{
ServerInstance->Users->AddUser(incomingSockfd, this, &client, &server);
if (!provname.empty())
provname.insert(0, "ssl/");
- // SSL should be the last
+ // TLS (SSL) should be the last
iohookprovs.back().SetProvider(provname);
}