Changeset - 3e515d9f15c5
[Not reviewed]
0 2 0
HanzZ - 13 years ago 2012-12-03 11:49:18
hanzz.k@gmail.com
Do not disconnect backend if we received some data from it during ping timer period
2 files changed with 10 insertions and 2 deletions:
0 comments (0 inline, 0 general)
backends/libcommuni/session.cpp
Show inline comments
 
@@ -48,7 +48,7 @@ void MyIrcSession::on_connected() {
 
// 		}
 
	}
 

	
 
	sendCommand(IrcCommand::createCapability("REQ", QStringList("away-notify")));
 
// 	sendCommand(IrcCommand::createCapability("REQ", QStringList("away-notify")));
 

	
 
	for(AutoJoinMap::iterator it = m_autoJoin.begin(); it != m_autoJoin.end(); it++) {
 
		sendCommand(IrcCommand::createJoin(FROM_UTF8(it->second->getChannel()), FROM_UTF8(it->second->getPassword())));
 
@@ -211,9 +211,9 @@ void MyIrcSession::on_numericMessageReceived(IrcMessage *message) {
 
			np->handleSubject(user, TO_UTF8(m->parameters().value(1)) + suffix, m_topicData, nick);
 
			break;
 
		case 352:
 
			if (m->parameters().value(6).toUpper().startsWith("G")) {
 
				channel = m->parameters().value(1);
 
				nick = TO_UTF8(m->parameters().value(5));
 
			if (m->parameters().value(6).toUpper().startsWith("G")) {
 
				np->handleParticipantChanged(user, nick, TO_UTF8(channel) + suffix, m_modes[TO_UTF8(channel) + nick], pbnetwork::STATUS_AWAY);
 
			}
 
			break;
src/networkpluginserver.cpp
Show inline comments
 
@@ -941,6 +941,14 @@ void NetworkPluginServer::handleDataRead(Backend *c, boost::shared_ptr<Swift::Sa
 
		}
 
		c->data.erase(c->data.begin(), c->data.begin() + 4 + expected_size);
 

	
 
		// If backend is slow and it is sending us lot of message, there is possibility
 
		// that we don't receive PONG response before timeout. However, if we received
 
		// at least some data, it means backend is not dead and we can treat it as
 
		// PONG received event.
 
		if (c->pongReceived == false) {
 
			c->pongReceived = true;
 
		}
 

	
 
		// Handle payload in wrapper message
 
		switch(wrapper.type()) {
 
			case pbnetwork::WrapperMessage_Type_TYPE_CONNECTED:
0 comments (0 inline, 0 general)