struct CheckEdgeContext ctx;
int res;
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Block check\n");
if (GNUNET_OK !=
REGEX_BLOCK_get_key (block, size,
&key))
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- if (0 != memcmp (&key,
- query,
- sizeof (struct GNUNET_HashCode)))
+ if (NULL != query &&
+ 0 != memcmp (&key,
+ query,
+ sizeof (struct GNUNET_HashCode)))
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
if ( (GNUNET_YES == ntohs (block->is_accepting)) &&
( (NULL == xquery) || ('\0' == xquery[0]) ) )
+ {
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ " out! Is accepting: %u, xquery %p\n",
+ ntohs(block->is_accepting), xquery);
return GNUNET_OK;
+ }
ctx.xquery = xquery;
ctx.found = GNUNET_NO;
res = REGEX_BLOCK_iterate (block, size, &check_edge, &ctx);
return GNUNET_SYSERR;
if (NULL == xquery)
return GNUNET_YES;
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Result %d\n", ctx.found);
return ctx.found;
}
unsigned int n;
size_t off;
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Block iterate\n");
if (size < sizeof (struct RegexBlock))
{
GNUNET_break_op (0);
for (n=0;n<num_edges;n++)
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Edge %u, off %u tokenlen %u\n", n, off,
- ntohs (edges[n].token_length));
+ " Edge %u/%u, off %u tokenlen %u (%.*s)\n", n+1, num_edges, off,
+ ntohs (edges[n].token_length), ntohs (edges[n].token_length),
+ &aux[off]);
if (NULL != iterator)
if (GNUNET_NO == iterator (iter_cls,
&aux[off],
const char *rest;
int result;
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Next edge\n");
/* Find the longest match for the current string position,
* among tokens in the given block */
ctx->longest_match = 0;
result = REGEX_BLOCK_iterate (block, size,
- ®ex_edge_iterator, ctx);
+ ®ex_edge_iterator, ctx);
GNUNET_break (GNUNET_OK == result);
/* Did anything match? */