From 85fce2f2dc58493ce305c4c83e101bbe2d5aff85 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 19 Oct 2014 12:36:38 +0000 Subject: [PATCH] added missing record of Dn traffic in turtle router git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7622 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/turtle/p3turtle.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 3034d555f..5a7b71d32 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1094,14 +1094,18 @@ void p3turtle::routeGenericTunnelItem(RsTurtleGenericTunnelItem *item) sendItem(item) ; return ; - } - } + } + + // item is for us. Use the locked region to record the data. + + _traffic_info_buffer.data_dn_Bps += item->serial_size() ; + } // The packet was not forwarded, so it is for us. Let's treat it. // This is done off-mutex, to avoid various deadlocks // - handleRecvGenericTunnelItem(item) ; + handleRecvGenericTunnelItem(item) ; delete item ; } @@ -1116,7 +1120,7 @@ void p3turtle::handleRecvGenericTunnelItem(RsTurtleGenericTunnelItem *item) RsPeerId vpid ; RsTurtleClientService *service ; - if(!getTunnelServiceInfo(item->tunnelId(),vpid,hash,service)) + if(!getTunnelServiceInfo(item->tunnelId(),vpid,hash,service)) return ; service->receiveTurtleData(item,hash,vpid,item->travelingDirection()) ;