diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-16 14:43:59 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-16 14:43:59 +0000 |
commit | 917c016f45fc4415be1e75500d43eaa095026d0a (patch) | |
tree | 7c655737327e41b0725f9d71a1c1a6362b64ef04 /src/transport | |
parent | 99bf44f32c29c327f013db2e4406a2242606c1d5 (diff) | |
download | gnunet-917c016f45fc4415be1e75500d43eaa095026d0a.tar.gz gnunet-917c016f45fc4415be1e75500d43eaa095026d0a.zip |
changes
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 22 | ||||
-rw-r--r-- | src/transport/transport_api.c | 3 |
2 files changed, 17 insertions, 8 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 3afb11560..67a9b303b 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -706,6 +706,10 @@ call_continuation (struct UDP_MessageWrapper *udpw, int result) | |||
706 | "# bytes overhead transmitted via UDP", | 706 | "# bytes overhead transmitted via UDP", |
707 | udpw->msg_size - udpw->payload_size, GNUNET_NO); | 707 | udpw->msg_size - udpw->payload_size, GNUNET_NO); |
708 | } | 708 | } |
709 | GNUNET_STATISTICS_update (plugin->env->stats, | ||
710 | "# bytes payload transmitted via UDP", | ||
711 | udpw->payload_size, GNUNET_NO); | ||
712 | |||
709 | udpw->cont (udpw->cont_cls, &udpw->session->target, result, | 713 | udpw->cont (udpw->cont_cls, &udpw->session->target, result, |
710 | udpw->payload_size, udpw->msg_size); | 714 | udpw->payload_size, udpw->msg_size); |
711 | } | 715 | } |
@@ -1782,18 +1786,24 @@ read_process_ack (struct Plugin *plugin, | |||
1782 | } | 1786 | } |
1783 | } | 1787 | } |
1784 | 1788 | ||
1789 | GNUNET_STATISTICS_update (plugin->env->stats, | ||
1790 | "# bytes payload transmitted via UDP", | ||
1791 | s->frag_ctx->payload_size, GNUNET_NO); | ||
1792 | |||
1793 | if (s->frag_ctx->on_wire_size >= s->frag_ctx->payload_size) | ||
1794 | { | ||
1795 | GNUNET_STATISTICS_update (plugin->env->stats, | ||
1796 | "# bytes overhead transmitted via UDP", | ||
1797 | s->frag_ctx->on_wire_size - s->frag_ctx->payload_size, GNUNET_NO); | ||
1798 | } | ||
1799 | |||
1800 | |||
1785 | if (s->frag_ctx->cont != NULL) | 1801 | if (s->frag_ctx->cont != NULL) |
1786 | { | 1802 | { |
1787 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1803 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1788 | "Calling continuation for fragmented message to `%s' with result %s\n", | 1804 | "Calling continuation for fragmented message to `%s' with result %s\n", |
1789 | GNUNET_i2s (&s->target), "OK"); | 1805 | GNUNET_i2s (&s->target), "OK"); |
1790 | 1806 | ||
1791 | if (s->frag_ctx->on_wire_size >= s->frag_ctx->payload_size) | ||
1792 | { | ||
1793 | GNUNET_STATISTICS_update (plugin->env->stats, | ||
1794 | "# bytes overhead transmitted via UDP", | ||
1795 | s->frag_ctx->on_wire_size - s->frag_ctx->payload_size, GNUNET_NO); | ||
1796 | } | ||
1797 | s->frag_ctx->cont (s->frag_ctx->cont_cls, &udp_ack->sender, GNUNET_OK, | 1807 | s->frag_ctx->cont (s->frag_ctx->cont_cls, &udp_ack->sender, GNUNET_OK, |
1798 | s->frag_ctx->payload_size, s->frag_ctx->on_wire_size); | 1808 | s->frag_ctx->payload_size, s->frag_ctx->on_wire_size); |
1799 | } | 1809 | } |
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index a6496c973..49f82e66b 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -525,12 +525,11 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
525 | if (n == NULL) | 525 | if (n == NULL) |
526 | break; | 526 | break; |
527 | 527 | ||
528 | GNUNET_assert (0 == n->traffic_overhead); | ||
529 | if (bytes_physical >= bytes_msg) | 528 | if (bytes_physical >= bytes_msg) |
530 | { | 529 | { |
531 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Overhead for %u byte message: %u \n", | 530 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Overhead for %u byte message: %u \n", |
532 | bytes_msg, bytes_physical - bytes_msg); | 531 | bytes_msg, bytes_physical - bytes_msg); |
533 | n->traffic_overhead = bytes_physical - bytes_msg; | 532 | n->traffic_overhead += bytes_physical - bytes_msg; |
534 | } | 533 | } |
535 | GNUNET_break (GNUNET_NO == n->is_ready); | 534 | GNUNET_break (GNUNET_NO == n->is_ready); |
536 | n->is_ready = GNUNET_YES; | 535 | n->is_ready = GNUNET_YES; |