diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-04-10 09:02:17 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-04-10 09:02:17 +0000 |
commit | 60c01495b1f945b9755d72261f1c6f5ea8ea1fda (patch) | |
tree | 52a55b4f47abda37fa5f37f6a057aabdb3720271 | |
parent | 54ed2dc773c3f009f6861af2317f26b031e9d2a3 (diff) | |
download | gnunet-60c01495b1f945b9755d72261f1c6f5ea8ea1fda.tar.gz gnunet-60c01495b1f945b9755d72261f1c6f5ea8ea1fda.zip |
multiple major fixes:
- shipped hellos were never parsed
- when hello files was parsed from certain file, hello from this was ignored
major changes in this commit which can break functionality atm
-rw-r--r-- | src/peerinfo/gnunet-service-peerinfo.c | 223 | ||||
-rw-r--r-- | src/peerinfo/test_peerinfo_api.c | 4 | ||||
-rw-r--r-- | src/peerinfo/test_peerinfo_api_friend_only.c | 4 | ||||
-rw-r--r-- | src/peerinfo/test_peerinfo_shipped_hellos.c | 2 |
4 files changed, 120 insertions, 113 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 309b954f1..d08f9920c 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c | |||
@@ -278,15 +278,19 @@ notify_all (struct HostEntry *entry) | |||
278 | for (cur = nc_head; NULL != cur; cur = cur->next) | 278 | for (cur = nc_head; NULL != cur; cur = cur->next) |
279 | { | 279 | { |
280 | if (GNUNET_NO == cur->include_friend_only) | 280 | if (GNUNET_NO == cur->include_friend_only) |
281 | { | ||
281 | GNUNET_SERVER_notification_context_unicast (notify_list, | 282 | GNUNET_SERVER_notification_context_unicast (notify_list, |
282 | cur->client, | 283 | cur->client, |
283 | &msg_pub->header, | 284 | &msg_pub->header, |
284 | GNUNET_NO); | 285 | GNUNET_NO); |
286 | } | ||
285 | if (GNUNET_YES == cur->include_friend_only) | 287 | if (GNUNET_YES == cur->include_friend_only) |
288 | { | ||
286 | GNUNET_SERVER_notification_context_unicast (notify_list, | 289 | GNUNET_SERVER_notification_context_unicast (notify_list, |
287 | cur->client, | 290 | cur->client, |
288 | &msg_friend->header, | 291 | &msg_friend->header, |
289 | GNUNET_NO); | 292 | GNUNET_NO); |
293 | } | ||
290 | } | 294 | } |
291 | GNUNET_free (msg_pub); | 295 | GNUNET_free (msg_pub); |
292 | GNUNET_free (msg_friend); | 296 | GNUNET_free (msg_friend); |
@@ -300,7 +304,7 @@ notify_all (struct HostEntry *entry) | |||
300 | * @param hello the verified (!) hello message | 304 | * @param hello the verified (!) hello message |
301 | */ | 305 | */ |
302 | static void | 306 | static void |
303 | bind_address (const struct GNUNET_PeerIdentity *peer, | 307 | update_hello (const struct GNUNET_PeerIdentity *peer, |
304 | const struct GNUNET_HELLO_Message *hello); | 308 | const struct GNUNET_HELLO_Message *hello); |
305 | 309 | ||
306 | 310 | ||
@@ -310,6 +314,9 @@ bind_address (const struct GNUNET_PeerIdentity *peer, | |||
310 | * addresses are expired, the HELLO is also removed (but the HELLO | 314 | * addresses are expired, the HELLO is also removed (but the HELLO |
311 | * with the public key is still returned if it was found and valid). | 315 | * with the public key is still returned if it was found and valid). |
312 | * | 316 | * |
317 | * The file can contain up to two HELLO messages, a public and a friend only | ||
318 | * HELLO | ||
319 | * | ||
313 | * @param fn name of the file | 320 | * @param fn name of the file |
314 | * @param unlink_garbage if GNUNET_YES, try to remove useless files | 321 | * @param unlink_garbage if GNUNET_YES, try to remove useless files |
315 | */ | 322 | */ |
@@ -338,7 +345,9 @@ read_host_file (const char *fn, int unlink_garbage, struct ReadHostFileContext * | |||
338 | r->hello = NULL; | 345 | r->hello = NULL; |
339 | 346 | ||
340 | if (GNUNET_YES != GNUNET_DISK_file_test (fn)) | 347 | if (GNUNET_YES != GNUNET_DISK_file_test (fn)) |
348 | { | ||
341 | return; | 349 | return; |
350 | } | ||
342 | 351 | ||
343 | size_total = GNUNET_DISK_fn_read (fn, buffer, sizeof (buffer)); | 352 | size_total = GNUNET_DISK_fn_read (fn, buffer, sizeof (buffer)); |
344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read %u bytes from `%s'\n", size_total, fn); | 353 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read %u bytes from `%s'\n", size_total, fn); |
@@ -436,6 +445,12 @@ read_host_file (const char *fn, int unlink_garbage, struct ReadHostFileContext * | |||
436 | else | 445 | else |
437 | r->friend_only_hello = hello_clean_2nd; | 446 | r->friend_only_hello = hello_clean_2nd; |
438 | } | 447 | } |
448 | |||
449 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found `%s' and `%s' HELLO message in file\n", | ||
450 | (NULL != r->hello) ? "public" : "NO public", | ||
451 | (NULL != r->friend_only_hello) ? "friend only" : "NO friend only"); | ||
452 | |||
453 | |||
439 | } | 454 | } |
440 | 455 | ||
441 | 456 | ||
@@ -444,7 +459,7 @@ read_host_file (const char *fn, int unlink_garbage, struct ReadHostFileContext * | |||
444 | * | 459 | * |
445 | * @param identity the identity of the host | 460 | * @param identity the identity of the host |
446 | */ | 461 | */ |
447 | static void | 462 | static struct HostEntry * |
448 | add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity) | 463 | add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity) |
449 | { | 464 | { |
450 | struct HostEntry *entry; | 465 | struct HostEntry *entry; |
@@ -452,24 +467,25 @@ add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity) | |||
452 | char *fn; | 467 | char *fn; |
453 | 468 | ||
454 | entry = GNUNET_CONTAINER_multihashmap_get (hostmap, &identity->hashPubKey); | 469 | entry = GNUNET_CONTAINER_multihashmap_get (hostmap, &identity->hashPubKey); |
455 | if (NULL != entry) | 470 | if (NULL == entry) |
456 | return; | 471 | { |
457 | GNUNET_STATISTICS_update (stats, gettext_noop ("# peers known"), 1, | 472 | GNUNET_STATISTICS_update (stats, gettext_noop ("# peers known"), 1, |
458 | GNUNET_NO); | 473 | GNUNET_NO); |
459 | entry = GNUNET_malloc (sizeof (struct HostEntry)); | 474 | entry = GNUNET_malloc (sizeof (struct HostEntry)); |
460 | entry->identity = *identity; | 475 | entry->identity = *identity; |
461 | GNUNET_CONTAINER_multihashmap_put (hostmap, &entry->identity.hashPubKey, entry, | 476 | GNUNET_CONTAINER_multihashmap_put (hostmap, &entry->identity.hashPubKey, entry, |
462 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); | 477 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); |
463 | 478 | ||
464 | fn = get_host_filename (identity); | 479 | fn = get_host_filename (identity); |
465 | if (NULL != fn) | 480 | if (NULL != fn) |
466 | { | 481 | { |
467 | read_host_file (fn, GNUNET_YES, &r); | 482 | read_host_file (fn, GNUNET_YES, &r); |
468 | entry->hello = r.hello; | 483 | entry->hello = r.hello; |
469 | entry->friend_only_hello = r.friend_only_hello; | 484 | entry->friend_only_hello = r.friend_only_hello; |
470 | GNUNET_free (fn); | 485 | GNUNET_free (fn); |
486 | } | ||
471 | } | 487 | } |
472 | notify_all (entry); | 488 | return entry; |
473 | } | 489 | } |
474 | 490 | ||
475 | 491 | ||
@@ -537,102 +553,81 @@ hosts_directory_scan_callback (void *cls, const char *fullname) | |||
537 | if (GNUNET_YES != GNUNET_DISK_file_test (fullname)) | 553 | if (GNUNET_YES != GNUNET_DISK_file_test (fullname)) |
538 | return GNUNET_OK; /* ignore non-files */ | 554 | return GNUNET_OK; /* ignore non-files */ |
539 | 555 | ||
540 | if (GNUNET_YES != GNUNET_DISK_file_test (fullname)) | ||
541 | return GNUNET_OK; /* ignore non-files */ | ||
542 | |||
543 | filename = fullname; | ||
544 | filename = strrchr (fullname, DIR_SEPARATOR); | 556 | filename = strrchr (fullname, DIR_SEPARATOR); |
545 | if ((NULL == filename) || (1 > strlen (filename))) | 557 | if ((NULL == filename) || (1 > strlen (filename))) |
546 | filename = fullname; | 558 | filename = fullname; |
547 | else | 559 | else |
548 | filename ++; | 560 | filename ++; |
549 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reading `%s'\n", filename); | ||
550 | |||
551 | if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (filename, &identity.hashPubKey)) | ||
552 | { | ||
553 | 561 | ||
554 | /* odd filename, but might still be valid, try getting identity from HELLO */ | 562 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reading %s `%s'\n", fullname, filename); |
555 | read_host_file (fullname, dsc->remove_files, &r); | 563 | read_host_file (fullname, dsc->remove_files, &r); |
556 | if ( (NULL == r.hello) && (NULL == r.friend_only_hello) ) | ||
557 | { | ||
558 | if (GNUNET_YES == dsc->remove_files) | ||
559 | remove_garbage (fullname); | ||
560 | return GNUNET_OK; | ||
561 | } | ||
562 | 564 | ||
563 | if (NULL != r.friend_only_hello) | 565 | if ( (NULL == r.hello) && (NULL == r.friend_only_hello)) |
564 | { | 566 | { |
565 | if (GNUNET_OK != GNUNET_HELLO_get_id (r.friend_only_hello, &id_friend)) | 567 | if (GNUNET_YES == dsc->remove_files) |
566 | if (GNUNET_YES == dsc->remove_files) | 568 | remove_garbage (fullname); |
567 | { | 569 | return GNUNET_OK; |
568 | remove_garbage (fullname); | 570 | } |
569 | return GNUNET_OK; | ||
570 | } | ||
571 | id = id_friend; | ||
572 | } | ||
573 | if (NULL != r.hello) | ||
574 | { | ||
575 | if (GNUNET_OK != GNUNET_HELLO_get_id (r.hello, &id_public)) | ||
576 | if (GNUNET_YES == dsc->remove_files) | ||
577 | { | ||
578 | remove_garbage (fullname); | ||
579 | return GNUNET_OK; | ||
580 | } | ||
581 | id = id_public; | ||
582 | } | ||
583 | 571 | ||
584 | if ( (NULL != r.hello) && (NULL != r.friend_only_hello) && | 572 | if (NULL != r.friend_only_hello) |
585 | (0 != memcmp (&id_friend, &id_public, sizeof (id_friend))) ) | 573 | { |
586 | { | 574 | if (GNUNET_OK != GNUNET_HELLO_get_id (r.friend_only_hello, &id_friend)) |
587 | /* HELLOs are not for the same peer */ | ||
588 | GNUNET_break (0); | ||
589 | if (GNUNET_YES == dsc->remove_files) | 575 | if (GNUNET_YES == dsc->remove_files) |
576 | { | ||
590 | remove_garbage (fullname); | 577 | remove_garbage (fullname); |
591 | return GNUNET_OK; | 578 | return GNUNET_OK; |
592 | } | 579 | } |
593 | 580 | id = id_friend; | |
594 | /* ok, found something valid, remember HELLO */ | 581 | } |
595 | entry = GNUNET_CONTAINER_multihashmap_get (hostmap, &id.hashPubKey); | 582 | if (NULL != r.hello) |
596 | if (NULL == entry) | 583 | { |
597 | { | 584 | if (GNUNET_OK != GNUNET_HELLO_get_id (r.hello, &id_public)) |
598 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Adding new peer `%s' with %s %s HELLO \n", | 585 | if (GNUNET_YES == dsc->remove_files) |
599 | GNUNET_i2s (&entry->identity), | 586 | { |
600 | (NULL != r.hello) ? "public" : "", | 587 | remove_garbage (fullname); |
601 | (NULL != r.friend_only_hello) ? "friend-only" : ""); | 588 | return GNUNET_OK; |
602 | /* Add new entry */ | 589 | } |
603 | entry = GNUNET_malloc (sizeof (struct HostEntry)); | 590 | id = id_public; |
604 | entry->identity = id; | 591 | } |
605 | entry->hello = r.hello; | ||
606 | entry->friend_only_hello = r.friend_only_hello; | ||
607 | GNUNET_CONTAINER_multihashmap_put (hostmap, &entry->identity.hashPubKey, entry, | ||
608 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); | ||
609 | } | ||
610 | else | ||
611 | { | ||
612 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Updating existing peer `%s' with %s %s HELLO \n", | ||
613 | GNUNET_i2s (&entry->identity), | ||
614 | (NULL != r.hello) ? "public" : "", | ||
615 | (NULL != r.friend_only_hello) ? "friend-only" : ""); | ||
616 | /* Update entry */ | ||
617 | if (NULL != r.hello) | ||
618 | { | ||
619 | bind_address (&id, r.hello); | ||
620 | GNUNET_free (r.hello); | ||
621 | } | ||
622 | if (NULL != r.friend_only_hello) | ||
623 | { | ||
624 | bind_address (&id, r.friend_only_hello); | ||
625 | GNUNET_free (r.friend_only_hello); | ||
626 | } | ||
627 | } | ||
628 | 592 | ||
629 | notify_all (entry); | 593 | if ( (NULL != r.hello) && (NULL != r.friend_only_hello) && |
630 | dsc->matched++; | 594 | (0 != memcmp (&id_friend, &id_public, sizeof (id_friend))) ) |
595 | { | ||
596 | /* HELLOs are not for the same peer */ | ||
597 | GNUNET_break (0); | ||
598 | if (GNUNET_YES == dsc->remove_files) | ||
599 | remove_garbage (fullname); | ||
631 | return GNUNET_OK; | 600 | return GNUNET_OK; |
601 | } | ||
602 | if (GNUNET_OK == GNUNET_CRYPTO_hash_from_string (filename, &identity.hashPubKey)) | ||
603 | { | ||
604 | if (0 != memcmp (&id, &identity, sizeof (id_friend))) | ||
605 | { | ||
606 | /* HELLOs are not for the same peer */ | ||
607 | GNUNET_break (0); | ||
608 | if (GNUNET_YES == dsc->remove_files) | ||
609 | remove_garbage (fullname); | ||
610 | return GNUNET_OK; | ||
611 | } | ||
632 | } | 612 | } |
633 | dsc->matched++; | 613 | /* ok, found something valid, remember HELLO */ |
634 | add_host_to_known_hosts (&identity); | 614 | entry = add_host_to_known_hosts (&id); |
635 | return GNUNET_OK; | 615 | if (NULL != r.hello) |
616 | { | ||
617 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updating peer `%s' public HELLO \n", | ||
618 | GNUNET_i2s (&id)); | ||
619 | update_hello (&id, r.hello); | ||
620 | } | ||
621 | if (NULL != r.friend_only_hello) | ||
622 | { | ||
623 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updating peer `%s' friend only HELLO \n", | ||
624 | GNUNET_i2s (&id)); | ||
625 | update_hello (&id, r.friend_only_hello); | ||
626 | } | ||
627 | |||
628 | notify_all (entry); | ||
629 | dsc->matched++; | ||
630 | return GNUNET_OK; | ||
636 | } | 631 | } |
637 | 632 | ||
638 | 633 | ||
@@ -702,7 +697,7 @@ update_friend_hello (const struct GNUNET_HELLO_Message *hello, | |||
702 | * @param hello the verified (!) hello message | 697 | * @param hello the verified (!) hello message |
703 | */ | 698 | */ |
704 | static void | 699 | static void |
705 | bind_address (const struct GNUNET_PeerIdentity *peer, | 700 | update_hello (const struct GNUNET_PeerIdentity *peer, |
706 | const struct GNUNET_HELLO_Message *hello) | 701 | const struct GNUNET_HELLO_Message *hello) |
707 | { | 702 | { |
708 | char *fn; | 703 | char *fn; |
@@ -718,7 +713,6 @@ bind_address (const struct GNUNET_PeerIdentity *peer, | |||
718 | int pos; | 713 | int pos; |
719 | char *buffer; | 714 | char *buffer; |
720 | 715 | ||
721 | add_host_to_known_hosts (peer); | ||
722 | host = GNUNET_CONTAINER_multihashmap_get (hostmap, &peer->hashPubKey); | 716 | host = GNUNET_CONTAINER_multihashmap_get (hostmap, &peer->hashPubKey); |
723 | GNUNET_assert (NULL != host); | 717 | GNUNET_assert (NULL != host); |
724 | 718 | ||
@@ -758,6 +752,7 @@ bind_address (const struct GNUNET_PeerIdentity *peer, | |||
758 | 752 | ||
759 | if ((NULL != (host->hello)) && (GNUNET_NO == friend_hello_type)) | 753 | if ((NULL != (host->hello)) && (GNUNET_NO == friend_hello_type)) |
760 | { | 754 | { |
755 | /* Update friend only hello */ | ||
761 | mrg = update_friend_hello (host->hello, host->friend_only_hello); | 756 | mrg = update_friend_hello (host->hello, host->friend_only_hello); |
762 | if (NULL != host->friend_only_hello) | 757 | if (NULL != host->friend_only_hello) |
763 | GNUNET_free (host->friend_only_hello); | 758 | GNUNET_free (host->friend_only_hello); |
@@ -769,6 +764,8 @@ bind_address (const struct GNUNET_PeerIdentity *peer, | |||
769 | if (NULL != host->friend_only_hello) | 764 | if (NULL != host->friend_only_hello) |
770 | GNUNET_assert ((GNUNET_YES == GNUNET_HELLO_is_friend_only(host->friend_only_hello))); | 765 | GNUNET_assert ((GNUNET_YES == GNUNET_HELLO_is_friend_only(host->friend_only_hello))); |
771 | 766 | ||
767 | store_hello = GNUNET_NO; | ||
768 | store_friend_hello = GNUNET_NO; | ||
772 | fn = get_host_filename (peer); | 769 | fn = get_host_filename (peer); |
773 | if ( (NULL != fn) && | 770 | if ( (NULL != fn) && |
774 | (GNUNET_OK == GNUNET_DISK_directory_create_for_file (fn)) ) | 771 | (GNUNET_OK == GNUNET_DISK_directory_create_for_file (fn)) ) |
@@ -864,16 +861,25 @@ add_to_tc (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
864 | GNUNET_assert (hs < GNUNET_SERVER_MAX_MESSAGE_SIZE - | 861 | GNUNET_assert (hs < GNUNET_SERVER_MAX_MESSAGE_SIZE - |
865 | sizeof (struct InfoMessage)); | 862 | sizeof (struct InfoMessage)); |
866 | memcpy (&im[1], pos->hello, hs); | 863 | memcpy (&im[1], pos->hello, hs); |
864 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding public HELLO with size %u for peer `%s'\n", | ||
865 | hs, GNUNET_h2s (key)); | ||
867 | } | 866 | } |
868 | 867 | else if ((pos->friend_only_hello != NULL) && (GNUNET_YES == tc->friend_only)) | |
869 | if ((pos->friend_only_hello != NULL) && (GNUNET_YES == tc->friend_only)) | ||
870 | { | 868 | { |
871 | /* Copy friend only HELLO */ | 869 | /* Copy friend only HELLO */ |
872 | hs = GNUNET_HELLO_size (pos->friend_only_hello); | 870 | hs = GNUNET_HELLO_size (pos->friend_only_hello); |
873 | GNUNET_assert (hs < GNUNET_SERVER_MAX_MESSAGE_SIZE - | 871 | GNUNET_assert (hs < GNUNET_SERVER_MAX_MESSAGE_SIZE - |
874 | sizeof (struct InfoMessage)); | 872 | sizeof (struct InfoMessage)); |
875 | memcpy (&im[1], pos->friend_only_hello, hs); | 873 | memcpy (&im[1], pos->friend_only_hello, hs); |
874 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding public HELLO with size %u for peer `%s'\n", | ||
875 | hs, GNUNET_h2s (key)); | ||
876 | } | ||
877 | else | ||
878 | { | ||
879 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding no HELLO for peer `%s'\n", | ||
880 | GNUNET_h2s (key)); | ||
876 | } | 881 | } |
882 | |||
877 | im->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_INFO); | 883 | im->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_INFO); |
878 | im->header.size = htons (sizeof (struct InfoMessage) + hs); | 884 | im->header.size = htons (sizeof (struct InfoMessage) + hs); |
879 | im->reserved = htonl (0); | 885 | im->reserved = htonl (0); |
@@ -977,7 +983,8 @@ handle_hello (void *cls, struct GNUNET_SERVER_Client *client, | |||
977 | } | 983 | } |
978 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n", | 984 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n", |
979 | "HELLO", GNUNET_i2s (&pid)); | 985 | "HELLO", GNUNET_i2s (&pid)); |
980 | bind_address (&pid, hello); | 986 | add_host_to_known_hosts (&pid); |
987 | update_hello (&pid, hello); | ||
981 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 988 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
982 | } | 989 | } |
983 | 990 | ||
@@ -1213,13 +1220,13 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
1213 | "HOSTS", | 1220 | "HOSTS", |
1214 | &networkIdDirectory)); | 1221 | &networkIdDirectory)); |
1215 | GNUNET_DISK_directory_create (networkIdDirectory); | 1222 | GNUNET_DISK_directory_create (networkIdDirectory); |
1216 | 1223 | #if 0 | |
1217 | GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, | 1224 | GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, |
1218 | &cron_scan_directory_data_hosts, NULL); /* CHECK */ | 1225 | &cron_scan_directory_data_hosts, NULL); /* CHECK */ |
1219 | 1226 | ||
1220 | GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, | 1227 | GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, |
1221 | &cron_clean_data_hosts, NULL); /* CHECK */ | 1228 | &cron_clean_data_hosts, NULL); /* CHECK */ |
1222 | 1229 | #endif | |
1223 | ip = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR); | 1230 | ip = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR); |
1224 | GNUNET_asprintf (&peerdir, | 1231 | GNUNET_asprintf (&peerdir, |
1225 | "%shellos", | 1232 | "%shellos", |
diff --git a/src/peerinfo/test_peerinfo_api.c b/src/peerinfo/test_peerinfo_api.c index d3dcc2fd0..a68b2bdb7 100644 --- a/src/peerinfo/test_peerinfo_api.c +++ b/src/peerinfo/test_peerinfo_api.c | |||
@@ -81,12 +81,12 @@ address_generator (void *cls, size_t max, void *buf) | |||
81 | return ret; | 81 | return ret; |
82 | } | 82 | } |
83 | 83 | ||
84 | struct GNUNET_PeerIdentity pid; | ||
84 | 85 | ||
85 | static void | 86 | static void |
86 | add_peer () | 87 | add_peer () |
87 | { | 88 | { |
88 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; | 89 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; |
89 | struct GNUNET_PeerIdentity pid; | ||
90 | struct GNUNET_HELLO_Message *h2; | 90 | struct GNUNET_HELLO_Message *h2; |
91 | size_t agc; | 91 | size_t agc; |
92 | 92 | ||
@@ -152,7 +152,7 @@ run (void *cls, | |||
152 | h = GNUNET_PEERINFO_connect (cfg); | 152 | h = GNUNET_PEERINFO_connect (cfg); |
153 | GNUNET_assert (NULL != h); | 153 | GNUNET_assert (NULL != h); |
154 | add_peer (); | 154 | add_peer (); |
155 | ic = GNUNET_PEERINFO_iterate (h, GNUNET_NO, NULL, | 155 | ic = GNUNET_PEERINFO_iterate (h, GNUNET_NO, &pid, |
156 | GNUNET_TIME_relative_multiply | 156 | GNUNET_TIME_relative_multiply |
157 | (GNUNET_TIME_UNIT_SECONDS, 15), &process, cls); | 157 | (GNUNET_TIME_UNIT_SECONDS, 15), &process, cls); |
158 | } | 158 | } |
diff --git a/src/peerinfo/test_peerinfo_api_friend_only.c b/src/peerinfo/test_peerinfo_api_friend_only.c index 61abd40c6..4c3d3b3ef 100644 --- a/src/peerinfo/test_peerinfo_api_friend_only.c +++ b/src/peerinfo/test_peerinfo_api_friend_only.c | |||
@@ -63,12 +63,12 @@ address_generator (void *cls, size_t max, void *buf) | |||
63 | return ret; | 63 | return ret; |
64 | } | 64 | } |
65 | 65 | ||
66 | struct GNUNET_PeerIdentity pid; | ||
66 | 67 | ||
67 | static void | 68 | static void |
68 | add_peer () | 69 | add_peer () |
69 | { | 70 | { |
70 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; | 71 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pkey; |
71 | struct GNUNET_PeerIdentity pid; | ||
72 | struct GNUNET_HELLO_Message *h2; | 72 | struct GNUNET_HELLO_Message *h2; |
73 | size_t agc; | 73 | size_t agc; |
74 | 74 | ||
@@ -138,7 +138,7 @@ run (void *cls, | |||
138 | h = GNUNET_PEERINFO_connect (cfg); | 138 | h = GNUNET_PEERINFO_connect (cfg); |
139 | GNUNET_assert (NULL != h); | 139 | GNUNET_assert (NULL != h); |
140 | add_peer (); | 140 | add_peer (); |
141 | ic = GNUNET_PEERINFO_iterate (h, GNUNET_NO, NULL, | 141 | ic = GNUNET_PEERINFO_iterate (h, GNUNET_NO, &pid, |
142 | GNUNET_TIME_relative_multiply | 142 | GNUNET_TIME_relative_multiply |
143 | (GNUNET_TIME_UNIT_SECONDS, 15), &process, cls); | 143 | (GNUNET_TIME_UNIT_SECONDS, 15), &process, cls); |
144 | } | 144 | } |
diff --git a/src/peerinfo/test_peerinfo_shipped_hellos.c b/src/peerinfo/test_peerinfo_shipped_hellos.c index e8cbd519d..0c3ae2b3c 100644 --- a/src/peerinfo/test_peerinfo_shipped_hellos.c +++ b/src/peerinfo/test_peerinfo_shipped_hellos.c | |||
@@ -83,7 +83,7 @@ process (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
83 | } | 83 | } |
84 | else | 84 | else |
85 | { | 85 | { |
86 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed: %u callbacks\n", calls); | 86 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got %u callbacks\n", calls); |
87 | global_ret = 0; | 87 | global_ret = 0; |
88 | } | 88 | } |
89 | } | 89 | } |