diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-20 16:31:05 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-20 16:31:05 +0000 |
commit | 379bca7ce074b828fc09f592fcae2e94945da6cd (patch) | |
tree | a7df2b8e887d536b43af013dd7e5d9fe2ad93699 /src/namestore | |
parent | 317e03dc6df7dac98453521926c946984eb64771 (diff) | |
download | gnunet-379bca7ce074b828fc09f592fcae2e94945da6cd.tar.gz gnunet-379bca7ce074b828fc09f592fcae2e94945da6cd.zip |
-enable monitor over all zones
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 74bd98d81..53a685c63 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c | |||
@@ -199,6 +199,11 @@ struct CacheOperation | |||
199 | 199 | ||
200 | 200 | ||
201 | /** | 201 | /** |
202 | * Public key of all zeros. | ||
203 | */ | ||
204 | static const struct GNUNET_CRYPTO_EcdsaPrivateKey zero; | ||
205 | |||
206 | /** | ||
202 | * Configuration handle. | 207 | * Configuration handle. |
203 | */ | 208 | */ |
204 | static const struct GNUNET_CONFIGURATION_Handle *GSN_cfg; | 209 | static const struct GNUNET_CONFIGURATION_Handle *GSN_cfg; |
@@ -674,8 +679,11 @@ handle_record_store (void *cls, | |||
674 | if (GNUNET_OK == res) | 679 | if (GNUNET_OK == res) |
675 | { | 680 | { |
676 | for (zm = monitor_head; NULL != zm; zm = zm->next) | 681 | for (zm = monitor_head; NULL != zm; zm = zm->next) |
677 | if (0 == memcmp (&rp_msg->private_key, &zm->zone, | 682 | if ( (0 == memcmp (&rp_msg->private_key, &zm->zone, |
678 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | 683 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) || |
684 | (0 == memcmp (&zm->zone, | ||
685 | &zero, | ||
686 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) ) | ||
679 | send_lookup_response (monitor_nc, | 687 | send_lookup_response (monitor_nc, |
680 | zm->nc->client, | 688 | zm->nc->client, |
681 | zm->request_id, | 689 | zm->request_id, |
@@ -956,7 +964,6 @@ zone_iteraterate_proc (void *cls, | |||
956 | static void | 964 | static void |
957 | run_zone_iteration_round (struct ZoneIteration *zi) | 965 | run_zone_iteration_round (struct ZoneIteration *zi) |
958 | { | 966 | { |
959 | static struct GNUNET_CRYPTO_EcdsaPrivateKey zero; | ||
960 | struct ZoneIterationProcResult proc; | 967 | struct ZoneIterationProcResult proc; |
961 | struct RecordResultMessage rrm; | 968 | struct RecordResultMessage rrm; |
962 | int ret; | 969 | int ret; |
@@ -1098,7 +1105,9 @@ handle_iteration_next (void *cls, | |||
1098 | const struct ZoneIterationNextMessage *zis_msg; | 1105 | const struct ZoneIterationNextMessage *zis_msg; |
1099 | uint32_t rid; | 1106 | uint32_t rid; |
1100 | 1107 | ||
1101 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "ZONE_ITERATION_NEXT"); | 1108 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1109 | "Received `%s' message\n", | ||
1110 | "ZONE_ITERATION_NEXT"); | ||
1102 | if (NULL == (nc = client_lookup(client))) | 1111 | if (NULL == (nc = client_lookup(client))) |
1103 | { | 1112 | { |
1104 | GNUNET_break (0); | 1113 | GNUNET_break (0); |
@@ -1234,7 +1243,9 @@ monitor_next (void *cls, | |||
1234 | 1243 | ||
1235 | zm->task = GNUNET_SCHEDULER_NO_TASK; | 1244 | zm->task = GNUNET_SCHEDULER_NO_TASK; |
1236 | ret = GSN_database->iterate_records (GSN_database->cls, | 1245 | ret = GSN_database->iterate_records (GSN_database->cls, |
1237 | &zm->zone, | 1246 | (0 == memcmp (&zm->zone, &zero, sizeof (zero))) |
1247 | ? NULL | ||
1248 | : &zm->zone, | ||
1238 | zm->offset++, | 1249 | zm->offset++, |
1239 | &monitor_iterate_cb, zm); | 1250 | &monitor_iterate_cb, zm); |
1240 | if (GNUNET_SYSERR == ret) | 1251 | if (GNUNET_SYSERR == ret) |