gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r36416 - gnunet/src/cadet
Date: Fri, 2 Oct 2015 05:37:40 +0200

Author: bartpolot
Date: 2015-10-02 05:37:40 +0200 (Fri, 02 Oct 2015)
New Revision: 36416

Modified:
   gnunet/src/cadet/gnunet-service-cadet_peer.c
Log:
- don't connect twice on core_connect, as it may cause problems since 
connections hashmap is not yet created

Modified: gnunet/src/cadet/gnunet-service-cadet_peer.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_peer.c        2015-10-02 03:37:39 UTC 
(rev 36415)
+++ gnunet/src/cadet/gnunet-service-cadet_peer.c        2015-10-02 03:37:40 UTC 
(rev 36416)
@@ -434,13 +434,15 @@
   path->peers[0] = myid;
   GNUNET_PEER_change_rc (myid, 1);
   GCP_add_path (neighbor, path, GNUNET_YES);
+
+  GNUNET_assert (NULL == neighbor->connections);
+  neighbor->connections = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_NO);
+  GNUNET_assert (NULL != neighbor->connections);
+
   GNUNET_STATISTICS_update (stats,
                             "# peers",
                             1,
                             GNUNET_NO);
-  GNUNET_assert (NULL == neighbor->connections);
-  neighbor->connections = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_NO);
-  GNUNET_assert (NULL != neighbor->connections);
 
   if ( (NULL != GCP_get_tunnel (neighbor)) &&
        (0 > GNUNET_CRYPTO_cmp_peer_identity (&my_full_id, peer)) )
@@ -2000,6 +2002,7 @@
   }
 
   /* Is not a neighbor but connections is not NULL, probably disconnecting */
+  GNUNET_break (0);
   return GNUNET_NO;
 }
 
@@ -2151,7 +2154,8 @@
 
 finish:
   if (NULL != peer->tunnel
-      && CONNECTIONS_PER_TUNNEL > GCT_count_connections (peer->tunnel))
+      && CONNECTIONS_PER_TUNNEL > GCT_count_connections (peer->tunnel)
+      && 2 < path->length) /* Direct paths are handled by core_connect */
   {
     GCP_connect (peer);
   }




reply via email to

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