diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-03-17 16:00:32 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-03-17 16:00:32 +0000 |
commit | f142a06df7bd3223136774dc47fdd1ccd91fb624 (patch) | |
tree | e6d0de2f722a29e3119ffb0b773a6a9b78f37d3c /src | |
parent | 716af5857b059047ddeca165307c9d197f82292d (diff) | |
download | gnunet-f142a06df7bd3223136774dc47fdd1ccd91fb624.tar.gz gnunet-f142a06df7bd3223136774dc47fdd1ccd91fb624.zip |
fixed clean up and improved logging
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index db2adccab..3ccd510f7 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -2510,11 +2510,21 @@ switch_address_bl_check_cont (void *cls, | |||
2510 | blc_ctx->session, | 2510 | blc_ctx->session, |
2511 | GNUNET_i2s (&blc_ctx->address->peer)); | 2511 | GNUNET_i2s (&blc_ctx->address->peer)); |
2512 | } | 2512 | } |
2513 | if (NULL == (papi = GST_plugins_find (blc_ctx->address->transport_name))) | ||
2514 | { | ||
2515 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2516 | "Plugin `%s' for suggested address `%s' session %p for peer `%s' is not available\n", | ||
2517 | blc_ctx->address->transport_name, | ||
2518 | GST_plugins_a2s (blc_ctx->address), | ||
2519 | blc_ctx->session, | ||
2520 | GNUNET_i2s (&blc_ctx->address->peer)); | ||
2521 | } | ||
2513 | /* Delete address (or session if existing) in ATS */ | 2522 | /* Delete address (or session if existing) in ATS */ |
2514 | GNUNET_ATS_address_destroyed (GST_ats, blc_ctx->address, blc_ctx->session); | 2523 | GNUNET_ATS_address_destroyed (GST_ats, blc_ctx->address, blc_ctx->session); |
2515 | 2524 | ||
2525 | /* Remove blacklist check and clean up */ | ||
2516 | GNUNET_CONTAINER_DLL_remove (pending_bc_head, pending_bc_tail, blc_ctx); | 2526 | GNUNET_CONTAINER_DLL_remove (pending_bc_head, pending_bc_tail, blc_ctx); |
2517 | GNUNET_HELLO_address_free(blc_ctx->address); | 2527 | GNUNET_HELLO_address_free (blc_ctx->address); |
2518 | GNUNET_free_non_null (blc_ctx->ats); | 2528 | GNUNET_free_non_null (blc_ctx->ats); |
2519 | GNUNET_free (blc_ctx); | 2529 | GNUNET_free (blc_ctx); |
2520 | return; | 2530 | return; |
@@ -2535,13 +2545,21 @@ switch_address_bl_check_cont (void *cls, | |||
2535 | } | 2545 | } |
2536 | if (NULL == blc_ctx->session) | 2546 | if (NULL == blc_ctx->session) |
2537 | { | 2547 | { |
2548 | /* No session could be obtained, remove blacklist check and clean up */ | ||
2538 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2549 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2539 | "Failed to obtain new session for peer `%s' and address '%s'\n", | 2550 | "Failed to obtain new session for peer `%s' and address '%s'\n", |
2540 | GNUNET_i2s (&blc_ctx->address->peer), | 2551 | GNUNET_i2s (&blc_ctx->address->peer), |
2541 | GST_plugins_a2s (blc_ctx->address)); | 2552 | GST_plugins_a2s (blc_ctx->address)); |
2553 | /* Delete address in ATS */ | ||
2542 | GNUNET_ATS_address_destroyed (GST_ats, blc_ctx->address, NULL); | 2554 | GNUNET_ATS_address_destroyed (GST_ats, blc_ctx->address, NULL); |
2555 | |||
2556 | GNUNET_CONTAINER_DLL_remove (pending_bc_head, pending_bc_tail, blc_ctx); | ||
2557 | GNUNET_HELLO_address_free (blc_ctx->address); | ||
2558 | GNUNET_free_non_null (blc_ctx->ats); | ||
2559 | GNUNET_free (blc_ctx); | ||
2543 | return; | 2560 | return; |
2544 | } | 2561 | } |
2562 | |||
2545 | switch (n->state) | 2563 | switch (n->state) |
2546 | { | 2564 | { |
2547 | case GNUNET_TRANSPORT_PS_NOT_CONNECTED: | 2565 | case GNUNET_TRANSPORT_PS_NOT_CONNECTED: |
@@ -2736,7 +2754,7 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | |||
2736 | return; | 2754 | return; |
2737 | } | 2755 | } |
2738 | 2756 | ||
2739 | /* Obtain an session for this address from plugin */ | 2757 | /* Check if plugin is available */ |
2740 | if (NULL == (papi = GST_plugins_find (address->transport_name))) | 2758 | if (NULL == (papi = GST_plugins_find (address->transport_name))) |
2741 | { | 2759 | { |
2742 | /* we don't have the plugin for this address */ | 2760 | /* we don't have the plugin for this address */ |