Remove backend from backends list immediatelly after disconnection
This commit is contained in:
parent
2a09696a8a
commit
05ff592fd0
2 changed files with 6 additions and 6 deletions
|
@ -13,8 +13,8 @@ admin_password=test
|
|||
users_per_backend=1
|
||||
backend=../../backends/libpurple/spectrum_libpurple_backend
|
||||
#backend=../../backends/libircclient-qt/spectrum_libircclient-qt_backend
|
||||
protocol=prpl-jabber
|
||||
#protocol=prpl-msn
|
||||
#protocol=prpl-jabber
|
||||
protocol=prpl-msn
|
||||
#protocol=prpl-icq
|
||||
|
||||
[backend]
|
||||
|
|
|
@ -228,8 +228,8 @@ void NetworkPluginServer::handleSessionFinished(Backend *c) {
|
|||
(*it)->handleDisconnected("Internal Server Error, please reconnect.");
|
||||
}
|
||||
|
||||
// c->connection->onDisconnected.connect(boost::bind(&NetworkPluginServer::handleSessionFinished, this, c));
|
||||
// c->connection->onDataRead.connect(boost::bind(&NetworkPluginServer::handleDataRead, this, c, _1));
|
||||
c->connection->onDisconnected.disconnect(boost::bind(&NetworkPluginServer::handleSessionFinished, this, c));
|
||||
c->connection->onDataRead.disconnect(boost::bind(&NetworkPluginServer::handleDataRead, this, c, _1));
|
||||
|
||||
m_clients.remove(c);
|
||||
delete c;
|
||||
|
@ -569,7 +569,7 @@ void NetworkPluginServer::pingTimeout() {
|
|||
else {
|
||||
LOG4CXX_INFO(logger, "Disconnecting backend " << (*it) << ". PING response not received.");
|
||||
(*it)->connection->disconnect();
|
||||
(*it)->connection.reset();
|
||||
handleSessionFinished((*it));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -715,7 +715,7 @@ void NetworkPluginServer::handleUserDestroyed(User *user) {
|
|||
if (c->users.size() == 0) {
|
||||
LOG4CXX_INFO(logger, "Disconnecting backend " << c << ". There are no users.");
|
||||
c->connection->disconnect();
|
||||
c->connection.reset();
|
||||
handleSessionFinished(c);
|
||||
// m_clients.erase(user->connection);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue