diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-30 19:02:32 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-30 19:02:32 +0000 |
commit | 6ea60b3c0f51e600f2d3d9be5d4eaa6eb424c538 (patch) | |
tree | c2319d6db715df848d548f01a4ff1f937c03b2e9 /src/revocation | |
parent | 14dc1d94810a77ed35ce9e8d7090c8a489707351 (diff) | |
download | gnunet-6ea60b3c0f51e600f2d3d9be5d4eaa6eb424c538.tar.gz gnunet-6ea60b3c0f51e600f2d3d9be5d4eaa6eb424c538.zip |
-doxygen, todos, minor code cleanup
Diffstat (limited to 'src/revocation')
-rw-r--r-- | src/revocation/gnunet-service-revocation.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c index a3d802d10..8ab8f8ae1 100644 --- a/src/revocation/gnunet-service-revocation.c +++ b/src/revocation/gnunet-service-revocation.c | |||
@@ -29,6 +29,14 @@ | |||
29 | * flooding, revocations must include a proof of work. We use the | 29 | * flooding, revocations must include a proof of work. We use the |
30 | * set service for efficiently computing the union of revocations of | 30 | * set service for efficiently computing the union of revocations of |
31 | * peers that connect. | 31 | * peers that connect. |
32 | * | ||
33 | * TODO: | ||
34 | * - load revocations from disk | ||
35 | * - store revocations to disk | ||
36 | * - handle p2p revocations | ||
37 | * - handle p2p connect (trigger SET union) | ||
38 | * - handle client revoke message | ||
39 | * - handle client query message | ||
32 | */ | 40 | */ |
33 | #include "platform.h" | 41 | #include "platform.h" |
34 | #include <math.h> | 42 | #include <math.h> |
@@ -68,6 +76,10 @@ struct PeerEntry | |||
68 | }; | 76 | }; |
69 | 77 | ||
70 | 78 | ||
79 | /** | ||
80 | * Set from all revocations known to us. | ||
81 | */ | ||
82 | static struct GNUNET_SET_Handle *revocation_set; | ||
71 | 83 | ||
72 | /** | 84 | /** |
73 | * Handle to our current configuration. | 85 | * Handle to our current configuration. |
@@ -305,6 +317,11 @@ static void | |||
305 | shutdown_task (void *cls, | 317 | shutdown_task (void *cls, |
306 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 318 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
307 | { | 319 | { |
320 | if (NULL != revocation_set) | ||
321 | { | ||
322 | GNUNET_SET_destroy (revocation_set); | ||
323 | revocation_set = NULL; | ||
324 | } | ||
308 | if (NULL != coreAPI) | 325 | if (NULL != coreAPI) |
309 | { | 326 | { |
310 | GNUNET_CORE_disconnect (coreAPI); | 327 | GNUNET_CORE_disconnect (coreAPI); |
@@ -386,10 +403,12 @@ run (void *cls, | |||
386 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, | 403 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, |
387 | "REVOCATION", | 404 | "REVOCATION", |
388 | "WORKBITS", | 405 | "WORKBITS", |
389 | _("Value for WORKBITS is too large.\n")); | 406 | _("Value is too large.\n")); |
390 | GNUNET_SCHEDULER_shutdown (); | 407 | GNUNET_SCHEDULER_shutdown (); |
391 | return; | 408 | return; |
392 | } | 409 | } |
410 | revocation_set = GNUNET_SET_create (cfg, | ||
411 | GNUNET_SET_OPERATION_UNION); | ||
393 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, | 412 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, |
394 | NULL); | 413 | NULL); |
395 | peers = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); | 414 | peers = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); |