From e850c12a7b44330ec45ad849edfc60ac7abbad0e Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 25 Jun 2012 11:55:03 +0000 Subject: [PATCH] - wip mesh/regex --- src/mesh/gnunet-service-mesh_new.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/mesh/gnunet-service-mesh_new.c b/src/mesh/gnunet-service-mesh_new.c index 86d0b4a09..d7446bc43 100644 --- a/src/mesh/gnunet-service-mesh_new.c +++ b/src/mesh/gnunet-service-mesh_new.c @@ -4024,7 +4024,9 @@ dht_get_string_handler (void *cls, struct GNUNET_TIME_Absolute exp, size_t size, const void *data) { const struct MeshRegexBlock *block = data; + struct MeshRegexSerachContext *ctx = cls; char *proof; + size_t len; // FIXME: does proof have to be NULL terminated? proof = (char *) &block[1]; @@ -4033,6 +4035,20 @@ dht_get_string_handler (void *cls, struct GNUNET_TIME_Absolute exp, GNUNET_break_op (0); return; } + len = strlen (ctx->description); + if (len == ctx->position) + { + if (GNUNET_YES == ntohl (block->accepting)) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found peer by service\n"); + } + else + { + GNUNET_break (0); + // FIXME ERROR? Backtrace? + } + return; + } // FIXME complete return; } -- 2.25.1