released timing constraint a little bit for distant chat (last setting would make it unstable)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8041 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-03-17 21:16:15 +00:00
parent 13b964d0f5
commit 5fc269bcff

View File

@ -77,7 +77,7 @@ void DistantChatService::flush()
for(std::map<RsGxsId,DistantChatPeerInfo>::iterator it(_distant_chat_contacts.begin());it!=_distant_chat_contacts.end();++it) for(std::map<RsGxsId,DistantChatPeerInfo>::iterator it(_distant_chat_contacts.begin());it!=_distant_chat_contacts.end();++it)
{ {
if(it->second.last_contact+8+DISTANT_CHAT_KEEP_ALIVE_TIMEOUT < now && it->second.status == RS_DISTANT_CHAT_STATUS_CAN_TALK) if(it->second.last_contact+20+DISTANT_CHAT_KEEP_ALIVE_TIMEOUT < now && it->second.status == RS_DISTANT_CHAT_STATUS_CAN_TALK)
{ {
std::cerr << "(II) DistantChatService:: connexion interrupted with peer." << std::endl; std::cerr << "(II) DistantChatService:: connexion interrupted with peer." << std::endl;
it->second.status = RS_DISTANT_CHAT_STATUS_TUNNEL_DN ; it->second.status = RS_DISTANT_CHAT_STATUS_TUNNEL_DN ;
@ -86,10 +86,13 @@ void DistantChatService::flush()
// Also reset turtle router monitoring so as to make the tunnel handling more responsive. If we don't do that, // Also reset turtle router monitoring so as to make the tunnel handling more responsive. If we don't do that,
// the TR will wait 60 secs for the tunnel to die, which causes a significant waiting time in the chat window. // the TR will wait 60 secs for the tunnel to die, which causes a significant waiting time in the chat window.
if(it->second.direction == RsTurtleGenericTunnelItem::DIRECTION_SERVER)
{
std::cerr << "(II) DistantChatService:: forcing new tunnel campain." << std::endl; std::cerr << "(II) DistantChatService:: forcing new tunnel campain." << std::endl;
mTurtle->forceReDiggTunnels( hashFromGxsId(it->first) ); mTurtle->forceReDiggTunnels( hashFromGxsId(it->first) );
} }
}
if(it->second.last_keep_alive_sent + DISTANT_CHAT_KEEP_ALIVE_TIMEOUT < now && it->second.status == RS_DISTANT_CHAT_STATUS_CAN_TALK) if(it->second.last_keep_alive_sent + DISTANT_CHAT_KEEP_ALIVE_TIMEOUT < now && it->second.status == RS_DISTANT_CHAT_STATUS_CAN_TALK)
{ {
RsChatStatusItem *cs = new RsChatStatusItem ; RsChatStatusItem *cs = new RsChatStatusItem ;