diff options
Diffstat (limited to 'src/hostlist/hostlist-client.c')
-rw-r--r-- | src/hostlist/hostlist-client.c | 151 |
1 files changed, 63 insertions, 88 deletions
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c index 422855f0e..c049dceea 100644 --- a/src/hostlist/hostlist-client.c +++ b/src/hostlist/hostlist-client.c | |||
@@ -366,8 +366,8 @@ get_bootstrap_server () | |||
366 | size_t pos; | 366 | size_t pos; |
367 | 367 | ||
368 | if (GNUNET_OK != | 368 | if (GNUNET_OK != |
369 | GNUNET_CONFIGURATION_get_value_string (cfg, | 369 | GNUNET_CONFIGURATION_get_value_string (cfg, "HOSTLIST", "SERVERS", |
370 | "HOSTLIST", "SERVERS", &servers)) | 370 | &servers)) |
371 | { | 371 | { |
372 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 372 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
373 | _ | 373 | _ |
@@ -453,8 +453,8 @@ download_get_url () | |||
453 | current_hostlist = NULL; | 453 | current_hostlist = NULL; |
454 | return get_bootstrap_server (); | 454 | return get_bootstrap_server (); |
455 | } | 455 | } |
456 | index = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | 456 | index = |
457 | linked_list_size); | 457 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, linked_list_size); |
458 | counter = 0; | 458 | counter = 0; |
459 | pos = linked_list_head; | 459 | pos = linked_list_head; |
460 | while (counter < index) | 460 | while (counter < index) |
@@ -462,8 +462,8 @@ download_get_url () | |||
462 | pos = pos->next; | 462 | pos = pos->next; |
463 | counter++; | 463 | counter++; |
464 | } | 464 | } |
465 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 465 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using learned hostlist `%s'\n", |
466 | "Using learned hostlist `%s'\n", pos->hostlist_uri); | 466 | pos->hostlist_uri); |
467 | current_hostlist = pos; | 467 | current_hostlist = pos; |
468 | return strdup (pos->hostlist_uri); | 468 | return strdup (pos->hostlist_uri); |
469 | } | 469 | } |
@@ -585,11 +585,10 @@ insert_hostlist () | |||
585 | linked_list_size--; | 585 | linked_list_size--; |
586 | GNUNET_free (lowest_quality); | 586 | GNUNET_free (lowest_quality); |
587 | } | 587 | } |
588 | GNUNET_CONTAINER_DLL_insert (linked_list_head, | 588 | GNUNET_CONTAINER_DLL_insert (linked_list_head, linked_list_tail, |
589 | linked_list_tail, hostlist_to_test); | 589 | hostlist_to_test); |
590 | linked_list_size++; | 590 | linked_list_size++; |
591 | GNUNET_STATISTICS_set (stats, | 591 | GNUNET_STATISTICS_set (stats, gettext_noop ("# advertised hostlist URIs"), |
592 | gettext_noop ("# advertised hostlist URIs"), | ||
593 | linked_list_size, GNUNET_NO); | 592 | linked_list_size, GNUNET_NO); |
594 | stat_testing_hostlist = GNUNET_NO; | 593 | stat_testing_hostlist = GNUNET_NO; |
595 | } | 594 | } |
@@ -679,15 +678,13 @@ clean_up () | |||
679 | mret = curl_multi_remove_handle (multi, curl); | 678 | mret = curl_multi_remove_handle (multi, curl); |
680 | if (mret != CURLM_OK) | 679 | if (mret != CURLM_OK) |
681 | { | 680 | { |
682 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 681 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%s failed at %s:%d: `%s'\n"), |
683 | _("%s failed at %s:%d: `%s'\n"), | ||
684 | "curl_multi_remove_handle", __FILE__, __LINE__, | 682 | "curl_multi_remove_handle", __FILE__, __LINE__, |
685 | curl_multi_strerror (mret)); | 683 | curl_multi_strerror (mret)); |
686 | } | 684 | } |
687 | mret = curl_multi_cleanup (multi); | 685 | mret = curl_multi_cleanup (multi); |
688 | if (mret != CURLM_OK) | 686 | if (mret != CURLM_OK) |
689 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 687 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%s failed at %s:%d: `%s'\n"), |
690 | _("%s failed at %s:%d: `%s'\n"), | ||
691 | "curl_multi_cleanup", __FILE__, __LINE__, | 688 | "curl_multi_cleanup", __FILE__, __LINE__, |
692 | curl_multi_strerror (mret)); | 689 | curl_multi_strerror (mret)); |
693 | multi = NULL; | 690 | multi = NULL; |
@@ -711,8 +708,8 @@ clean_up () | |||
711 | * @param cls closure, unused | 708 | * @param cls closure, unused |
712 | * @param tc task context, unused | 709 | * @param tc task context, unused |
713 | */ | 710 | */ |
714 | static void | 711 | static void task_download (void *cls, |
715 | task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 712 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
716 | 713 | ||
717 | 714 | ||
718 | /** | 715 | /** |
@@ -739,8 +736,7 @@ download_prepare () | |||
739 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); | 736 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); |
740 | if (mret != CURLM_OK) | 737 | if (mret != CURLM_OK) |
741 | { | 738 | { |
742 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 739 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%s failed at %s:%d: `%s'\n"), |
743 | _("%s failed at %s:%d: `%s'\n"), | ||
744 | "curl_multi_fdset", __FILE__, __LINE__, | 740 | "curl_multi_fdset", __FILE__, __LINE__, |
745 | curl_multi_strerror (mret)); | 741 | curl_multi_strerror (mret)); |
746 | clean_up (); | 742 | clean_up (); |
@@ -749,8 +745,7 @@ download_prepare () | |||
749 | mret = curl_multi_timeout (multi, &timeout); | 745 | mret = curl_multi_timeout (multi, &timeout); |
750 | if (mret != CURLM_OK) | 746 | if (mret != CURLM_OK) |
751 | { | 747 | { |
752 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 748 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%s failed at %s:%d: `%s'\n"), |
753 | _("%s failed at %s:%d: `%s'\n"), | ||
754 | "curl_multi_timeout", __FILE__, __LINE__, | 749 | "curl_multi_timeout", __FILE__, __LINE__, |
755 | curl_multi_strerror (mret)); | 750 | curl_multi_strerror (mret)); |
756 | clean_up (); | 751 | clean_up (); |
@@ -768,10 +763,10 @@ download_prepare () | |||
768 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 763 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
769 | "Scheduling task for hostlist download using cURL\n"); | 764 | "Scheduling task for hostlist download using cURL\n"); |
770 | #endif | 765 | #endif |
771 | ti_download | 766 | ti_download = |
772 | = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 767 | GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
773 | GNUNET_SCHEDULER_NO_TASK, | 768 | GNUNET_SCHEDULER_NO_TASK, rtime, grs, gws, |
774 | rtime, grs, gws, &task_download, multi); | 769 | &task_download, multi); |
775 | GNUNET_NETWORK_fdset_destroy (gws); | 770 | GNUNET_NETWORK_fdset_destroy (gws); |
776 | GNUNET_NETWORK_fdset_destroy (grs); | 771 | GNUNET_NETWORK_fdset_destroy (grs); |
777 | } | 772 | } |
@@ -844,10 +839,8 @@ task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
844 | (msg->data.result != CURLE_GOT_NOTHING)) | 839 | (msg->data.result != CURLE_GOT_NOTHING)) |
845 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 840 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
846 | _("%s failed for `%s' at %s:%d: `%s'\n"), | 841 | _("%s failed for `%s' at %s:%d: `%s'\n"), |
847 | "curl_multi_perform", | 842 | "curl_multi_perform", current_url, __FILE__, __LINE__, |
848 | current_url, | 843 | curl_easy_strerror (msg->data.result)); |
849 | __FILE__, | ||
850 | __LINE__, curl_easy_strerror (msg->data.result)); | ||
851 | else | 844 | else |
852 | { | 845 | { |
853 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 846 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
@@ -880,8 +873,7 @@ task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
880 | 873 | ||
881 | if (mret != CURLM_OK) | 874 | if (mret != CURLM_OK) |
882 | { | 875 | { |
883 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 876 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("%s failed at %s:%d: `%s'\n"), |
884 | _("%s failed at %s:%d: `%s'\n"), | ||
885 | "curl_multi_perform", __FILE__, __LINE__, | 877 | "curl_multi_perform", __FILE__, __LINE__, |
886 | curl_multi_strerror (mret)); | 878 | curl_multi_strerror (mret)); |
887 | clean_up (); | 879 | clean_up (); |
@@ -921,8 +913,8 @@ download_hostlist () | |||
921 | stat_bytes_downloaded = 0; | 913 | stat_bytes_downloaded = 0; |
922 | 914 | ||
923 | GNUNET_STATISTICS_update (stats, | 915 | GNUNET_STATISTICS_update (stats, |
924 | gettext_noop ("# hostlist downloads initiated"), | 916 | gettext_noop ("# hostlist downloads initiated"), 1, |
925 | 1, GNUNET_NO); | 917 | GNUNET_NO); |
926 | if (proxy != NULL) | 918 | if (proxy != NULL) |
927 | CURL_EASY_SETOPT (curl, CURLOPT_PROXY, proxy); | 919 | CURL_EASY_SETOPT (curl, CURLOPT_PROXY, proxy); |
928 | download_pos = 0; | 920 | download_pos = 0; |
@@ -971,14 +963,12 @@ download_hostlist () | |||
971 | mret = curl_multi_add_handle (multi, curl); | 963 | mret = curl_multi_add_handle (multi, curl); |
972 | if (mret != CURLM_OK) | 964 | if (mret != CURLM_OK) |
973 | { | 965 | { |
974 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 966 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%s failed at %s:%d: `%s'\n"), |
975 | _("%s failed at %s:%d: `%s'\n"), | ||
976 | "curl_multi_add_handle", __FILE__, __LINE__, | 967 | "curl_multi_add_handle", __FILE__, __LINE__, |
977 | curl_multi_strerror (mret)); | 968 | curl_multi_strerror (mret)); |
978 | mret = curl_multi_cleanup (multi); | 969 | mret = curl_multi_cleanup (multi); |
979 | if (mret != CURLM_OK) | 970 | if (mret != CURLM_OK) |
980 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 971 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%s failed at %s:%d: `%s'\n"), |
981 | _("%s failed at %s:%d: `%s'\n"), | ||
982 | "curl_multi_cleanup", __FILE__, __LINE__, | 972 | "curl_multi_cleanup", __FILE__, __LINE__, |
983 | curl_multi_strerror (mret)); | 973 | curl_multi_strerror (mret)); |
984 | multi = NULL; | 974 | multi = NULL; |
@@ -1104,8 +1094,9 @@ task_hostlist_saving (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1104 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1094 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1105 | _("Hostlists will be saved to file again in %llums\n"), | 1095 | _("Hostlists will be saved to file again in %llums\n"), |
1106 | (unsigned long long) SAVING_INTERVALL.rel_value); | 1096 | (unsigned long long) SAVING_INTERVALL.rel_value); |
1107 | ti_saving_task = GNUNET_SCHEDULER_add_delayed (SAVING_INTERVALL, | 1097 | ti_saving_task = |
1108 | &task_hostlist_saving, NULL); | 1098 | GNUNET_SCHEDULER_add_delayed (SAVING_INTERVALL, &task_hostlist_saving, |
1099 | NULL); | ||
1109 | } | 1100 | } |
1110 | 1101 | ||
1111 | 1102 | ||
@@ -1117,16 +1108,13 @@ task_hostlist_saving (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1117 | * @param atsi performance data | 1108 | * @param atsi performance data |
1118 | */ | 1109 | */ |
1119 | static void | 1110 | static void |
1120 | handler_connect (void *cls, | 1111 | handler_connect (void *cls, const struct GNUNET_PeerIdentity *peer, |
1121 | const struct | ||
1122 | GNUNET_PeerIdentity *peer, | ||
1123 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) | 1112 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
1124 | { | 1113 | { |
1125 | GNUNET_assert (stat_connection_count < UINT_MAX); | 1114 | GNUNET_assert (stat_connection_count < UINT_MAX); |
1126 | stat_connection_count++; | 1115 | stat_connection_count++; |
1127 | GNUNET_STATISTICS_update (stats, | 1116 | GNUNET_STATISTICS_update (stats, gettext_noop ("# active connections"), 1, |
1128 | gettext_noop ("# active connections"), | 1117 | GNUNET_NO); |
1129 | 1, GNUNET_NO); | ||
1130 | } | 1118 | } |
1131 | 1119 | ||
1132 | 1120 | ||
@@ -1141,9 +1129,8 @@ handler_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
1141 | { | 1129 | { |
1142 | GNUNET_assert (stat_connection_count > 0); | 1130 | GNUNET_assert (stat_connection_count > 0); |
1143 | stat_connection_count--; | 1131 | stat_connection_count--; |
1144 | GNUNET_STATISTICS_update (stats, | 1132 | GNUNET_STATISTICS_update (stats, gettext_noop ("# active connections"), -1, |
1145 | gettext_noop ("# active connections"), | 1133 | GNUNET_NO); |
1146 | -1, GNUNET_NO); | ||
1147 | } | 1134 | } |
1148 | 1135 | ||
1149 | 1136 | ||
@@ -1158,8 +1145,7 @@ handler_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
1158 | * GNUNET_SYSERR to close it (signal serious error) | 1145 | * GNUNET_SYSERR to close it (signal serious error) |
1159 | */ | 1146 | */ |
1160 | static int | 1147 | static int |
1161 | handler_advertisement (void *cls, | 1148 | handler_advertisement (void *cls, const struct GNUNET_PeerIdentity *peer, |
1162 | const struct GNUNET_PeerIdentity *peer, | ||
1163 | const struct GNUNET_MessageHeader *message, | 1149 | const struct GNUNET_MessageHeader *message, |
1164 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) | 1150 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
1165 | { | 1151 | { |
@@ -1217,9 +1203,9 @@ handler_advertisement (void *cls, | |||
1217 | 1203 | ||
1218 | stat_testing_hostlist = GNUNET_YES; | 1204 | stat_testing_hostlist = GNUNET_YES; |
1219 | stat_testing_allowed = GNUNET_NO; | 1205 | stat_testing_allowed = GNUNET_NO; |
1220 | ti_testing_intervall_task = GNUNET_SCHEDULER_add_delayed (TESTING_INTERVAL, | 1206 | ti_testing_intervall_task = |
1221 | &task_testing_intervall_reset, | 1207 | GNUNET_SCHEDULER_add_delayed (TESTING_INTERVAL, |
1222 | NULL); | 1208 | &task_testing_intervall_reset, NULL); |
1223 | 1209 | ||
1224 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1210 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1225 | "Testing new hostlist advertisements is locked for the next %u ms\n", | 1211 | "Testing new hostlist advertisements is locked for the next %u ms\n", |
@@ -1255,9 +1241,8 @@ primary_task (void *cls, int success) | |||
1255 | 1241 | ||
1256 | 1242 | ||
1257 | static int | 1243 | static int |
1258 | process_stat (void *cls, | 1244 | process_stat (void *cls, const char *subsystem, const char *name, |
1259 | const char *subsystem, | 1245 | uint64_t value, int is_persistent) |
1260 | const char *name, uint64_t value, int is_persistent) | ||
1261 | { | 1246 | { |
1262 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1247 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1263 | _("Initial time between hostlist downloads is %llums\n"), | 1248 | _("Initial time between hostlist downloads is %llums\n"), |
@@ -1286,9 +1271,8 @@ load_hostlist_file () | |||
1286 | uint32_t counter; | 1271 | uint32_t counter; |
1287 | 1272 | ||
1288 | if (GNUNET_OK != | 1273 | if (GNUNET_OK != |
1289 | GNUNET_CONFIGURATION_get_value_filename (cfg, | 1274 | GNUNET_CONFIGURATION_get_value_filename (cfg, "HOSTLIST", "HOSTLISTFILE", |
1290 | "HOSTLIST", | 1275 | &filename)) |
1291 | "HOSTLISTFILE", &filename)) | ||
1292 | { | 1276 | { |
1293 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1277 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1294 | _ | 1278 | _ |
@@ -1321,9 +1305,8 @@ load_hostlist_file () | |||
1321 | 1305 | ||
1322 | counter = 0; | 1306 | counter = 0; |
1323 | while ((GNUNET_OK == GNUNET_BIO_read_string (rh, "url", &uri, MAX_URL_LEN)) && | 1307 | while ((GNUNET_OK == GNUNET_BIO_read_string (rh, "url", &uri, MAX_URL_LEN)) && |
1324 | (NULL != uri) && | 1308 | (NULL != uri) && (GNUNET_OK == GNUNET_BIO_read_int32 (rh, ×_used)) |
1325 | (GNUNET_OK == GNUNET_BIO_read_int32 (rh, ×_used)) && | 1309 | && (GNUNET_OK == GNUNET_BIO_read_int64 (rh, &quality)) && |
1326 | (GNUNET_OK == GNUNET_BIO_read_int64 (rh, &quality)) && | ||
1327 | (GNUNET_OK == GNUNET_BIO_read_int64 (rh, &last_used)) && | 1310 | (GNUNET_OK == GNUNET_BIO_read_int64 (rh, &last_used)) && |
1328 | (GNUNET_OK == GNUNET_BIO_read_int64 (rh, &created)) && | 1311 | (GNUNET_OK == GNUNET_BIO_read_int64 (rh, &created)) && |
1329 | (GNUNET_OK == GNUNET_BIO_read_int32 (rh, &hellos_returned))) | 1312 | (GNUNET_OK == GNUNET_BIO_read_int32 (rh, &hellos_returned))) |
@@ -1347,13 +1330,11 @@ load_hostlist_file () | |||
1347 | break; | 1330 | break; |
1348 | } | 1331 | } |
1349 | 1332 | ||
1350 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1333 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("%u hostlist URIs loaded from file\n"), |
1351 | _("%u hostlist URIs loaded from file\n"), counter); | 1334 | counter); |
1352 | GNUNET_STATISTICS_set (stats, | 1335 | GNUNET_STATISTICS_set (stats, gettext_noop ("# hostlist URIs read from file"), |
1353 | gettext_noop ("# hostlist URIs read from file"), | ||
1354 | counter, GNUNET_YES); | 1336 | counter, GNUNET_YES); |
1355 | GNUNET_STATISTICS_set (stats, | 1337 | GNUNET_STATISTICS_set (stats, gettext_noop ("# advertised hostlist URIs"), |
1356 | gettext_noop ("# advertised hostlist URIs"), | ||
1357 | linked_list_size, GNUNET_NO); | 1338 | linked_list_size, GNUNET_NO); |
1358 | 1339 | ||
1359 | GNUNET_free_non_null (uri); | 1340 | GNUNET_free_non_null (uri); |
@@ -1379,9 +1360,8 @@ save_hostlist_file (int shutdown) | |||
1379 | uint32_t counter; | 1360 | uint32_t counter; |
1380 | 1361 | ||
1381 | if (GNUNET_OK != | 1362 | if (GNUNET_OK != |
1382 | GNUNET_CONFIGURATION_get_value_filename (cfg, | 1363 | GNUNET_CONFIGURATION_get_value_filename (cfg, "HOSTLIST", "HOSTLISTFILE", |
1383 | "HOSTLIST", | 1364 | &filename)) |
1384 | "HOSTLISTFILE", &filename)) | ||
1385 | { | 1365 | { |
1386 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1366 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1387 | _ | 1367 | _ |
@@ -1404,8 +1384,7 @@ save_hostlist_file (int shutdown) | |||
1404 | GNUNET_free (filename); | 1384 | GNUNET_free (filename); |
1405 | return; | 1385 | return; |
1406 | } | 1386 | } |
1407 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1387 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Writing %u hostlist URIs to `%s'\n"), |
1408 | _("Writing %u hostlist URIs to `%s'\n"), | ||
1409 | linked_list_size, filename); | 1388 | linked_list_size, filename); |
1410 | /* add code to write hostlists to file using bio */ | 1389 | /* add code to write hostlists to file using bio */ |
1411 | ok = GNUNET_YES; | 1390 | ok = GNUNET_YES; |
@@ -1419,12 +1398,9 @@ save_hostlist_file (int shutdown) | |||
1419 | } | 1398 | } |
1420 | if (GNUNET_YES == ok) | 1399 | if (GNUNET_YES == ok) |
1421 | { | 1400 | { |
1422 | if ((GNUNET_OK != | 1401 | if ((GNUNET_OK != GNUNET_BIO_write_string (wh, pos->hostlist_uri)) || |
1423 | GNUNET_BIO_write_string (wh, pos->hostlist_uri)) || | 1402 | (GNUNET_OK != GNUNET_BIO_write_int32 (wh, pos->times_used)) || |
1424 | (GNUNET_OK != | 1403 | (GNUNET_OK != GNUNET_BIO_write_int64 (wh, pos->quality)) || |
1425 | GNUNET_BIO_write_int32 (wh, pos->times_used)) || | ||
1426 | (GNUNET_OK != | ||
1427 | GNUNET_BIO_write_int64 (wh, pos->quality)) || | ||
1428 | (GNUNET_OK != | 1404 | (GNUNET_OK != |
1429 | GNUNET_BIO_write_int64 (wh, pos->time_last_usage.abs_value)) || | 1405 | GNUNET_BIO_write_int64 (wh, pos->time_last_usage.abs_value)) || |
1430 | (GNUNET_OK != | 1406 | (GNUNET_OK != |
@@ -1480,8 +1456,8 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c, | |||
1480 | cfg = c; | 1456 | cfg = c; |
1481 | stats = st; | 1457 | stats = st; |
1482 | if (GNUNET_OK != | 1458 | if (GNUNET_OK != |
1483 | GNUNET_CONFIGURATION_get_value_string (cfg, | 1459 | GNUNET_CONFIGURATION_get_value_string (cfg, "HOSTLIST", "HTTP-PROXY", |
1484 | "HOSTLIST", "HTTP-PROXY", &proxy)) | 1460 | &proxy)) |
1485 | proxy = NULL; | 1461 | proxy = NULL; |
1486 | stat_learning = learn; | 1462 | stat_learning = learn; |
1487 | *ch = &handler_connect; | 1463 | *ch = &handler_connect; |
@@ -1501,18 +1477,18 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c, | |||
1501 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1477 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1502 | _("Hostlists will be saved to file again in %llums\n"), | 1478 | _("Hostlists will be saved to file again in %llums\n"), |
1503 | (unsigned long long) SAVING_INTERVALL.rel_value); | 1479 | (unsigned long long) SAVING_INTERVALL.rel_value); |
1504 | ti_saving_task = GNUNET_SCHEDULER_add_delayed (SAVING_INTERVALL, | 1480 | ti_saving_task = |
1505 | &task_hostlist_saving, NULL); | 1481 | GNUNET_SCHEDULER_add_delayed (SAVING_INTERVALL, &task_hostlist_saving, |
1482 | NULL); | ||
1506 | } | 1483 | } |
1507 | else | 1484 | else |
1508 | { | 1485 | { |
1509 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1486 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1510 | _("Learning is not enabled on this peer\n")); | 1487 | _("Learning is not enabled on this peer\n")); |
1511 | *msgh = NULL; | 1488 | *msgh = NULL; |
1512 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_filename (cfg, | 1489 | if (GNUNET_OK == |
1513 | "HOSTLIST", | 1490 | GNUNET_CONFIGURATION_get_value_filename (cfg, "HOSTLIST", |
1514 | "HOSTLISTFILE", | 1491 | "HOSTLISTFILE", &filename)) |
1515 | &filename)) | ||
1516 | { | 1492 | { |
1517 | if (GNUNET_YES == GNUNET_DISK_file_test (filename)) | 1493 | if (GNUNET_YES == GNUNET_DISK_file_test (filename)) |
1518 | { | 1494 | { |
@@ -1529,8 +1505,7 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c, | |||
1529 | } | 1505 | } |
1530 | GNUNET_free (filename); | 1506 | GNUNET_free (filename); |
1531 | } | 1507 | } |
1532 | GNUNET_STATISTICS_get (stats, | 1508 | GNUNET_STATISTICS_get (stats, "hostlist", |
1533 | "hostlist", | ||
1534 | gettext_noop | 1509 | gettext_noop |
1535 | ("# milliseconds between hostlist downloads"), | 1510 | ("# milliseconds between hostlist downloads"), |
1536 | GNUNET_TIME_UNIT_MINUTES, &primary_task, &process_stat, | 1511 | GNUNET_TIME_UNIT_MINUTES, &primary_task, &process_stat, |