summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-12-11 12:31:21 +0000
committerPeter Powell <petpow@saberuk.com>2019-12-12 14:37:38 +0000
commitce7979bd7d6278bc1b67cf46a73a3d23e02a6ae5 (patch)
treeb0e8ac9caac91b330e65981f6be4df7642eba916 /src/configreader.cpp
parenta1c127aef6e1833cb480a8f37f75029c46256661 (diff)
Extract port binding code to a function and improve output.
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 2a1da8fd8..0f2063a60 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -510,13 +510,12 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
ServerInstance->BindPorts(pl);
if (pl.size())
{
- errstr << "Not all your client ports could be bound." << std::endl
- << "The following port(s) failed to bind:" << std::endl;
-
- int j = 1;
- for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++)
+ std::cout << "Warning! Some of your listener" << (pl.size() == 1 ? "s" : "") << " failed to bind:" << std::endl;
+ for (FailedPortList::const_iterator iter = pl.begin(); iter != pl.end(); ++iter)
{
- errstr << j << ".\tAddress: " << i->first.str() << "\tReason: " << strerror(i->second) << std::endl;
+ const FailedPort& fp = *iter;
+ errstr << " " << fp.sa.str() << ": " << strerror(fp.error) << std::endl
+ << " " << "Created from <bind> tag at " << fp.tag->getTagLocation() << std::endl;
}
}
}