summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-12 23:14:56 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-12 23:14:56 +0000
commitf09dc35b5b03eb19e70333fbb8e5fe6f92c7edee (patch)
tree404e036772894a0d4bcccd788880363c610c9af1 /src/configreader.cpp
parent0f620f80560644de2208c33f16cf4018780e9f43 (diff)
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
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp13
1 files changed, 12 insertions, 1 deletions
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() ? "<all>" : i->first.c_str(), (unsigned long)i->second);
+ }
+ }
+
if (!removed_modules.empty())
for (std::vector<std::string>::iterator removing = removed_modules.begin(); removing != removed_modules.end(); removing++)
{