diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-22 22:10:15 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-22 22:10:15 +0000 |
commit | b7585254768daa9b64fc33fb2562293c6fe3fc16 (patch) | |
tree | 3e5f824c8ad07a37988a7605bce47e85ffe58943 /src/transport/transport_api_monitor_plugins.c | |
parent | 15a1ecaaeb9aa1aebba7404993e1b6945bbc014e (diff) | |
download | gnunet-b7585254768daa9b64fc33fb2562293c6fe3fc16.tar.gz gnunet-b7585254768daa9b64fc33fb2562293c6fe3fc16.zip |
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.c | 23 |
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, | |||
179 | 179 | ||
180 | 180 | ||
181 | /** | 181 | /** |
182 | * We got disconnected, remove all existing entries from | ||
183 | * the map and notify client. | ||
184 | * | ||
185 | * @param pm montitor that got disconnected | ||
186 | */ | ||
187 | static void | ||
188 | clear_map (struct GNUNET_TRANSPORT_PluginMonitor *pm) | ||
189 | { | ||
190 | GNUNET_CONTAINER_multihashmap32_iterate (pm->sessions, | ||
191 | &free_entry, | ||
192 | pm); | ||
193 | } | ||
194 | |||
195 | |||
196 | /** | ||
197 | * Cut the existing connection and reconnect. | 182 | * Cut the existing connection and reconnect. |
198 | * | 183 | * |
199 | * @param pm our context | 184 | * @param pm our context |
@@ -203,7 +188,9 @@ reconnect_plugin_ctx (struct GNUNET_TRANSPORT_PluginMonitor *pm) | |||
203 | { | 188 | { |
204 | GNUNET_CLIENT_disconnect (pm->client); | 189 | GNUNET_CLIENT_disconnect (pm->client); |
205 | pm->client = NULL; | 190 | pm->client = NULL; |
206 | clear_map (pm); | 191 | GNUNET_CONTAINER_multihashmap32_iterate (pm->sessions, |
192 | &free_entry, | ||
193 | pm); | ||
207 | pm->backoff = GNUNET_TIME_STD_BACKOFF (pm->backoff); | 194 | pm->backoff = GNUNET_TIME_STD_BACKOFF (pm->backoff); |
208 | pm->reconnect_task = GNUNET_SCHEDULER_add_delayed (pm->backoff, | 195 | pm->reconnect_task = GNUNET_SCHEDULER_add_delayed (pm->backoff, |
209 | &do_plugin_connect, | 196 | &do_plugin_connect, |
@@ -447,7 +434,9 @@ GNUNET_TRANSPORT_monitor_plugins_cancel (struct GNUNET_TRANSPORT_PluginMonitor * | |||
447 | GNUNET_SCHEDULER_cancel (pm->reconnect_task); | 434 | GNUNET_SCHEDULER_cancel (pm->reconnect_task); |
448 | pm->reconnect_task = NULL; | 435 | pm->reconnect_task = NULL; |
449 | } | 436 | } |
450 | clear_map (pm); | 437 | GNUNET_CONTAINER_multihashmap32_iterate (pm->sessions, |
438 | &free_entry, | ||
439 | pm); | ||
451 | GNUNET_CONTAINER_multihashmap32_destroy (pm->sessions); | 440 | GNUNET_CONTAINER_multihashmap32_destroy (pm->sessions); |
452 | GNUNET_free (pm); | 441 | GNUNET_free (pm); |
453 | } | 442 | } |