X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fhostlist%2Fhostlist-client.c;h=049e78c52f10131fc068d549bbb690550812478f;hb=3c82a48a3a22b65b5f0db85528c1979ac0c878ed;hp=47d6254370d784e3ba6c3dc9d105ca618099b8c0;hpb=75a33a1499cf60ea4364c9aa673816629a6c1413;p=oweals%2Fgnunet.git diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c index 47d625437..049e78c52 100644 --- a/src/hostlist/hostlist-client.c +++ b/src/hostlist/hostlist-client.c @@ -335,7 +335,7 @@ callback_download (void *ptr, 1, GNUNET_NO); stat_hellos_obtained++; - GNUNET_TRANSPORT_offer_hello (transport, msg); + GNUNET_TRANSPORT_offer_hello (transport, msg, NULL, NULL); } else { @@ -1137,15 +1137,13 @@ task_hostlist_saving (void *cls, * * @param cls closure * @param peer peer identity this notification is about - * @param latency reported latency of the connection with 'other' - * @param distance reported distance (DV) to 'other' + * @param atsi performance data */ static void handler_connect (void *cls, const struct GNUNET_PeerIdentity * peer, - struct GNUNET_TIME_Relative latency, - uint32_t distance) + const struct GNUNET_TRANSPORT_ATS_Information *atsi) { GNUNET_assert (stat_connection_count < UINT_MAX); stat_connection_count++; @@ -1170,9 +1168,9 @@ handler_disconnect (void *cls, GNUNET_assert (stat_connection_count > 0); stat_connection_count--; GNUNET_STATISTICS_update (stats, - gettext_noop ("# active connections"), - -1, - GNUNET_NO); + gettext_noop ("# active connections"), + -1, + GNUNET_NO); } /** @@ -1181,17 +1179,15 @@ handler_disconnect (void *cls, * @param cls closure (always NULL) * @param peer the peer sending the message * @param message the actual message - * @param latency latency - * @param distance distance + * @param atsi performance data * @return GNUNET_OK to keep the connection open, * GNUNET_SYSERR to close it (signal serious error) */ static int handler_advertisement (void *cls, - const struct GNUNET_PeerIdentity * peer, - const struct GNUNET_MessageHeader * message, - struct GNUNET_TIME_Relative latency, - uint32_t distance) + const struct GNUNET_PeerIdentity * peer, + const struct GNUNET_MessageHeader * message, + const struct GNUNET_TRANSPORT_ATS_Information *atsi) { size_t size; size_t uri_size; @@ -1421,6 +1417,11 @@ static void save_hostlist_file ( int shutdown ) "HOSTLISTFILE", "HOSTLIST"); return; } + if (GNUNET_SYSERR == GNUNET_DISK_directory_create_for_file (filename)) + { + GNUNET_free (filename); + return; + } wh = GNUNET_BIO_write_open (filename); if ( NULL == wh) { @@ -1434,7 +1435,6 @@ static void save_hostlist_file ( int shutdown ) GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Writing %u hostlist URIs to `%s'\n" ), linked_list_size, filename); - /* add code to write hostlists to file using bio */ ok = GNUNET_YES; counter = 0;