fixed small bug in global router causing incoming messages to be in SENT mode

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8176 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-04-27 22:01:31 +00:00
parent ff6f14b7de
commit a52031ac58
2 changed files with 94 additions and 89 deletions

View File

@ -197,7 +197,7 @@
#include "grouterclientservice.h" #include "grouterclientservice.h"
/**********************/ /**********************/
//#define GROUTER_DEBUG #define GROUTER_DEBUG
/**********************/ /**********************/
const std::string p3GRouter::SERVICE_INFO_APP_NAME = "Global Router" ; const std::string p3GRouter::SERVICE_INFO_APP_NAME = "Global Router" ;
@ -440,7 +440,7 @@ void p3GRouter::handleLowLevelTransactionAckItem(RsGRouterTransactionAcknItem *t
std::map<GRouterMsgPropagationId, GRouterRoutingInfo>::iterator it=_pending_messages.find(trans_ack_item->propagation_id) ; std::map<GRouterMsgPropagationId, GRouterRoutingInfo>::iterator it=_pending_messages.find(trans_ack_item->propagation_id) ;
if(it != _pending_messages.end()) if(it != _pending_messages.end() && it->second.data_status == RS_GROUTER_DATA_STATUS_ONGOING)
{ {
it->second.data_status = RS_GROUTER_DATA_STATUS_SENT; it->second.data_status = RS_GROUTER_DATA_STATUS_SENT;
it->second.last_sent_TS = time(NULL) ; it->second.last_sent_TS = time(NULL) ;
@ -1522,8 +1522,6 @@ void p3GRouter::handleIncomingDataItem(RsGRouterGenericDataItem *data_item)
else else
std::cerr << " verifying item signature: CHECKED!" ; std::cerr << " verifying item signature: CHECKED!" ;
#endif #endif
// No we need to send a signed receipt to the sender. // No we need to send a signed receipt to the sender.
receipt_item = new RsGRouterSignedReceiptItem; receipt_item = new RsGRouterSignedReceiptItem;

View File

@ -291,6 +291,14 @@ void GlobalRouterStatisticsWidget::updateContent()
painter.setFont(monospace_f) ; painter.setFont(monospace_f) ;
for(std::map<GRouterKeyId,std::vector<float> >::const_iterator it(matrix_info.per_friend_probabilities.begin());it!=matrix_info.per_friend_probabilities.end();++it) for(std::map<GRouterKeyId,std::vector<float> >::const_iterator it(matrix_info.per_friend_probabilities.begin());it!=matrix_info.per_friend_probabilities.end();++it)
{
bool is_null = true ;
for(uint32_t i=0;i<matrix_info.friend_ids.size();++i)
if(it->second[i] > 0.0)
is_null = false ;
if(!is_null)
{ {
QString ids = QString::fromStdString(it->first.toStdString())+" : " ; QString ids = QString::fromStdString(it->first.toStdString())+" : " ;
painter.drawText(ox+2*cellx,oy+celly,ids) ; painter.drawText(ox+2*cellx,oy+celly,ids) ;
@ -300,8 +308,7 @@ void GlobalRouterStatisticsWidget::updateContent()
oy += celly ; oy += celly ;
} }
}
oy += celly ; oy += celly ;
oy += celly ; oy += celly ;