aboutsummaryrefslogtreecommitdiff
path: root/src/revocation
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-06-04 17:47:50 +0000
committerChristian Grothoff <christian@grothoff.org>2014-06-04 17:47:50 +0000
commit94d8b17e86c2a3405d189cc63897d3e7824584c0 (patch)
tree2c21f7d237413a9f743bddf25e8eb7c4097a659a /src/revocation
parentf32b0bc6605984cf1766bc106f6f6d054cf26e06 (diff)
downloadgnunet-94d8b17e86c2a3405d189cc63897d3e7824584c0.tar.gz
gnunet-94d8b17e86c2a3405d189cc63897d3e7824584c0.zip
-fix #3428
Diffstat (limited to 'src/revocation')
-rw-r--r--src/revocation/gnunet-service-revocation.c12
-rw-r--r--src/revocation/test_revocation.c23
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,
707 GNUNET_break (0); 707 GNUNET_break (0);
708 return; 708 return;
709 } 709 }
710 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
711 "Received set exchange request from peer `%s'\n",
712 GNUNET_i2s (other_peer));
710 peer_entry = GNUNET_CONTAINER_multipeermap_get (peers, 713 peer_entry = GNUNET_CONTAINER_multipeermap_get (peers,
711 other_peer); 714 other_peer);
712 if (NULL == peer_entry) 715 if (NULL == peer_entry)
@@ -722,6 +725,15 @@ handle_revocation_union_request (void *cls,
722 GNUNET_SET_RESULT_ADDED, 725 GNUNET_SET_RESULT_ADDED,
723 &add_revocation, 726 &add_revocation,
724 peer_entry); 727 peer_entry);
728 if (GNUNET_OK !=
729 GNUNET_SET_commit (peer_entry->so,
730 revocation_set))
731 {
732 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
733 _("SET service crashed, terminating revocation service\n"));
734 GNUNET_SCHEDULER_shutdown ();
735 return;
736 }
725} 737}
726 738
727 739
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,
103 103
104 104
105static void 105static void
106do_shutdown_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 106do_shutdown_badly (void *cls,
107 const struct GNUNET_SCHEDULER_TaskContext *tc)
107{ 108{
108 if (GNUNET_SCHEDULER_NO_TASK != die_task) 109 if (GNUNET_SCHEDULER_NO_TASK != die_task)
109 die_task = GNUNET_SCHEDULER_NO_TASK; 110 die_task = GNUNET_SCHEDULER_NO_TASK;
@@ -114,16 +115,18 @@ do_shutdown_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
114 115
115static void * 116static void *
116identity_connect_adapter (void *cls, 117identity_connect_adapter (void *cls,
117 const struct GNUNET_CONFIGURATION_Handle *cfg) 118 const struct GNUNET_CONFIGURATION_Handle *cfg)
118{ 119{
119 struct TestPeer *me = cls; 120 struct TestPeer *me = cls;
120 me->cfg = cfg; 121 me->cfg = cfg;
121 me->idh = GNUNET_IDENTITY_connect (cfg, NULL, NULL ); 122 me->idh = GNUNET_IDENTITY_connect (cfg, NULL, NULL );
122 if (NULL == me->idh) 123 if (NULL == me->idh)
123 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to create IDENTITY handle \n"); 124 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
125 "Failed to create IDENTITY handle \n");
124 return me->idh; 126 return me->idh;
125} 127}
126 128
129
127static void 130static void
128identity_disconnect_adapter (void *cls, void *op_result) 131identity_disconnect_adapter (void *cls, void *op_result)
129{ 132{
@@ -134,11 +137,13 @@ identity_disconnect_adapter (void *cls, void *op_result)
134 137
135 138
136static void 139static void
137check_revocation (); 140check_revocation (void *cls,
141 const struct GNUNET_SCHEDULER_TaskContext *tc);
138 142
139 143
140static void 144static void
141revocation_remote_cb (void *cls, int is_valid) 145revocation_remote_cb (void *cls,
146 int is_valid)
142{ 147{
143 static int repeat = 0; 148 static int repeat = 0;
144 if (GNUNET_NO == is_valid) 149 if (GNUNET_NO == is_valid)
@@ -169,7 +174,8 @@ revocation_remote_cb (void *cls, int is_valid)
169 174
170 175
171static void 176static void
172check_revocation () 177check_revocation (void *cls,
178 const struct GNUNET_SCHEDULER_TaskContext *tc)
173{ 179{
174 GNUNET_REVOCATION_query (testpeers[0].cfg, 180 GNUNET_REVOCATION_query (testpeers[0].cfg,
175 &testpeers[1].pubkey, 181 &testpeers[1].pubkey,
@@ -178,14 +184,15 @@ check_revocation ()
178 184
179 185
180static void 186static void
181revocation_cb (void *cls, int is_valid) 187revocation_cb (void *cls,
188 int is_valid)
182{ 189{
183 testpeers[1].revok_handle = NULL; 190 testpeers[1].revok_handle = NULL;
184 if (GNUNET_NO == is_valid) 191 if (GNUNET_NO == is_valid)
185 { 192 {
186 GNUNET_log(GNUNET_ERROR_TYPE_INFO, 193 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
187 "Revocation successful\n"); 194 "Revocation successful\n");
188 check_revocation (); 195 check_revocation (NULL, NULL);
189 } 196 }
190} 197}
191 198