diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-28 16:00:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-28 16:00:44 +0000 |
commit | 8cd6b76a214ff9b4b36f76d9374074ab4520b9f4 (patch) | |
tree | 1d903cca7a71809c4d083d6adfa3949c14ab76d4 /src/transport/plugin_transport_tcp.c | |
parent | 2c2a6b688d158dcc8638bb431b6669894b8b780e (diff) | |
download | gnunet-8cd6b76a214ff9b4b36f76d9374074ab4520b9f4.tar.gz gnunet-8cd6b76a214ff9b4b36f76d9374074ab4520b9f4.zip |
-check on cur_connections
Diffstat (limited to 'src/transport/plugin_transport_tcp.c')
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 874811a7b..5fdffd927 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -2532,6 +2532,10 @@ connect_notify (void *cls, | |||
2532 | struct Plugin *plugin = cls; | 2532 | struct Plugin *plugin = cls; |
2533 | 2533 | ||
2534 | plugin->cur_connections++; | 2534 | plugin->cur_connections++; |
2535 | GNUNET_STATISTICS_set (plugin->env->stats, | ||
2536 | gettext_noop ("# TCP server connections"), | ||
2537 | plugin->cur_connections, | ||
2538 | GNUNET_NO); | ||
2535 | if (plugin->cur_connections != plugin->max_connections) | 2539 | if (plugin->cur_connections != plugin->max_connections) |
2536 | return; | 2540 | return; |
2537 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2541 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -2581,6 +2585,10 @@ disconnect_notify (void *cls, | |||
2581 | } | 2585 | } |
2582 | GNUNET_assert (plugin->cur_connections >= 1); | 2586 | GNUNET_assert (plugin->cur_connections >= 1); |
2583 | plugin->cur_connections--; | 2587 | plugin->cur_connections--; |
2588 | GNUNET_STATISTICS_set (plugin->env->stats, | ||
2589 | gettext_noop ("# TCP server connections"), | ||
2590 | plugin->cur_connections, | ||
2591 | GNUNET_NO); | ||
2584 | GNUNET_STATISTICS_update (session->plugin->env->stats, | 2592 | GNUNET_STATISTICS_update (session->plugin->env->stats, |
2585 | gettext_noop ("# network-level TCP disconnect events"), | 2593 | gettext_noop ("# network-level TCP disconnect events"), |
2586 | 1, | 2594 | 1, |
@@ -3089,8 +3097,9 @@ libgnunet_plugin_transport_tcp_done (void *cls) | |||
3089 | } | 3097 | } |
3090 | GNUNET_CONTAINER_multipeermap_destroy (plugin->nat_wait_conns); | 3098 | GNUNET_CONTAINER_multipeermap_destroy (plugin->nat_wait_conns); |
3091 | GNUNET_CONTAINER_multipeermap_destroy (plugin->sessionmap); | 3099 | GNUNET_CONTAINER_multipeermap_destroy (plugin->sessionmap); |
3092 | GNUNET_free(plugin); | 3100 | GNUNET_break (0 == plugin->cur_connections); |
3093 | GNUNET_free(api); | 3101 | GNUNET_free (plugin); |
3102 | GNUNET_free (api); | ||
3094 | return NULL; | 3103 | return NULL; |
3095 | } | 3104 | } |
3096 | 3105 | ||