From 4b46e4a593dfe2738d087f3cb18535053af773b5 Mon Sep 17 00:00:00 2001 From: David Barksdale Date: Mon, 5 Jan 2015 04:35:56 +0000 Subject: [PATCH] Check return value of GNUNET_STATISTICS_get Or we could always call the callback with GNUNET_SYSERR. --- src/datastore/gnunet-service-datastore.c | 2 ++ src/hostlist/gnunet-daemon-hostlist_client.c | 6 ++++++ src/sensor/gnunet-service-sensor_monitoring.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 71d436999..6c493768d 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c @@ -1661,6 +1661,8 @@ run (void *cls, &process_stat_done, &process_stat_in, NULL); + if (NULL == stat_get) + process_stat_done (NULL, GNUNET_SYSERR); GNUNET_SERVER_disconnect_notify (server, &cleanup_reservations, NULL); diff --git a/src/hostlist/gnunet-daemon-hostlist_client.c b/src/hostlist/gnunet-daemon-hostlist_client.c index 0751668b3..cd6984b1a 100644 --- a/src/hostlist/gnunet-daemon-hostlist_client.c +++ b/src/hostlist/gnunet-daemon-hostlist_client.c @@ -1657,6 +1657,12 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c, &primary_task, &process_stat, NULL); + if (NULL == sget) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Statistics request failed, scheduling hostlist download\n"); + ti_check_download = GNUNET_SCHEDULER_add_now (&task_check, NULL); + } return GNUNET_OK; } diff --git a/src/sensor/gnunet-service-sensor_monitoring.c b/src/sensor/gnunet-service-sensor_monitoring.c index f473c3a75..08c0bd62a 100644 --- a/src/sensor/gnunet-service-sensor_monitoring.c +++ b/src/sensor/gnunet-service-sensor_monitoring.c @@ -335,6 +335,8 @@ sensor_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) &end_sensor_run_stat, &sensor_statistics_iterator, sensorinfo); + if (NULL == sensorinfo->gnunet_stat_get_handle) + sensorinfo->running = GNUNET_NO; } else if (0 == strcmp ("process", sensorinfo->source)) { -- 2.25.1