aboutsummaryrefslogtreecommitdiff
path: root/src/regex/plugin_block_regex.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-01-21 16:32:12 +0000
committerBart Polot <bart@net.in.tum.de>2013-01-21 16:32:12 +0000
commit26ebfdc0cc5c15ac8d8ffe07cd90d2e3259b0f7a (patch)
treef80b34d07a83f6195f559f37518c282501e53f13 /src/regex/plugin_block_regex.c
parentcedadf74e7a37b52df653f7c6826002355773154 (diff)
downloadgnunet-26ebfdc0cc5c15ac8d8ffe07cd90d2e3259b0f7a.tar.gz
gnunet-26ebfdc0cc5c15ac8d8ffe07cd90d2e3259b0f7a.zip
- add debug for case of no xquery
Diffstat (limited to 'src/regex/plugin_block_regex.c')
-rw-r--r--src/regex/plugin_block_regex.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/regex/plugin_block_regex.c b/src/regex/plugin_block_regex.c
index dc02b53cf..d3c973560 100644
--- a/src/regex/plugin_block_regex.c
+++ b/src/regex/plugin_block_regex.c
@@ -37,6 +37,28 @@
37 37
38 38
39/** 39/**
40 * Show debug info about outgoing edges from a block.
41 *
42 * @param cls Closure (uunsed).
43 * @param token Edge label.
44 * @param len Length of @c token.
45 * @param key Block the edge point to.
46 *
47 * @return GNUNET_YES to keep iterating.
48 */
49static int
50rdebug (void *cls,
51 const char *token,
52 size_t len,
53 const struct GNUNET_HashCode *key)
54{
55 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " %s: %.*s\n",
56 GNUNET_h2s (key), len, token);
57 return GNUNET_YES;
58}
59
60
61/**
40 * Function called to validate a reply or a request. For 62 * Function called to validate a reply or a request. For
41 * request evaluation, simply pass "NULL" for the reply_block. 63 * request evaluation, simply pass "NULL" for the reply_block.
42 * Note that it is assumed that the reply has already been 64 * 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,
84 } 106 }
85 else 107 else
86 { 108 {
109 const struct RegexBlock *rblock = reply_block;
110
87 GNUNET_break_op (0); 111 GNUNET_break_op (0);
112 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Block with no xquery\n");
113 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " key: %s, %u edges\n",
114 GNUNET_h2s (&rblock->key), ntohl (rblock->n_edges));
115 GNUNET_REGEX_block_iterate (rblock, reply_block_size, &rdebug, NULL);
88 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; 116 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
89 } 117 }
90 switch (GNUNET_REGEX_block_check (reply_block, 118 switch (GNUNET_REGEX_block_check (reply_block,