diff options
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 66514b8e5..936742e7b 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -537,6 +537,28 @@ static void | |||
537 | plugin_env_address_change_notification (void *cls, int add_remove, | 537 | plugin_env_address_change_notification (void *cls, int add_remove, |
538 | const struct GNUNET_HELLO_Address *address) | 538 | const struct GNUNET_HELLO_Address *address) |
539 | { | 539 | { |
540 | static int addresses = 0; | ||
541 | struct GNUNET_STATISTICS_Handle *cfg = GST_stats; | ||
542 | |||
543 | if (GNUNET_YES == add_remove) | ||
544 | { | ||
545 | addresses ++; | ||
546 | GNUNET_STATISTICS_update (cfg, "# transport addresses", 1, GNUNET_NO); | ||
547 | } | ||
548 | else if (GNUNET_NO == add_remove) | ||
549 | { | ||
550 | if (0 == addresses) | ||
551 | GNUNET_break (0); | ||
552 | else | ||
553 | { | ||
554 | addresses --; | ||
555 | GNUNET_STATISTICS_update (cfg, "# transport addresses", -1, GNUNET_NO); | ||
556 | } | ||
557 | } | ||
558 | |||
559 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | ||
560 | "Transport now has %u addresses to communicate\n", addresses); | ||
561 | |||
540 | GST_hello_modify_addresses (add_remove, address); | 562 | GST_hello_modify_addresses (add_remove, address); |
541 | } | 563 | } |
542 | 564 | ||