aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_monitoring.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/test_namestore_api_monitoring.c')
-rw-r--r--src/namestore/test_namestore_api_monitoring.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c
index a23424d30..d26492517 100644
--- a/src/namestore/test_namestore_api_monitoring.c
+++ b/src/namestore/test_namestore_api_monitoring.c
@@ -37,9 +37,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
37 37
38static struct GNUNET_SCHEDULER_Task *endbadly_task; 38static struct GNUNET_SCHEDULER_Task *endbadly_task;
39 39
40static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 40static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey;
41 41
42static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey2; 42static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey2;
43 43
44static struct GNUNET_NAMESTORE_ZoneMonitor *zm; 44static struct GNUNET_NAMESTORE_ZoneMonitor *zm;
45 45
@@ -107,17 +107,6 @@ do_shutdown ()
107 GNUNET_free ((void *) s_rd_3->data); 107 GNUNET_free ((void *) s_rd_3->data);
108 GNUNET_free (s_rd_3); 108 GNUNET_free (s_rd_3);
109 } 109 }
110
111 if (NULL != privkey)
112 {
113 GNUNET_free (privkey);
114 privkey = NULL;
115 }
116 if (NULL != privkey2)
117 {
118 GNUNET_free (privkey2);
119 privkey2 = NULL;
120 }
121} 110}
122 111
123 112
@@ -156,7 +145,7 @@ zone_proc (void *cls,
156 "Comparing results name %s\n", 145 "Comparing results name %s\n",
157 name); 146 name);
158 if (0 != GNUNET_memcmp (zone_key, 147 if (0 != GNUNET_memcmp (zone_key,
159 privkey)) 148 &privkey))
160 { 149 {
161 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 150 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
162 "Monitoring returned wrong zone key\n"); 151 "Monitoring returned wrong zone key\n");
@@ -284,12 +273,10 @@ run (void *cls,
284 struct GNUNET_TESTING_Peer *peer) 273 struct GNUNET_TESTING_Peer *peer)
285{ 274{
286 res = 1; 275 res = 1;
287 privkey = GNUNET_CRYPTO_ecdsa_key_create (); 276 GNUNET_CRYPTO_ecdsa_key_create (&privkey);
288 GNUNET_assert (privkey != NULL);
289
290 /* Start monitoring */ 277 /* Start monitoring */
291 zm = GNUNET_NAMESTORE_zone_monitor_start (cfg, 278 zm = GNUNET_NAMESTORE_zone_monitor_start (cfg,
292 privkey, 279 &privkey,
293 GNUNET_YES, 280 GNUNET_YES,
294 &fail_cb, 281 &fail_cb,
295 NULL, 282 NULL,
@@ -317,9 +304,7 @@ run (void *cls,
317 return; 304 return;
318 } 305 }
319 306
320 privkey2 = GNUNET_CRYPTO_ecdsa_key_create (); 307 GNUNET_CRYPTO_ecdsa_key_create (&privkey2);
321 GNUNET_assert (privkey2 != NULL);
322
323 308
324 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 309 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
325 "Created record 3\n"); 310 "Created record 3\n");
@@ -328,7 +313,7 @@ run (void *cls,
328 s_rd_3 = create_record (1); 313 s_rd_3 = create_record (1);
329 GNUNET_assert (NULL != (ns_ops[2] = 314 GNUNET_assert (NULL != (ns_ops[2] =
330 GNUNET_NAMESTORE_records_store (nsh, 315 GNUNET_NAMESTORE_records_store (nsh,
331 privkey2, 316 &privkey2,
332 s_name_3, 317 s_name_3,
333 1, 318 1,
334 s_rd_3, 319 s_rd_3,
@@ -340,7 +325,7 @@ run (void *cls,
340 s_rd_1 = create_record (1); 325 s_rd_1 = create_record (1);
341 GNUNET_assert (NULL != (ns_ops[0] = 326 GNUNET_assert (NULL != (ns_ops[0] =
342 GNUNET_NAMESTORE_records_store (nsh, 327 GNUNET_NAMESTORE_records_store (nsh,
343 privkey, 328 &privkey,
344 s_name_1, 329 s_name_1,
345 1, 330 1,
346 s_rd_1, 331 s_rd_1,
@@ -353,7 +338,7 @@ run (void *cls,
353 s_rd_2 = create_record (1); 338 s_rd_2 = create_record (1);
354 GNUNET_assert (NULL != (ns_ops[1] = 339 GNUNET_assert (NULL != (ns_ops[1] =
355 GNUNET_NAMESTORE_records_store (nsh, 340 GNUNET_NAMESTORE_records_store (nsh,
356 privkey, 341 &privkey,
357 s_name_2, 342 s_name_2,
358 1, 343 1,
359 s_rd_2, 344 s_rd_2,