Changeset - 05ff592fd0e1
[Not reviewed]
0 2 0
HanzZ - 14 years ago 2011-07-21 22:52:41
hanzz.k@gmail.com
Remove backend from backends list immediatelly after disconnection
2 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
spectrum/src/sample.cfg
Show inline comments
 
@@ -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]
src/networkpluginserver.cpp
Show inline comments
 
@@ -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);
 
	}
 
}
0 comments (0 inline, 0 general)