From f09dc35b5b03eb19e70333fbb8e5fe6f92c7edee Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 12 Nov 2006 23:14:56 +0000 Subject: When rehashing and adding new ports, error back to the user if the ports fail to bind git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5730 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/configreader.cpp b/src/configreader.cpp index b0f2d6872..1b38e7155 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -771,10 +771,21 @@ void ServerConfig::Read(bool bail, userrec* user) */ if (!bail) { - int found_ports; + int found_ports = 0; FailedPortList pl; ServerInstance->stats->BoundPortCount = ServerInstance->BindPorts(false, found_ports, pl); + if (pl.size()) + { + user->WriteServ("NOTICE %s :*** Not all your client ports could be bound.", user->nick); + user->WriteServ("NOTICE %s :*** The following port%s failed to bind:", user->nick, found_ports - ServerInstance->stats->BoundPortCount != 1 ? "s" : ""); + int j = 1; + for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++) + { + user->WriteServ("NOTICE %s :*** %d. IP: %s Port: %lu", user->nick, j, i->first.empty() ? "" : i->first.c_str(), (unsigned long)i->second); + } + } + if (!removed_modules.empty()) for (std::vector::iterator removing = removed_modules.begin(); removing != removed_modules.end(); removing++) { -- cgit v1.2.3