[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
- [GNUnet-SVN] [gnunet] branch master updated (fc158da4c -> aae0e990d), gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 15/17: remove obsolete options, gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 13/17: cosmetics,
gnunet <=
- [GNUnet-SVN] [gnunet] 05/17: ignore zonefiles dir, gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 07/17: rename new core API implementation to name of standard implementation, gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 08/17: rename new client API implementation to name of standard implementation, gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 04/17: dead code elimination, gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 03/17: handle transmissions initiated during disconnect callbacks by dropping, gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 12/17: enable upnpc by default, gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 01/17: out-of-order PIDs are not exactly protocol violations, hence do not report as such, gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 10/17: fix link issue, gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 09/17: log at DEBUG level, gnunet, 2017/01/09
- [GNUnet-SVN] [gnunet] 02/17: cancel potentially dangling reconnect task, gnunet, 2017/01/09