From: Bart Polot Date: Mon, 25 Jun 2012 11:55:03 +0000 (+0000) Subject: - wip mesh/regex X-Git-Tag: initial-import-from-subversion-38251~12828 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e850c12a7b44330ec45ad849edfc60ac7abbad0e;p=oweals%2Fgnunet.git - wip mesh/regex --- 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; }