mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 17:09:34 -05:00
fixed bug in distant chat causing multiple tunnels to break the DH session.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7765 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
db565b07b2
commit
f5a30c3d3f
@ -45,7 +45,7 @@
|
|||||||
#include <retroshare/rsids.h>
|
#include <retroshare/rsids.h>
|
||||||
#include "distantchat.h"
|
#include "distantchat.h"
|
||||||
|
|
||||||
#define DEBUG_DISTANT_CHAT
|
//#define DEBUG_DISTANT_CHAT
|
||||||
|
|
||||||
static const uint32_t DISTANT_CHAT_KEEP_ALIVE_TIMEOUT = 15 ; // send keep alive packet so as to avoid tunnel breaks.
|
static const uint32_t DISTANT_CHAT_KEEP_ALIVE_TIMEOUT = 15 ; // send keep alive packet so as to avoid tunnel breaks.
|
||||||
|
|
||||||
@ -189,10 +189,6 @@ void DistantChatService::addVirtualPeer(const TurtleFileHash& hash,const TurtleV
|
|||||||
std::cerr << " Tunnel already registered for " << hash << " and virtual peer " << virtual_peer_id << ". Doing nothing." << std::endl;
|
std::cerr << " Tunnel already registered for " << hash << " and virtual peer " << virtual_peer_id << ". Doing nothing." << std::endl;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
DistantChatDHInfo& dhinfo( _distant_chat_virtual_peer_ids[virtual_peer_id] ) ;
|
|
||||||
dhinfo.gxs_id.clear() ;
|
|
||||||
dhinfo.dh = NULL ;
|
|
||||||
dhinfo.direction = dir ;
|
|
||||||
|
|
||||||
if(dir == RsTurtleGenericTunnelItem::DIRECTION_CLIENT)
|
if(dir == RsTurtleGenericTunnelItem::DIRECTION_CLIENT)
|
||||||
{
|
{
|
||||||
@ -212,14 +208,21 @@ void DistantChatService::addVirtualPeer(const TurtleFileHash& hash,const TurtleV
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(it->second.status == RS_DISTANT_CHAT_STATUS_CAN_TALK)
|
if(it->second.status == RS_DISTANT_CHAT_STATUS_CAN_TALK)
|
||||||
{
|
{
|
||||||
std::cerr << " virtual peer is for a distant chat session that is already openned and alive. Giving it up." << std::endl;
|
std::cerr << " virtual peer is for a distant chat session that is already openned and alive. Giving it up." << std::endl;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
own_gxs_id = it->second.own_gxs_id ;
|
own_gxs_id = it->second.own_gxs_id ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cerr << " Creating new virtual peer ID entry and empty DH session key." << std::endl;
|
||||||
|
|
||||||
|
DistantChatDHInfo& dhinfo( _distant_chat_virtual_peer_ids[virtual_peer_id] ) ;
|
||||||
|
dhinfo.gxs_id.clear() ;
|
||||||
|
dhinfo.dh = NULL ;
|
||||||
|
dhinfo.direction = dir ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_DISTANT_CHAT
|
#ifdef DEBUG_DISTANT_CHAT
|
||||||
|
Loading…
Reference in New Issue
Block a user