From e127e9d00f6313b36132405c4cf75e1a18056139 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Sat, 12 May 2012 12:31:33 +0000 Subject: - stats --- src/transport/gnunet-service-transport.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3