*/
static struct Hostlist * current_hostlist;
-
/*
* Size of the linke list used to store hostlists
*/
static unsigned int hellos_obtained;
/**
- * Value saying how many valid HELLO messages were obtained during download
+ * Value saying if hostlist download was successful
*/
static unsigned int download_successful;
}
/**
- * substract val2 from val1 with underflow check
+ * Subtract val2 from val1 with underflow check
* return = val1 - val2
* @val1 value 1
* @val2 value 2
if ( GNUNET_YES == download_successful )
{
current_hostlist->times_used++;
- current_hostlist->quality = checked_add( current_hostlist->quality, HOSTLIST_SUCCESSFUL_DOWNLOAD);
+ current_hostlist->quality = checked_add ( current_hostlist->quality, HOSTLIST_SUCCESSFUL_DOWNLOAD);
}
else
current_hostlist->quality = checked_sub ( current_hostlist->quality, HOSTLIST_FAILED_DOWNLOAD );
GNUNET_CORE_MessageCallback *msgh,
int learn)
{
+ char *filename;
+ int result;
+
if (0 != curl_global_init (CURL_GLOBAL_WIN32))
{
GNUNET_break (0);
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Learning is not enabled on this peer\n"));
+ if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg,
+ "HOSTLIST",
+ "HOSTLISTFILE",
+ &filename))
+ {
+ if ( GNUNET_YES == GNUNET_DISK_file_test (filename) )
+ {
+ result = remove (filename);
+ if (result == 0)
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Since learning is not enabled on this peer, hostlist file `%s' was removed\n"),filename);
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Hostlist file `%s' could not be removed\n"),filename);
+ }
+ }
}
GNUNET_STATISTICS_get (stats,
"hostlist",