/* 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
0,
NULL,
GDS_my_hello,
- GNUNET_HELLO_size ((const struct
- GNUNET_HELLO_Message *)
- GDS_my_hello));
+ hello_size);
}
else
{
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
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;
* @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;