gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: -move function to more logical place, n


From: gnunet
Subject: [gnunet] branch master updated: -move function to more logical place, no semantic change
Date: Sat, 12 Mar 2022 09:47:14 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new e99cd96fd -move function to more logical place, no semantic change
e99cd96fd is described below

commit e99cd96fd96ae03da1f73c0355eea77cf44c8375
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sat Mar 12 09:47:03 2022 +0100

    -move function to more logical place, no semantic change
---
 src/dht/gnunet-service-dht_neighbours.c | 114 ++++++++++++++++----------------
 1 file changed, 57 insertions(+), 57 deletions(-)

diff --git a/src/dht/gnunet-service-dht_neighbours.c 
b/src/dht/gnunet-service-dht_neighbours.c
index 6d4534f8a..94513983e 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -2342,63 +2342,6 @@ check_dht_p2p_result (void *cls,
 }
 
 
-/**
- * Callback function used to extract URIs from a builder.
- * Called when we should consider connecting to a peer.
- *
- * @param cls closure pointing to a `struct GNUNET_PeerIdentity *`
- * @param uri one of the URIs
- */
-void
-GDS_try_connect (void *cls,
-                 const char *uri)
-{
-  const struct GNUNET_PeerIdentity *pid = cls;
-  struct GNUNET_HashCode phash;
-  int peer_bucket;
-  struct PeerBucket *bucket;
-
-  if (0 == GNUNET_memcmp (&GDS_my_identity,
-                          pid))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Got a HELLO for my own PID, ignoring it\n");
-    return; /* that's us! */
-  }
-  GNUNET_CRYPTO_hash (pid,
-                      sizeof(*pid),
-                      &phash);
-  peer_bucket = find_bucket (&phash);
-  GNUNET_assert ( (peer_bucket >= 0) &&
-                  ((unsigned int) peer_bucket < MAX_BUCKETS));
-  bucket = &k_buckets[peer_bucket];
-  if (bucket->peers_size >= bucket_size)
-    return; /* do not care */
-  for (struct PeerInfo *pi = bucket->head;
-       NULL != pi;
-       pi = pi->next)
-    if (0 ==
-        GNUNET_memcmp (&pi->id,
-                       pid))
-    {
-      /* already connected */
-      /* TODO: maybe consider 'uri' anyway as an additional
-         alternative address??? */
-      return;
-    }
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Discovered peer %s at %s suitable for bucket %d (%u/%u), trying 
to connect\n",
-              GNUNET_i2s (pid),
-              uri,
-              peer_bucket,
-              bucket->peers_size,
-              bucket_size);
-  /* new peer that we like! */
-  GDS_u_try_connect (pid,
-                     uri);
-}
-
-
 /**
  * Core handler for p2p result messages.
  *
@@ -2654,6 +2597,63 @@ GDS_u_receive (void *cls,
 }
 
 
+/**
+ * Callback function used to extract URIs from a builder.
+ * Called when we should consider connecting to a peer.
+ *
+ * @param cls closure pointing to a `struct GNUNET_PeerIdentity *`
+ * @param uri one of the URIs
+ */
+void
+GDS_try_connect (void *cls,
+                 const char *uri)
+{
+  const struct GNUNET_PeerIdentity *pid = cls;
+  struct GNUNET_HashCode phash;
+  int peer_bucket;
+  struct PeerBucket *bucket;
+
+  if (0 == GNUNET_memcmp (&GDS_my_identity,
+                          pid))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Got a HELLO for my own PID, ignoring it\n");
+    return; /* that's us! */
+  }
+  GNUNET_CRYPTO_hash (pid,
+                      sizeof(*pid),
+                      &phash);
+  peer_bucket = find_bucket (&phash);
+  GNUNET_assert ( (peer_bucket >= 0) &&
+                  ((unsigned int) peer_bucket < MAX_BUCKETS));
+  bucket = &k_buckets[peer_bucket];
+  if (bucket->peers_size >= bucket_size)
+    return; /* do not care */
+  for (struct PeerInfo *pi = bucket->head;
+       NULL != pi;
+       pi = pi->next)
+    if (0 ==
+        GNUNET_memcmp (&pi->id,
+                       pid))
+    {
+      /* already connected */
+      /* TODO: maybe consider 'uri' anyway as an additional
+         alternative address??? */
+      return;
+    }
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Discovered peer %s at %s suitable for bucket %d (%u/%u), trying 
to connect\n",
+              GNUNET_i2s (pid),
+              uri,
+              peer_bucket,
+              bucket->peers_size,
+              bucket_size);
+  /* new peer that we like! */
+  GDS_u_try_connect (pid,
+                     uri);
+}
+
+
 /**
  * Send @a msg to all peers in our buckets.
  *

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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