#include "gnunet_transport_service.h"
#include "gnunet-daemon-hostlist.h"
#include <curl/curl.h>
-#include "gnunet_common.h"
-#include "gnunet_bio_lib.h"
+#include "gnunet_util_lib.h"
/**
return ret;
}
+
/**
* Method deciding if a preconfigured or advertisied hostlist is used on a 50:50 ratio
* @return uri to use, NULL if there is no URL available
/**
* add val2 to val1 with overflow check
+ *
* @param val1 value 1
* @param val2 value 2
* @return result
/**
* Subtract val2 from val1 with underflow check
+ *
* @param val1 value 1
* @param val2 value 2
* @return result
/**
* Method to check if a URI is in hostlist linked list
+ *
* @param uri uri to check
- * @return GNUNET_YES if existing in linked list, GNUNET_NO if not
+ * @return #GNUNET_YES if existing in linked list, #GNUNET_NO if not
*/
static int
linked_list_contains (const char *uri)
GNUNET_STATISTICS_set (stats,
gettext_noop
("# milliseconds between hostlist downloads"),
- hostlist_delay.rel_value_us / 1000LL,
+ hostlist_delay.rel_value_us / 1000LL,
GNUNET_YES);
if (0 == once)
{
* @param cls closure (always NULL)
* @param peer the peer sending the message
* @param message the actual message
- * @return GNUNET_OK to keep the connection open,
- * GNUNET_SYSERR to close it (signal serious error)
+ * @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,
* we go the stat. Initiates hostlist download scheduling.
*
* @param cls closure
- * @param success GNUNET_OK if statistics were
- * successfully obtained, GNUNET_SYSERR if not.
+ * @param success #GNUNET_OK if statistics were
+ * successfully obtained, #GNUNET_SYSERR if not.
*/
static void
primary_task (void *cls, int success)
/**
+ * We've received the previous delay value from statistics. Remember it.
+ *
+ * @param cls NULL, unused
+ * @param subsystem should be "hostlist", unused
+ * @param name will be "milliseconds between hostlist downloads", unused
* @param value previous delay value, in milliseconds (!)
+ * @param is_persistent unused, will be GNUNET_YES
*/
static int
process_stat (void *cls, const char *subsystem, const char *name,
char *uri;
char *emsg;
struct Hostlist *hostlist;
-
- uri = NULL;
uint32_t times_used;
uint32_t hellos_returned;
uint64_t quality;
uint64_t created;
uint32_t counter;
+ uri = NULL;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg, "HOSTLIST", "HOSTLISTFILE",
&filename))
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("Loading saved hostlist entries from file `%s' \n"), filename);
+ _("Loading saved hostlist entries from file `%s' \n"),
+ filename);
if (GNUNET_NO == GNUNET_DISK_file_test (filename))
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,