fixed bug in global router causing SIGSEGV in some cases

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8247 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-05-14 13:44:57 +00:00
parent c01680808f
commit dcbcd4f556

View File

@ -197,7 +197,7 @@
#include "grouterclientservice.h"
/**********************/
#define GROUTER_DEBUG
//#define GROUTER_DEBUG
/**********************/
const std::string p3GRouter::SERVICE_INFO_APP_NAME = "Global Router" ;
@ -408,7 +408,6 @@ void p3GRouter::handleLowLevelTransactionChunkItem(RsGRouterTransactionChunkItem
RS_STACK_MUTEX(grMtx) ;
generic_item = _incoming_data_pipes[pid].addDataChunk(dynamic_cast<RsGRouterTransactionChunkItem*>(chunk_item->duplicate())) ;// addDataChunk takes ownership over chunk_item
generic_item->PeerId(pid) ;
}
// send to client off-mutex
@ -416,6 +415,8 @@ void p3GRouter::handleLowLevelTransactionChunkItem(RsGRouterTransactionChunkItem
if(generic_item == NULL)
return ;
generic_item->PeerId(pid) ;
#ifdef GROUTER_DEBUG
std::cerr << " transaction is finished. Passing newly created item to client." << std::endl;
std::cerr << " sending a ACK item" << std::endl;
@ -1739,6 +1740,8 @@ bool p3GRouter::decryptDataItem(RsGRouterGenericDataItem *item)
std::cerr << "(EE) Cannot decrypt incoming message. Key " << item->destination_key << " unknown." << std::endl;
else
std::cerr << "(EE) Cannot decrypt incoming message. Unknown error. " << std::endl;
return false ;
}
free(item->data_bytes) ;