added more error info for failed servicePerm packet. Fixed small bug in GXS-distantChat. Data passes through. Crypto still pending.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7379 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-05-26 21:44:16 +00:00
parent b6c68d1812
commit b7f794c37d
2 changed files with 7 additions and 4 deletions

View File

@ -156,7 +156,7 @@ bool p3ServiceServer::sendItem(RsRawItem *item)
// Packet Filtering.
if (!mServiceControl->checkFilter(item->PacketId() & 0xffffff00, item->PeerId()))
{
std::cerr << "p3ServiceServer::sendItem() Fails Filtering";
std::cerr << "p3ServiceServer::sendItem() Fails Filtering for packet id=" << std::hex << item->PacketId() << ", and peer " << item->PeerId() << std::endl;
delete item;
return false;
}

View File

@ -51,7 +51,7 @@
* #define CHAT_DEBUG 1
* #define DEBUG_DISTANT_CHAT 1
****/
#define DEBUG_DISTANT_CHAT 1
//#define DEBUG_DISTANT_CHAT 1
static const int CONNECTION_CHALLENGE_MAX_COUNT = 20 ; // sends a connection challenge every 20 messages
static const time_t CONNECTION_CHALLENGE_MAX_MSG_AGE = 30 ; // maximum age of a message to be used in a connection challenge
@ -311,13 +311,16 @@ bool p3ChatService::getHashFromVirtualPeerId(const TurtleVirtualPeerId& vpid,Tur
void p3ChatService::sendPrivateChatItem(RsChatItem *item)
{
TurtleFileHash hash ;
TurtleFileHash hash = hashFromDistantChatPeerId(item->PeerId());
if(getHashFromVirtualPeerId(item->PeerId(),hash)) // the hash is not used here. That can be optimized.
std::map<RsFileHash,DistantChatPeerInfo>::const_iterator it = _distant_chat_peers.find(hash) ;
if(it != _distant_chat_peers.end())
{
#ifdef CHAT_DEBUG
std::cerr << "p3ChatService::sendPrivateChatItem(): sending to " << item->PeerId() << ": interpreted as a distant chat virtual peer id." << std::endl;
#endif
item->PeerId(it->second.virtual_peer_id) ;
sendTurtleData(item) ;
}
else