mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
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:
parent
b6c68d1812
commit
b7f794c37d
@ -156,7 +156,7 @@ bool p3ServiceServer::sendItem(RsRawItem *item)
|
|||||||
// Packet Filtering.
|
// Packet Filtering.
|
||||||
if (!mServiceControl->checkFilter(item->PacketId() & 0xffffff00, item->PeerId()))
|
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;
|
delete item;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
* #define CHAT_DEBUG 1
|
* #define CHAT_DEBUG 1
|
||||||
* #define DEBUG_DISTANT_CHAT 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 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
|
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)
|
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
|
#ifdef CHAT_DEBUG
|
||||||
std::cerr << "p3ChatService::sendPrivateChatItem(): sending to " << item->PeerId() << ": interpreted as a distant chat virtual peer id." << std::endl;
|
std::cerr << "p3ChatService::sendPrivateChatItem(): sending to " << item->PeerId() << ": interpreted as a distant chat virtual peer id." << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
item->PeerId(it->second.virtual_peer_id) ;
|
||||||
sendTurtleData(item) ;
|
sendTurtleData(item) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user