aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim
diff options
context:
space:
mode:
Diffstat (limited to 'src/reclaim')
-rw-r--r--src/reclaim/gnunet-reclaim.c45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/reclaim/gnunet-reclaim.c b/src/reclaim/gnunet-reclaim.c
index 837b42916..677e9f49f 100644
--- a/src/reclaim/gnunet-reclaim.c
+++ b/src/reclaim/gnunet-reclaim.c
@@ -187,8 +187,8 @@ store_attr_cont (void *cls,
187{ 187{
188 reclaim_op = NULL; 188 reclaim_op = NULL;
189 if (GNUNET_SYSERR == success) { 189 if (GNUNET_SYSERR == success) {
190 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 190 fprintf (stderr,
191 "%s\n", emsg); 191 "%s\n", emsg);
192 } 192 }
193 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 193 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
194} 194}
@@ -199,6 +199,8 @@ process_attrs (void *cls,
199 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr) 199 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr)
200{ 200{
201 char *value_str; 201 char *value_str;
202 const char* attr_type;
203
202 if (NULL == identity) 204 if (NULL == identity)
203 { 205 {
204 reclaim_op = NULL; 206 reclaim_op = NULL;
@@ -213,8 +215,9 @@ process_attrs (void *cls,
213 value_str = GNUNET_RECLAIM_ATTRIBUTE_value_to_string (attr->type, 215 value_str = GNUNET_RECLAIM_ATTRIBUTE_value_to_string (attr->type,
214 attr->data, 216 attr->data,
215 attr->data_size); 217 attr->data_size);
216 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 218 attr_type = GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (attr->type);
217 "%s: %s\n", attr->name, value_str); 219 fprintf (stdout,
220 "%s: %s [%s,v%u]\n", attr->name, value_str, attr_type, attr->version);
218} 221}
219 222
220 223
@@ -222,8 +225,8 @@ static void
222iter_error (void *cls) 225iter_error (void *cls)
223{ 226{
224 attr_iterator = NULL; 227 attr_iterator = NULL;
225 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 228 fprintf (stderr,
226 "Failed to iterate over attributes\n"); 229 "Failed to iterate over attributes\n");
227 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 230 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
228} 231}
229 232
@@ -232,8 +235,8 @@ timeout_task (void *cls)
232{ 235{
233 timeout = NULL; 236 timeout = NULL;
234 ret = 1; 237 ret = 1;
235 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 238 fprintf (stderr,
236 "Timeout\n"); 239 "Timeout\n");
237 if (NULL == cleanup_task) 240 if (NULL == cleanup_task)
238 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 241 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
239} 242}
@@ -244,8 +247,8 @@ process_rvk (void *cls, int success, const char* msg)
244 reclaim_op = NULL; 247 reclaim_op = NULL;
245 if (GNUNET_OK != success) 248 if (GNUNET_OK != success)
246 { 249 {
247 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 250 fprintf (stderr,
248 "Revocation failed.\n"); 251 "Revocation failed.\n");
249 ret = 1; 252 ret = 1;
250 } 253 }
251 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 254 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
@@ -382,7 +385,7 @@ iter_cb (void *cls,
382 attr->data_size); 385 attr->data_size);
383 attr_type = GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (attr->type); 386 attr_type = GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (attr->type);
384 fprintf (stdout, 387 fprintf (stdout,
385 "%s\t%s\t%u\t%s\n", attr->name, attr_type, attr->version, attr_str); 388 "%s: %s [%s,v%u]\n", attr->name, attr_str, attr_type, attr->version);
386 } 389 }
387 GNUNET_RECLAIM_get_attributes_next (attr_iterator); 390 GNUNET_RECLAIM_get_attributes_next (attr_iterator);
388} 391}
@@ -392,8 +395,8 @@ start_get_attributes ()
392{ 395{
393 if (NULL == pkey) 396 if (NULL == pkey)
394 { 397 {
395 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 398 fprintf (stderr,
396 "Ego %s not found\n", ego_name); 399 "Ego %s not found\n", ego_name);
397 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); 400 cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
398 return; 401 return;
399 } 402 }
@@ -413,10 +416,6 @@ start_get_attributes ()
413 &ticket, 416 &ticket,
414 sizeof (struct GNUNET_RECLAIM_Ticket)); 417 sizeof (struct GNUNET_RECLAIM_Ticket));
415 418
416 if (list)
417 fprintf (stdout,
418 "Name\tType\tVersion\tValue\n");
419
420 attr_list = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList); 419 attr_list = GNUNET_new (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList);
421 claim = NULL; 420 claim = NULL;
422 attr_iterator = GNUNET_RECLAIM_get_attributes_start (reclaim_handle, 421 attr_iterator = GNUNET_RECLAIM_get_attributes_start (reclaim_handle,
@@ -462,24 +461,24 @@ run (void *cls,
462 if (NULL == ego_name) 461 if (NULL == ego_name)
463 { 462 {
464 ret = 1; 463 ret = 1;
465 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 464 fprintf (stderr,
466 _("Ego is required\n")); 465 _("Ego is required\n"));
467 return; 466 return;
468 } 467 }
469 468
470 if ( (NULL == attr_value) && (NULL != attr_name) ) 469 if ( (NULL == attr_value) && (NULL != attr_name) )
471 { 470 {
472 ret = 1; 471 ret = 1;
473 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 472 fprintf (stderr,
474 _("Attribute value missing!\n")); 473 _("Attribute value missing!\n"));
475 return; 474 return;
476 } 475 }
477 476
478 if ( (NULL == rp) && (NULL != issue_attrs) ) 477 if ( (NULL == rp) && (NULL != issue_attrs) )
479 { 478 {
480 ret = 1; 479 ret = 1;
481 GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, 480 fprintf (stderr,
482 _("Requesting party key is required!\n")); 481 _("Requesting party key is required!\n"));
483 return; 482 return;
484 } 483 }
485 484