summaryrefslogtreecommitdiff
path: root/src/set
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-03-12 04:01:02 +0100
committerChristian Grothoff <grothoff@gnunet.org>2022-03-12 04:01:02 +0100
commitff992f47e6528b00937c3951b812f6938e1ee21a (patch)
tree96917d63e24d2cc02b0e09a4e1dc29987541ffe8 /src/set
parent06f6791f2d55ab3a1b4ca4c3ba9ed5c315f8d79b (diff)
revise block API to match latest DHT specs
Diffstat (limited to 'src/set')
-rw-r--r--src/set/plugin_block_set_test.c44
1 files changed, 2 insertions, 42 deletions
diff --git a/src/set/plugin_block_set_test.c b/src/set/plugin_block_set_test.c
index 3d66831bb..cb5cef5ad 100644
--- a/src/set/plugin_block_set_test.c
+++ b/src/set/plugin_block_set_test.c
@@ -30,46 +30,9 @@
/**
- * Function called to validate a reply or a request. For
- * request evaluation, simply pass "NULL" for the reply_block.
- *
- * @param cls closure
- * @param ctx block context
- * @param type block type
- * @param group block group to use
- * @param eo control flags
- * @param query original query (hash)
- * @param xquery extrended query data (can be NULL, depending on type)
- * @param xquery_size number of bytes in xquery
- * @param reply_block response to validate
- * @param reply_block_size number of bytes in reply block
- * @return characterization of result
- */
-static enum GNUNET_BLOCK_EvaluationResult
-block_plugin_set_test_evaluate (void *cls,
- struct GNUNET_BLOCK_Context *ctx,
- enum GNUNET_BLOCK_Type type,
- struct GNUNET_BLOCK_Group *group,
- enum GNUNET_BLOCK_EvaluationOptions eo,
- const struct GNUNET_HashCode *query,
- const void *xquery,
- size_t xquery_size,
- const void *reply_block,
- size_t reply_block_size)
-{
- if ((NULL == reply_block) ||
- (reply_block_size == 0) ||
- (0 != ((char *) reply_block)[0]))
- return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
- return GNUNET_BLOCK_EVALUATION_OK_MORE;
-}
-
-
-/**
* Function called to validate a query.
*
* @param cls closure
- * @param ctx block context
* @param type block type
* @param query original query (hash)
* @param xquery extrended query data (can be NULL, depending on type)
@@ -92,7 +55,6 @@ block_plugin_set_test_check_query (void *cls,
*
* @param cls closure
* @param type block type
- * @param query key for the block (hash), must match exactly
* @param block block data to validate
* @param block_size number of bytes in @a block
* @return #GNUNET_OK if the block is fine, #GNUNET_NO if not
@@ -100,7 +62,6 @@ block_plugin_set_test_check_query (void *cls,
static enum GNUNET_GenericReturnValue
block_plugin_set_test_check_block (void *cls,
enum GNUNET_BLOCK_Type type,
- const struct GNUNET_HashCode *query,
const void *block,
size_t block_size)
{
@@ -141,7 +102,7 @@ block_plugin_set_test_check_reply (void *cls,
if ((NULL == reply_block) ||
(0 == reply_block_size) ||
(0 != ((char *) reply_block)[0]))
- return GNUNET_BLOCK_REPLY_INVALID;
+ GNUNET_assert (0);
return GNUNET_BLOCK_REPLY_OK_MORE;
}
@@ -164,7 +125,7 @@ block_plugin_set_test_get_key (void *cls,
size_t block_size,
struct GNUNET_HashCode *key)
{
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
@@ -181,7 +142,6 @@ libgnunet_plugin_block_set_test_init (void *cls)
struct GNUNET_BLOCK_PluginFunctions *api;
api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions);
- api->evaluate = &block_plugin_set_test_evaluate;
api->get_key = &block_plugin_set_test_get_key;
api->check_query = &block_plugin_set_test_check_query;
api->check_block = &block_plugin_set_test_check_block;