aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_tcp.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-03-15 09:55:55 +0000
committerChristian Grothoff <christian@grothoff.org>2010-03-15 09:55:55 +0000
commite1eaa6647595e83d43a629065497ac9c1ac2b0b0 (patch)
tree7b8a9313b0b656fd474c24394d3104db8ee97dd7 /src/transport/plugin_transport_tcp.c
parent0ac493b3ea7a919ba838db053d9a5f2f2e648ec7 (diff)
downloadgnunet-e1eaa6647595e83d43a629065497ac9c1ac2b0b0.tar.gz
gnunet-e1eaa6647595e83d43a629065497ac9c1ac2b0b0.zip
more stats
Diffstat (limited to 'src/transport/plugin_transport_tcp.c')
-rw-r--r--src/transport/plugin_transport_tcp.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 16de7b7e4..892463200 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -369,6 +369,10 @@ do_transmit (void *cls, size_t size, void *buf)
369 pm->message_size, 369 pm->message_size,
370 GNUNET_i2s (&session->target)); 370 GNUNET_i2s (&session->target));
371#endif 371#endif
372 GNUNET_STATISTICS_update (session->plugin->env->stats,
373 gettext_noop ("# bytes discarded by TCP (timeout)"),
374 pm->message_size,
375 GNUNET_NO);
372 if (pm->transmit_cont != NULL) 376 if (pm->transmit_cont != NULL)
373 pm->transmit_cont (pm->transmit_cont_cls, 377 pm->transmit_cont (pm->transmit_cont_cls,
374 &session->target, GNUNET_SYSERR); 378 &session->target, GNUNET_SYSERR);
@@ -583,6 +587,10 @@ tcp_plugin_send (void *cls,
583 struct GNUNET_CONNECTION_Handle *sa; 587 struct GNUNET_CONNECTION_Handle *sa;
584 int af; 588 int af;
585 589
590 GNUNET_STATISTICS_update (plugin->env->stats,
591 gettext_noop ("# bytes TCP was asked to transmit"),
592 msgbuf_size,
593 GNUNET_NO);
586 session = plugin->sessions; 594 session = plugin->sessions;
587 /* FIXME: we could do this a cheaper with a hash table 595 /* FIXME: we could do this a cheaper with a hash table
588 where we could restrict the iteration to entries that match 596 where we could restrict the iteration to entries that match
@@ -607,6 +615,10 @@ tcp_plugin_send (void *cls,
607 "Asked to transmit to `%4s' without address and I have no existing connection (failing).\n", 615 "Asked to transmit to `%4s' without address and I have no existing connection (failing).\n",
608 GNUNET_i2s (target)); 616 GNUNET_i2s (target));
609#endif 617#endif
618 GNUNET_STATISTICS_update (plugin->env->stats,
619 gettext_noop ("# bytes discarded by TCP (no address and no connection)"),
620 msgbuf_size,
621 GNUNET_NO);
610 return -1; 622 return -1;
611 } 623 }
612 if (session == NULL) 624 if (session == NULL)
@@ -632,6 +644,10 @@ tcp_plugin_send (void *cls,
632 GNUNET_i2s (target), 644 GNUNET_i2s (target),
633 GNUNET_a2s (addr, addrlen)); 645 GNUNET_a2s (addr, addrlen));
634#endif 646#endif
647 GNUNET_STATISTICS_update (plugin->env->stats,
648 gettext_noop ("# bytes discarded by TCP (failed to connect)"),
649 msgbuf_size,
650 GNUNET_NO);
635 return -1; 651 return -1;
636 } 652 }
637 653