From ce7979bd7d6278bc1b67cf46a73a3d23e02a6ae5 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 11 Dec 2019 12:31:21 +0000 Subject: Extract port binding code to a function and improve output. --- src/configreader.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/configreader.cpp') 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 tag at " << fp.tag->getTagLocation() << std::endl; } } } -- cgit v1.3.1-10-gc9f91 From 20fa9e1038ee3d5c2d0c89bf7e8e6dcda0644aa6 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 16 Dec 2019 14:22:26 +0000 Subject: Use FindUUID in place of FindNick in places that only get a UUID. --- src/configreader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 0f2063a60..31bbfa954 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -520,7 +520,7 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) } } - User* user = useruid.empty() ? NULL : ServerInstance->FindNick(useruid); + User* user = useruid.empty() ? NULL : ServerInstance->FindUUID(useruid); if (!valid) { @@ -704,7 +704,7 @@ void ConfigReaderThread::Finish() ServerInstance->Users.RehashCloneCounts(); ServerInstance->XLines->CheckELines(); ServerInstance->XLines->ApplyLines(); - User* user = ServerInstance->FindNick(TheUserUID); + User* user = ServerInstance->FindUUID(TheUserUID); ConfigStatus status(user); const ModuleManager::ModuleMap& mods = ServerInstance->Modules->GetModules(); -- cgit v1.3.1-10-gc9f91