current_hostlist->times_used++;
current_hostlist->quality = checked_add ( current_hostlist->quality, HOSTLIST_SUCCESSFUL_DOWNLOAD);
GNUNET_asprintf (&stat,
- gettext_noop("Learned URI `%s' downloaded"),
+ gettext_noop("Advertised URI `%s' downloaded"),
current_hostlist->hostlist_uri);
GNUNET_STATISTICS_update ( stats,
static int timeout;
static int adv_arrived;
+static int adv_sent;
static int learned_hostlist_saved;
static int learned_hostlist_downloaded;
check_task);
check_task = GNUNET_SCHEDULER_NO_TASK;
}
+ GNUNET_free (current_adv_uri);
GNUNET_SCHEDULER_add_now (sched,
&clean_up, NULL);
}
return GNUNET_OK;
}
+static int
+process_adv_sent (void *cls,
+ const char *subsystem,
+ const char *name,
+ uint64_t value,
+ int is_persistent)
+{
+ if ( (value == 1) && (adv_sent == GNUNET_NO))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Server has successfully sent advertisement\n"));
+ adv_sent = GNUNET_YES;
+ }
+ return GNUNET_OK;
+}
+
/**
* Check the server statistics regularly
*/
{
char *stat;
GNUNET_asprintf (&stat,
- gettext_noop("Learned URI `%s' downloaded"),
+ gettext_noop("Advertised URI `%s' downloaded"),
current_adv_uri);
GNUNET_STATISTICS_get (learn_peer.stats,
"hostlist",
NULL,
&process_uris_recv,
NULL);
+ GNUNET_STATISTICS_get (adv_peer.stats,
+ "hostlist",
+ gettext_noop("# hostlist advertisements send"),
+ GNUNET_TIME_UNIT_MINUTES,
+ NULL,
+ &process_adv_sent,
+ NULL);
check_task = GNUNET_SCHEDULER_add_delayed (sched,
CHECK_INTERVALL,
&check_statistics,
#endif
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
+ p->stats = GNUNET_STATISTICS_create (sched, "hostlist", p->cfg);
+ GNUNET_assert ( NULL != p->stats );
}
{
timeout = GNUNET_NO;
adv_arrived = GNUNET_NO;
+ adv_sent =GNUNET_NO;
learned_hostlist_downloaded = GNUNET_NO;
sched = s;
timeout_task = GNUNET_SCHEDULER_add_delayed (sched,
"Advertisement hostlist could not be downloaded from server\n");
return GNUNET_YES;
}
+
+ if (adv_sent == GNUNET_NO)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Advertisement was not sent from server to client\n");
+ return GNUNET_YES;
+ }
return GNUNET_NO;
}