diff options
author | bartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-01-21 16:32:12 +0000 |
---|---|---|
committer | bartpolot <bartpolot@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-01-21 16:32:12 +0000 |
commit | c2299544d5ad4fae8e76f21d66c6008213a270cd (patch) | |
tree | f80b34d07a83f6195f559f37518c282501e53f13 /src/regex/plugin_block_regex.c | |
parent | 040baf71189c6163d0df8cdf58216d4cb55c8dca (diff) |
- add debug for case of no xquery
git-svn-id: https://gnunet.org/svn/gnunet@25851 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/regex/plugin_block_regex.c')
-rw-r--r-- | src/regex/plugin_block_regex.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/regex/plugin_block_regex.c b/src/regex/plugin_block_regex.c index dc02b53cf2..d3c9735603 100644 --- a/src/regex/plugin_block_regex.c +++ b/src/regex/plugin_block_regex.c @@ -37,6 +37,28 @@ /** + * Show debug info about outgoing edges from a block. + * + * @param cls Closure (uunsed). + * @param token Edge label. + * @param len Length of @c token. + * @param key Block the edge point to. + * + * @return GNUNET_YES to keep iterating. + */ +static int +rdebug (void *cls, + const char *token, + size_t len, + const struct GNUNET_HashCode *key) +{ + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " %s: %.*s\n", + GNUNET_h2s (key), len, token); + return GNUNET_YES; +} + + +/** * Function called to validate a reply or a request. For * request evaluation, simply pass "NULL" for the reply_block. * Note that it is assumed that the reply has already been @@ -84,7 +106,13 @@ block_plugin_regex_evaluate (void *cls, enum GNUNET_BLOCK_Type type, } else { + const struct RegexBlock *rblock = reply_block; + GNUNET_break_op (0); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Block with no xquery\n"); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " key: %s, %u edges\n", + GNUNET_h2s (&rblock->key), ntohl (rblock->n_edges)); + GNUNET_REGEX_block_iterate (rblock, reply_block_size, &rdebug, NULL); return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; } switch (GNUNET_REGEX_block_check (reply_block, |