aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,
221 struct GNUNET_TIME_Relative ret; 221 struct GNUNET_TIME_Relative ret;
222 struct GNUNET_HELLO_Address address; 222 struct GNUNET_HELLO_Address address;
223 uint16_t type; 223 uint16_t type;
224 static unsigned int bytes_total_received;
225 static unsigned int bytes_payload_received;
226 224
227 address.peer = *peer; 225 address.peer = *peer;
228 address.address = sender_address; 226 address.address = sender_address;
@@ -234,11 +232,10 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
234 type = ntohs (message->type); 232 type = ntohs (message->type);
235 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received Message with type %u\n", type); 233 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received Message with type %u\n", type);
236 234
237 bytes_total_received += ntohs (message->size); 235 GNUNET_STATISTICS_update (GST_stats,
238 GNUNET_STATISTICS_set (GST_stats,
239 gettext_noop 236 gettext_noop
240 ("# bytes total received"), 237 ("# bytes total received"),
241 bytes_total_received, GNUNET_NO); 238 ntohs (message->size), GNUNET_NO);
242 239
243 switch (type) 240 switch (type)
244 { 241 {
@@ -282,11 +279,10 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
282 break; 279 break;
283 default: 280 default:
284 /* should be payload */ 281 /* should be payload */
285 bytes_payload_received += ntohs (message->size); 282 GNUNET_STATISTICS_update (GST_stats,
286 GNUNET_STATISTICS_set (GST_stats, 283 gettext_noop
287 gettext_noop 284 ("# bytes payload received"),
288 ("# bytes payload received"), 285 -ntohs (message->size), GNUNET_NO);
289 bytes_payload_received, GNUNET_NO);
290 ret = process_payload (peer, &address, session, message, ats, ats_count); 286 ret = process_payload (peer, &address, session, message, ats, ats_count);
291 break; 287 break;
292 } 288 }