gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13964 - gnunet/src/dv


From: gnunet
Subject: [GNUnet-SVN] r13964 - gnunet/src/dv
Date: Tue, 21 Dec 2010 14:49:43 +0100

Author: nevans
Date: 2010-12-21 14:49:43 +0100 (Tue, 21 Dec 2010)
New Revision: 13964

Modified:
   gnunet/src/dv/gnunet-service-dv.c
   gnunet/src/dv/test_transport_api_dv.c
Log:
core connect changes

Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c   2010-12-21 13:46:45 UTC (rev 13963)
+++ gnunet/src/dv/gnunet-service-dv.c   2010-12-21 13:49:43 UTC (rev 13964)
@@ -2897,6 +2897,10 @@
 #endif
   uint32_t distance;
 
+  /* Check for connect to self message */
+  if (0 == memcmp(&my_identity, peer, sizeof(struct GNUNET_PeerIdentity)))
+    return;
+
   distance = get_atsi_distance (atsi);
   if ((distance == DIRECT_NEIGHBOR_COST) &&
       (GNUNET_CONTAINER_multihashmap_get(direct_neighbors, &peer->hashPubKey) 
== NULL))
@@ -2969,6 +2973,10 @@
               "%s: Receives core peer disconnect message!\n", "dv");
 #endif
 
+  /* Check for disconnect from self message */
+  if (0 == memcmp(&my_identity, peer, sizeof(struct GNUNET_PeerIdentity)))
+    return;
+
   neighbor =
     GNUNET_CONTAINER_multihashmap_get (direct_neighbors, &peer->hashPubKey);
 

Modified: gnunet/src/dv/test_transport_api_dv.c
===================================================================
--- gnunet/src/dv/test_transport_api_dv.c       2010-12-21 13:46:45 UTC (rev 
13963)
+++ gnunet/src/dv/test_transport_api_dv.c       2010-12-21 13:49:43 UTC (rev 
13964)
@@ -547,9 +547,9 @@
 
 static void
 init_notify_peer2 (void *cls,
-             struct GNUNET_CORE_Handle *server,
-             const struct GNUNET_PeerIdentity *my_identity,
-             const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+                   struct GNUNET_CORE_Handle *server,
+                   const struct GNUNET_PeerIdentity *my_identity,
+                   const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 
*publicKey)
 {
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -597,9 +597,9 @@
 
 static void
 init_notify_peer1 (void *cls,
-             struct GNUNET_CORE_Handle *server,
-             const struct GNUNET_PeerIdentity *my_identity,
-             const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
+                   struct GNUNET_CORE_Handle *server,
+                   const struct GNUNET_PeerIdentity *my_identity,
+                   const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 
*publicKey)
 {
   total_server_connections++;
 #if VERBOSE
@@ -877,6 +877,10 @@
   struct TestMessageContext *temp_context;
 #endif
   uint32_t distance;
+
+  if (0 == memcmp(&d->id, peer, sizeof(struct GNUNET_PeerIdentity)))
+    return;
+
   distance = get_atsi_distance(atsi);
 
 #if VERBOSE




reply via email to

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