diff options
Diffstat (limited to 'src/topology/gnunet-daemon-topology.c')
-rw-r--r-- | src/topology/gnunet-daemon-topology.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index a67023542..12171139e 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -508,7 +508,7 @@ consider_for_advertising (const struct GNUNET_HELLO_Message *hello) | |||
508 | &have_address); | 508 | &have_address); |
509 | if (GNUNET_NO == have_address) | 509 | if (GNUNET_NO == have_address) |
510 | return; /* no point in advertising this one... */ | 510 | return; /* no point in advertising this one... */ |
511 | GNUNET_HELLO_get_id (hello, &pid); | 511 | GNUNET_break (GNUNET_OK == GNUNET_HELLO_get_id (hello, &pid)); |
512 | pos = hellos; | 512 | pos = hellos; |
513 | while (pos != NULL) | 513 | while (pos != NULL) |
514 | { | 514 | { |
@@ -736,11 +736,18 @@ read_friends_file (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
736 | unsigned int entries_found; | 736 | unsigned int entries_found; |
737 | struct PeerList *fl; | 737 | struct PeerList *fl; |
738 | 738 | ||
739 | fn = NULL; | 739 | if (GNUNET_OK != |
740 | GNUNET_CONFIGURATION_get_value_filename (cfg, | 740 | GNUNET_CONFIGURATION_get_value_filename (cfg, |
741 | "TOPOLOGY", | 741 | "TOPOLOGY", |
742 | "FRIENDS", | 742 | "FRIENDS", |
743 | &fn); | 743 | &fn)) |
744 | { | ||
745 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
746 | _("Option `%s' in section `%s' not specified!\n"), | ||
747 | "FRIENDS", | ||
748 | "TOPOLOGY"); | ||
749 | return; | ||
750 | } | ||
744 | if (GNUNET_OK != GNUNET_DISK_file_test (fn)) | 751 | if (GNUNET_OK != GNUNET_DISK_file_test (fn)) |
745 | GNUNET_DISK_fn_write (fn, NULL, 0, GNUNET_DISK_PERM_USER_READ | 752 | GNUNET_DISK_fn_write (fn, NULL, 0, GNUNET_DISK_PERM_USER_READ |
746 | | GNUNET_DISK_PERM_USER_WRITE); | 753 | | GNUNET_DISK_PERM_USER_WRITE); |
@@ -920,7 +927,7 @@ hello_advertising (void *cls, | |||
920 | if (0 == GNUNET_TIME_absolute_get_remaining (pos->expiration).value) | 927 | if (0 == GNUNET_TIME_absolute_get_remaining (pos->expiration).value) |
921 | { | 928 | { |
922 | /* time to discard... */ | 929 | /* time to discard... */ |
923 | if (prev == NULL) | 930 | if (prev != NULL) |
924 | prev->next = next; | 931 | prev->next = next; |
925 | else | 932 | else |
926 | hellos = next; | 933 | hellos = next; |
@@ -1015,17 +1022,19 @@ run (void *cls, | |||
1015 | friends_only = GNUNET_CONFIGURATION_get_value_yesno (cfg, | 1022 | friends_only = GNUNET_CONFIGURATION_get_value_yesno (cfg, |
1016 | "TOPOLOGY", | 1023 | "TOPOLOGY", |
1017 | "FRIENDS-ONLY"); | 1024 | "FRIENDS-ONLY"); |
1018 | opt = 0; | 1025 | if (GNUNET_OK != |
1019 | GNUNET_CONFIGURATION_get_value_number (cfg, | 1026 | GNUNET_CONFIGURATION_get_value_number (cfg, |
1020 | "TOPOLOGY", | 1027 | "TOPOLOGY", |
1021 | "MINIMUM-FRIENDS", | 1028 | "MINIMUM-FRIENDS", |
1022 | &opt); | 1029 | &opt)) |
1030 | opt = 0; | ||
1023 | minimum_friend_count = (unsigned int) opt; | 1031 | minimum_friend_count = (unsigned int) opt; |
1024 | opt = 16; | 1032 | if (GNUNET_OK != |
1025 | GNUNET_CONFIGURATION_get_value_number (cfg, | 1033 | GNUNET_CONFIGURATION_get_value_number (cfg, |
1026 | "TOPOLOGY", | 1034 | "TOPOLOGY", |
1027 | "TARGET-CONNECTION-COUNT", | 1035 | "TARGET-CONNECTION-COUNT", |
1028 | &opt); | 1036 | &opt)) |
1037 | opt = 16; | ||
1029 | target_connection_count = (unsigned int) opt; | 1038 | target_connection_count = (unsigned int) opt; |
1030 | 1039 | ||
1031 | if ( (friends_only == GNUNET_YES) || | 1040 | if ( (friends_only == GNUNET_YES) || |