summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-05-12 12:31:33 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-05-12 12:31:33 +0000
commite127e9d00f6313b36132405c4cf75e1a18056139 (patch)
tree5cf508412e814de5d0d70a0c59f7752441b30ce6 /src
parentb645cd86afca79fa4c992935e3cc1ddf5e88f166 (diff)
- stats
Diffstat (limited to 'src')
-rw-r--r--src/transport/gnunet-service-transport.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 981cd33fa..c917a461b 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -221,8 +221,6 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
struct GNUNET_TIME_Relative ret;
struct GNUNET_HELLO_Address address;
uint16_t type;
- static unsigned int bytes_total_received;
- static unsigned int bytes_payload_received;
address.peer = *peer;
address.address = sender_address;
@@ -234,11 +232,10 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
type = ntohs (message->type);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received Message with type %u\n", type);
- bytes_total_received += ntohs (message->size);
- GNUNET_STATISTICS_set (GST_stats,
+ GNUNET_STATISTICS_update (GST_stats,
gettext_noop
("# bytes total received"),
- bytes_total_received, GNUNET_NO);
+ ntohs (message->size), GNUNET_NO);
switch (type)
{
@@ -282,11 +279,10 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
break;
default:
/* should be payload */
- bytes_payload_received += ntohs (message->size);
- GNUNET_STATISTICS_set (GST_stats,
- gettext_noop
- ("# bytes payload received"),
- bytes_payload_received, GNUNET_NO);
+ GNUNET_STATISTICS_update (GST_stats,
+ gettext_noop
+ ("# bytes payload received"),
+ -ntohs (message->size), GNUNET_NO);
ret = process_payload (peer, &address, session, message, ats, ats_count);
break;
}