aboutsummaryrefslogtreecommitdiff
path: root/src/regex/plugin_block_regex.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-06-26 15:54:54 +0000
committerChristian Grothoff <christian@grothoff.org>2013-06-26 15:54:54 +0000
commit7706f0a08b2425622121c23a7d2054794f2d677c (patch)
treed4b658006d8b0418b2afabe51bfae14c3f59bb97 /src/regex/plugin_block_regex.c
parent133a5ecf306d35f9e86fb5a1f8b120783f6afdf9 (diff)
-removing unnecessary key from regex blocks, compacting some of the other fields
Diffstat (limited to 'src/regex/plugin_block_regex.c')
-rw-r--r--src/regex/plugin_block_regex.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/regex/plugin_block_regex.c b/src/regex/plugin_block_regex.c
index e17b34d339..9eeb13190d 100644
--- a/src/regex/plugin_block_regex.c
+++ b/src/regex/plugin_block_regex.c
@@ -80,7 +80,7 @@ rdebug (void *cls,
*/
static enum GNUNET_BLOCK_EvaluationResult
evaluate_block_regex (void *cls, enum GNUNET_BLOCK_Type type,
- const struct GNUNET_HashCode * query,
+ const struct GNUNET_HashCode *query,
struct GNUNET_CONTAINER_BloomFilter **bf,
int32_t bf_mutator, const void *xquery,
size_t xquery_size, const void *reply_block,
@@ -106,15 +106,16 @@ evaluate_block_regex (void *cls, enum GNUNET_BLOCK_Type type,
GNUNET_break_op (0);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Block with no xquery, key: %s, %u edges\n",
- GNUNET_h2s (&rblock->key),
+ "Block with no xquery, query: %s, %u edges\n",
+ GNUNET_h2s (query),
ntohl (rblock->n_edges));
REGEX_BLOCK_iterate (rblock, reply_block_size, &rdebug, NULL);
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
}
switch (REGEX_BLOCK_check (reply_block,
- reply_block_size,
- xquery))
+ reply_block_size,
+ query,
+ xquery))
{
case GNUNET_SYSERR:
GNUNET_break_op(0);
@@ -276,12 +277,15 @@ block_plugin_regex_get_key (void *cls, enum GNUNET_BLOCK_Type type,
const void *block, size_t block_size,
struct GNUNET_HashCode * key)
{
+ int ret;
+
switch (type)
{
case GNUNET_BLOCK_TYPE_REGEX:
- GNUNET_assert (sizeof (struct RegexBlock) <= block_size);
- *key = ((struct RegexBlock *) block)->key;
- return GNUNET_OK;
+ ret = REGEX_BLOCK_get_key (block, block_size,
+ key);
+ GNUNET_break_op (GNUNET_OK == ret);
+ return ret;
case GNUNET_BLOCK_TYPE_REGEX_ACCEPT:
GNUNET_assert (sizeof (struct RegexAccept) <= block_size);
*key = ((struct RegexAccept *) block)->key;