gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r34063 - gnunet/src/cadet


From: gnunet
Subject: [GNUnet-SVN] r34063 - gnunet/src/cadet
Date: Mon, 28 Jul 2014 07:12:38 +0200

Author: bartpolot
Date: 2014-07-28 07:12:38 +0200 (Mon, 28 Jul 2014)
New Revision: 34063

Modified:
   gnunet/src/cadet/gnunet-service-cadet_tunnel.c
Log:
- set tunnel cstate to SEARCH when 0 connections are present

Modified: gnunet/src/cadet/gnunet-service-cadet_tunnel.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_tunnel.c      2014-07-27 13:17:03 UTC 
(rev 34062)
+++ gnunet/src/cadet/gnunet-service-cadet_tunnel.c      2014-07-28 05:12:38 UTC 
(rev 34063)
@@ -2371,6 +2371,7 @@
 {
   struct CadetTConnection *aux;
   struct CadetTConnection *next;
+  unsigned int conns;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Removing connection %s from tunnel %s\n",
        GCC_2s (c), GCT_2s (t));
@@ -2384,14 +2385,18 @@
     }
   }
 
+  conns = GCT_count_connections (t);
+  if (0 == conns)
+    GCT_change_cstate (t, CADET_TUNNEL_SEARCHING);
+
   /* Start new connections if needed */
-  if (CONNECTIONS_PER_TUNNEL > GCT_count_connections (t)
+  if (CONNECTIONS_PER_TUNNEL > conns
       && GNUNET_SCHEDULER_NO_TASK == t->destroy_task
       && CADET_TUNNEL_SHUTDOWN != t->cstate
       && GNUNET_NO == shutting_down)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, "  too few connections, getting new ones\n");
-    GCP_connect (t->peer);
+    GCP_connect (t->peer); /* Will change cstate to WAITING when possible */
     return;
   }
 
@@ -2403,8 +2408,6 @@
   for (aux = t->connection_head; aux != NULL; aux = aux->next)
     if (CADET_CONNECTION_READY == GCC_get_state (aux->c))
       return;
-
-  GCT_change_cstate (t, CADET_TUNNEL_WAITING);
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]