gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] 13/17: cosmetics


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 13/17: cosmetics
Date: Mon, 09 Jan 2017 21:19:19 +0100

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

grothoff pushed a commit to branch master
in repository gnunet.

commit d829597ee90dccffffd46a082372af6b35042130
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Jan 9 17:48:27 2017 +0100

    cosmetics
---
 src/dht/gnunet-service-dht_neighbours.c | 12 ++++++++----
 src/dht/gnunet-service-dht_routing.c    | 10 ++++++----
 src/dht/plugin_block_dht.c              | 12 +++++++-----
 3 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/src/dht/gnunet-service-dht_neighbours.c 
b/src/dht/gnunet-service-dht_neighbours.c
index 574ed9ad0..0d3594d1a 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -1830,10 +1830,16 @@ handle_find_peer (const struct GNUNET_PeerIdentity 
*sender,
   /* first, check about our own HELLO */
   if (NULL != GDS_my_hello)
   {
-    GNUNET_BLOCK_mingle_hash (&my_identity_hash, bf_mutator, &mhash);
+    GNUNET_BLOCK_mingle_hash (&my_identity_hash,
+                             bf_mutator,
+                             &mhash);
     if ((NULL == bf) ||
         (GNUNET_YES != GNUNET_CONTAINER_bloomfilter_test (bf, &mhash)))
     {
+      size_t hello_size;
+
+      hello_size = GNUNET_HELLO_size ((const struct GNUNET_HELLO_Message *) 
GDS_my_hello);
+      GNUNET_break (hello_size >= sizeof (struct GNUNET_MessageHeader));
       GDS_NEIGHBOURS_handle_reply (sender,
                                   GNUNET_BLOCK_TYPE_DHT_HELLO,
                                    GNUNET_TIME_relative_to_absolute
@@ -1844,9 +1850,7 @@ handle_find_peer (const struct GNUNET_PeerIdentity 
*sender,
                                   0,
                                   NULL,
                                   GDS_my_hello,
-                                   GNUNET_HELLO_size ((const struct
-                                                       GNUNET_HELLO_Message *)
-                                                      GDS_my_hello));
+                                   hello_size);
     }
     else
     {
diff --git a/src/dht/gnunet-service-dht_routing.c 
b/src/dht/gnunet-service-dht_routing.c
index 48bece35e..38e5fc1c7 100644
--- a/src/dht/gnunet-service-dht_routing.c
+++ b/src/dht/gnunet-service-dht_routing.c
@@ -183,15 +183,17 @@ process (void *cls, const struct GNUNET_HashCode * key, 
void *value)
     gpl = 0;
     ppl = 0;
   }
-  if ((0 != (rr->options & GNUNET_DHT_RO_FIND_PEER)) &&
-      (pc->type == GNUNET_BLOCK_TYPE_DHT_HELLO))
+  if ( (0 != (rr->options & GNUNET_DHT_RO_FIND_PEER)) &&
+       (pc->type == GNUNET_BLOCK_TYPE_DHT_HELLO) )
   {
     /* key may not match HELLO, which is OK since
      * the search is approximate.  Still, the evaluation
      * would fail since the match is not exact.  So
      * we fake it by changing the key to the actual PID ... */
-    GNUNET_BLOCK_get_key (GDS_block_context, GNUNET_BLOCK_TYPE_DHT_HELLO,
-                          pc->data, pc->data_size, &hc);
+    GNUNET_BLOCK_get_key (GDS_block_context,
+                         GNUNET_BLOCK_TYPE_DHT_HELLO,
+                          pc->data, pc->data_size,
+                         &hc);
     eval_key = &hc;
   }
   else
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index 17594efcb..4256a0fe6 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -70,7 +70,7 @@ block_plugin_dht_evaluate (void *cls,
 
   if (type != GNUNET_BLOCK_TYPE_DHT_HELLO)
     return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED;
-  if (xquery_size != 0)
+  if (0 != xquery_size)
   {
     GNUNET_break_op (0);
     return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
@@ -121,14 +121,16 @@ block_plugin_dht_evaluate (void *cls,
  * @param type block type
  * @param block block to get the key for
  * @param block_size number of bytes @a block
- * @param key set to the key (query) for the given block
+ * @param[out] key set to the key (query) for the given block
  * @return #GNUNET_OK on success, #GNUNET_SYSERR if type not supported
  *         (or if extracting a key from a block of this type does not work)
  */
 static int
-block_plugin_dht_get_key (void *cls, enum GNUNET_BLOCK_Type type,
-                          const void *block, size_t block_size,
-                          struct GNUNET_HashCode * key)
+block_plugin_dht_get_key (void *cls,
+                         enum GNUNET_BLOCK_Type type,
+                          const void *block,
+                         size_t block_size,
+                          struct GNUNET_HashCode *key)
 {
   const struct GNUNET_MessageHeader *msg;
   const struct GNUNET_HELLO_Message *hello;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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