summaryrefslogtreecommitdiff
path: root/src/transport/transport_api_monitor_plugins.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-22 22:10:15 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-22 22:10:15 +0000
commitb7585254768daa9b64fc33fb2562293c6fe3fc16 (patch)
tree3e5f824c8ad07a37988a7605bce47e85ffe58943 /src/transport/transport_api_monitor_plugins.c
parent15a1ecaaeb9aa1aebba7404993e1b6945bbc014e (diff)
simplify logic, do not report monitoring events for sessions in destroy, indentation, doxygen -- may help/fix #3591
Diffstat (limited to 'src/transport/transport_api_monitor_plugins.c')
-rw-r--r--src/transport/transport_api_monitor_plugins.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/transport/transport_api_monitor_plugins.c b/src/transport/transport_api_monitor_plugins.c
index 7c11194f2..f313bdfe9 100644
--- a/src/transport/transport_api_monitor_plugins.c
+++ b/src/transport/transport_api_monitor_plugins.c
@@ -179,21 +179,6 @@ free_entry (void *cls,
/**
- * We got disconnected, remove all existing entries from
- * the map and notify client.
- *
- * @param pm montitor that got disconnected
- */
-static void
-clear_map (struct GNUNET_TRANSPORT_PluginMonitor *pm)
-{
- GNUNET_CONTAINER_multihashmap32_iterate (pm->sessions,
- &free_entry,
- pm);
-}
-
-
-/**
* Cut the existing connection and reconnect.
*
* @param pm our context
@@ -203,7 +188,9 @@ reconnect_plugin_ctx (struct GNUNET_TRANSPORT_PluginMonitor *pm)
{
GNUNET_CLIENT_disconnect (pm->client);
pm->client = NULL;
- clear_map (pm);
+ GNUNET_CONTAINER_multihashmap32_iterate (pm->sessions,
+ &free_entry,
+ pm);
pm->backoff = GNUNET_TIME_STD_BACKOFF (pm->backoff);
pm->reconnect_task = GNUNET_SCHEDULER_add_delayed (pm->backoff,
&do_plugin_connect,
@@ -447,7 +434,9 @@ GNUNET_TRANSPORT_monitor_plugins_cancel (struct GNUNET_TRANSPORT_PluginMonitor *
GNUNET_SCHEDULER_cancel (pm->reconnect_task);
pm->reconnect_task = NULL;
}
- clear_map (pm);
+ GNUNET_CONTAINER_multihashmap32_iterate (pm->sessions,
+ &free_entry,
+ pm);
GNUNET_CONTAINER_multihashmap32_destroy (pm->sessions);
GNUNET_free (pm);
}