diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-26 15:54:54 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-26 15:54:54 +0000 |
commit | 7706f0a08b2425622121c23a7d2054794f2d677c (patch) | |
tree | d4b658006d8b0418b2afabe51bfae14c3f59bb97 /src/regex/regex_internal_dht.c | |
parent | 133a5ecf306d35f9e86fb5a1f8b120783f6afdf9 (diff) | |
download | gnunet-7706f0a08b2425622121c23a7d2054794f2d677c.tar.gz gnunet-7706f0a08b2425622121c23a7d2054794f2d677c.zip |
-removing unnecessary key from regex blocks, compacting some of the other fields
Diffstat (limited to 'src/regex/regex_internal_dht.c')
-rw-r--r-- | src/regex/regex_internal_dht.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/regex/regex_internal_dht.c b/src/regex/regex_internal_dht.c index af775ef95..e7259edcc 100644 --- a/src/regex/regex_internal_dht.c +++ b/src/regex/regex_internal_dht.c | |||
@@ -123,10 +123,10 @@ regex_iterator (void *cls, | |||
123 | DHT_TTL, | 123 | DHT_TTL, |
124 | NULL, NULL); | 124 | NULL, NULL); |
125 | } | 125 | } |
126 | block = REGEX_BLOCK_create (key, proof, | 126 | block = REGEX_BLOCK_create (proof, |
127 | num_edges, edges, | 127 | num_edges, edges, |
128 | accepting, | 128 | accepting, |
129 | &size); | 129 | &size); |
130 | (void) | 130 | (void) |
131 | GNUNET_DHT_put (h->dht, key, | 131 | GNUNET_DHT_put (h->dht, key, |
132 | DHT_REPLICATION, | 132 | DHT_REPLICATION, |
@@ -420,20 +420,20 @@ dht_get_string_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
420 | GNUNET_break ( | 420 | GNUNET_break ( |
421 | GNUNET_OK == | 421 | GNUNET_OK == |
422 | GNUNET_CONTAINER_multihashmap_put (info->dht_get_results, | 422 | GNUNET_CONTAINER_multihashmap_put (info->dht_get_results, |
423 | &((struct RegexBlock *)copy)->key, copy, | 423 | key, copy, |
424 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE) | 424 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE) |
425 | ); | 425 | ); |
426 | len = strlen (info->description); | 426 | len = strlen (info->description); |
427 | if (len == ctx->position) // String processed | 427 | if (len == ctx->position) // String processed |
428 | { | 428 | { |
429 | if (GNUNET_YES == ntohl (block->accepting)) | 429 | if (GNUNET_YES == ntohs (block->is_accepting)) |
430 | { | 430 | { |
431 | regex_find_path (key, ctx); | 431 | regex_find_path (key, ctx); |
432 | } | 432 | } |
433 | else | 433 | else |
434 | { | 434 | { |
435 | LOG (GNUNET_ERROR_TYPE_INFO, " block not accepting!\n"); | 435 | LOG (GNUNET_ERROR_TYPE_INFO, "block not accepting!\n"); |
436 | // FIXME REGEX this block not successful, wait for more? start timeout? | 436 | /* FIXME REGEX this block not successful, wait for more? start timeout? */ |
437 | } | 437 | } |
438 | return; | 438 | return; |
439 | } | 439 | } |
@@ -457,7 +457,7 @@ regex_result_iterator (void *cls, | |||
457 | struct RegexBlock *block = value; | 457 | struct RegexBlock *block = value; |
458 | struct RegexSearchContext *ctx = cls; | 458 | struct RegexSearchContext *ctx = cls; |
459 | 459 | ||
460 | if (GNUNET_YES == ntohl(block->accepting) && | 460 | if (GNUNET_YES == ntohs (block->is_accepting) && |
461 | ctx->position == strlen (ctx->info->description)) | 461 | ctx->position == strlen (ctx->info->description)) |
462 | { | 462 | { |
463 | LOG (GNUNET_ERROR_TYPE_INFO, " * Found accepting known block\n"); | 463 | LOG (GNUNET_ERROR_TYPE_INFO, " * Found accepting known block\n"); |
@@ -466,7 +466,7 @@ regex_result_iterator (void *cls, | |||
466 | } | 466 | } |
467 | LOG (GNUNET_ERROR_TYPE_DEBUG, "* %u, %u, [%u]\n", | 467 | LOG (GNUNET_ERROR_TYPE_DEBUG, "* %u, %u, [%u]\n", |
468 | ctx->position, strlen(ctx->info->description), | 468 | ctx->position, strlen(ctx->info->description), |
469 | ntohl(block->accepting)); | 469 | ntohs (block->is_accepting)); |
470 | 470 | ||
471 | regex_next_edge (block, SIZE_MAX, ctx); | 471 | regex_next_edge (block, SIZE_MAX, ctx); |
472 | 472 | ||
@@ -646,7 +646,7 @@ REGEX_INTERNAL_search (struct GNUNET_DHT_Handle *dht, | |||
646 | h->callback_cls = callback_cls; | 646 | h->callback_cls = callback_cls; |
647 | h->stats = stats; | 647 | h->stats = stats; |
648 | h->dht_get_handles = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); | 648 | h->dht_get_handles = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); |
649 | h->dht_get_results = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_YES); | 649 | h->dht_get_results = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); |
650 | 650 | ||
651 | /* Initialize context */ | 651 | /* Initialize context */ |
652 | len = strlen (string); | 652 | len = strlen (string); |