aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_tunnel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/gnunet-service-cadet_tunnel.c')
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index 2d8aa90b6..6e5137925 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -2361,8 +2361,7 @@ GCT_remove_connection (struct CadetTunnel *t,
2361 && CADET_TUNNEL_SHUTDOWN != t->cstate 2361 && CADET_TUNNEL_SHUTDOWN != t->cstate
2362 && GNUNET_NO == shutting_down) 2362 && GNUNET_NO == shutting_down)
2363 { 2363 {
2364 LOG (GNUNET_ERROR_TYPE_DEBUG, " no more connections, getting new ones\n"); 2364 LOG (GNUNET_ERROR_TYPE_DEBUG, " too few connections, getting new ones\n");
2365 GCT_change_cstate (t, CADET_TUNNEL_SEARCHING);
2366 GCP_connect (t->peer); 2365 GCP_connect (t->peer);
2367 return; 2366 return;
2368 } 2367 }
@@ -2674,13 +2673,36 @@ GCT_use_path (struct CadetTunnel *t, struct CadetPeerPath *p)
2674 2673
2675 2674
2676/** 2675/**
2677 * Count created connections of a tunnel. Not necessarily ready connections! 2676 * Count all created connections of a tunnel. Not necessarily ready connections!
2678 * 2677 *
2679 * @param t Tunnel on which to count. 2678 * @param t Tunnel on which to count.
2680 * 2679 *
2681 * @return Number of connections created, either being established or ready. 2680 * @return Number of connections created, either being established or ready.
2682 */ 2681 */
2683unsigned int 2682unsigned int
2683GCT_count_any_connections (struct CadetTunnel *t)
2684{
2685 struct CadetTConnection *iter;
2686 unsigned int count;
2687
2688 if (NULL == t)
2689 return 0;
2690
2691 for (count = 0, iter = t->connection_head; NULL != iter; iter = iter->next)
2692 count++;
2693
2694 return count;
2695}
2696
2697
2698/**
2699 * Count established (ready) connections of a tunnel.
2700 *
2701 * @param t Tunnel on which to count.
2702 *
2703 * @return Number of connections.
2704 */
2705unsigned int
2684GCT_count_connections (struct CadetTunnel *t) 2706GCT_count_connections (struct CadetTunnel *t)
2685{ 2707{
2686 struct CadetTConnection *iter; 2708 struct CadetTConnection *iter;
@@ -2696,6 +2718,7 @@ GCT_count_connections (struct CadetTunnel *t)
2696 return count; 2718 return count;
2697} 2719}
2698 2720
2721
2699/** 2722/**
2700 * Count channels of a tunnel. 2723 * Count channels of a tunnel.
2701 * 2724 *