From 99aba5667d0d7ba6657f9c175a9342126bc4b0f2 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sat, 22 Feb 2014 21:42:24 +0100 Subject: Connection to servers does not block the process anymore --- src/bridge/bridge.cpp | 4 ++-- src/bridge/bridge.hpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/bridge') diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index bb3bfb0..ed685f9 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -52,7 +52,7 @@ void Bridge::clean() while (it != this->irc_clients.end()) { IrcClient* client = it->second.get(); - if (!client->is_connected()) + if (!client->is_connected() && !client->is_connecting()) it = this->irc_clients.erase(it); else ++it; @@ -249,7 +249,7 @@ std::string Bridge::get_own_nick(const Iid& iid) return ""; } -size_t Bridge::connected_clients() const +size_t Bridge::active_clients() const { return this->irc_clients.size(); } diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp index 58ca24c..e16ea39 100644 --- a/src/bridge/bridge.hpp +++ b/src/bridge/bridge.hpp @@ -105,9 +105,9 @@ public: */ std::string get_own_nick(const Iid& iid); /** - * Get the number of server to which this bridge is connected. + * Get the number of server to which this bridge is connected or connecting. */ - size_t connected_clients() const; + size_t active_clients() const; private: /** @@ -125,7 +125,7 @@ private: * The JID of the user associated with this bridge. Messages from/to this * JID are only managed by this bridge. */ - std::string user_jid; + const std::string user_jid; /** * One IrcClient for each IRC server we need to be connected to. * The pointer is shared by the bridge and the poller. -- cgit v1.2.3