From 94d8b17e86c2a3405d189cc63897d3e7824584c0 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 4 Jun 2014 17:47:50 +0000 Subject: [PATCH] -fix #3428 --- src/revocation/gnunet-service-revocation.c | 12 +++++++++++ src/revocation/test_revocation.c | 23 ++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c index f0b33a459..648e82107 100644 --- a/src/revocation/gnunet-service-revocation.c +++ b/src/revocation/gnunet-service-revocation.c @@ -707,6 +707,9 @@ handle_revocation_union_request (void *cls, GNUNET_break (0); return; } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Received set exchange request from peer `%s'\n", + GNUNET_i2s (other_peer)); peer_entry = GNUNET_CONTAINER_multipeermap_get (peers, other_peer); if (NULL == peer_entry) @@ -722,6 +725,15 @@ handle_revocation_union_request (void *cls, GNUNET_SET_RESULT_ADDED, &add_revocation, peer_entry); + if (GNUNET_OK != + GNUNET_SET_commit (peer_entry->so, + revocation_set)) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + _("SET service crashed, terminating revocation service\n")); + GNUNET_SCHEDULER_shutdown (); + return; + } } diff --git a/src/revocation/test_revocation.c b/src/revocation/test_revocation.c index d9e7a669a..f9eadfbb4 100644 --- a/src/revocation/test_revocation.c +++ b/src/revocation/test_revocation.c @@ -103,7 +103,8 @@ do_shutdown (void *cls, static void -do_shutdown_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) +do_shutdown_badly (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc) { if (GNUNET_SCHEDULER_NO_TASK != die_task) die_task = GNUNET_SCHEDULER_NO_TASK; @@ -114,16 +115,18 @@ do_shutdown_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void * identity_connect_adapter (void *cls, - const struct GNUNET_CONFIGURATION_Handle *cfg) + const struct GNUNET_CONFIGURATION_Handle *cfg) { struct TestPeer *me = cls; me->cfg = cfg; me->idh = GNUNET_IDENTITY_connect (cfg, NULL, NULL ); if (NULL == me->idh) - GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to create IDENTITY handle \n"); + GNUNET_log(GNUNET_ERROR_TYPE_ERROR, + "Failed to create IDENTITY handle \n"); return me->idh; } + static void identity_disconnect_adapter (void *cls, void *op_result) { @@ -134,11 +137,13 @@ identity_disconnect_adapter (void *cls, void *op_result) static void -check_revocation (); +check_revocation (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); static void -revocation_remote_cb (void *cls, int is_valid) +revocation_remote_cb (void *cls, + int is_valid) { static int repeat = 0; if (GNUNET_NO == is_valid) @@ -169,7 +174,8 @@ revocation_remote_cb (void *cls, int is_valid) static void -check_revocation () +check_revocation (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc) { GNUNET_REVOCATION_query (testpeers[0].cfg, &testpeers[1].pubkey, @@ -178,14 +184,15 @@ check_revocation () static void -revocation_cb (void *cls, int is_valid) +revocation_cb (void *cls, + int is_valid) { testpeers[1].revok_handle = NULL; if (GNUNET_NO == is_valid) { GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Revocation successful\n"); - check_revocation (); + check_revocation (NULL, NULL); } } -- 2.25.1