* @author Igor Wronsky
*/
#include "platform.h"
-#include "gnunet_getopt_lib.h"
-#include "gnunet_program_lib.h"
#include "gnunet_util_lib.h"
#include "gnunet_statistics_service.h"
#include "statistics.h"
*/
static int set_value;
+
/**
* Callback function to process statistic values.
*
* @param subsystem name of subsystem that created the statistic
* @param name the name of the datum
* @param value the current value
- * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
- * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
+ * @param is_persistent #GNUNET_YES if the value is persistent, #GNUNET_NO if not
+ * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
*/
static int
printer (void *cls, const char *subsystem, const char *name, uint64_t value,
* Function called last by the statistics code.
*
* @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
cleanup (void *cls, int success)
if (NULL == h)
return;
- GNUNET_STATISTICS_watch_cancel (h, subsystem, name, &printer, h);
+ if ( (GNUNET_YES == watch) &&
+ (NULL != subsystem) &&
+ (NULL != name) )
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_STATISTICS_watch_cancel (h, subsystem, name, &printer, h));
GNUNET_STATISTICS_destroy (h, GNUNET_NO);
- h = NULL;
+ h = NULL;
}
* running.
*
* @param cls closure with our configuration
- * @param result GNUNET_YES if the resolver is running
- */
+ * @param result #GNUNET_YES if the resolver is running
+ */
static void
-resolver_test_task (void *cls,
+resolver_test_task (void *cls,
int result)
{
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
if (GNUNET_YES != result)
{
- FPRINTF (stderr,
+ FPRINTF (stderr,
_("Trying to connect to remote host, but service `%s' is not running\n"), "resolver");
return;
}
}
else if (65535 <= remote_port)
{
- FPRINTF (stderr,
+ FPRINTF (stderr,
_("A port has to be between 1 and 65535 to connect to host `%s'\n"), remote_host);
return;
}
/* Manipulate configuration */
- GNUNET_CONFIGURATION_set_value_string (cfg,
+ GNUNET_CONFIGURATION_set_value_string (cfg,
"statistics", "UNIXPATH", "");
GNUNET_CONFIGURATION_set_value_string (cfg,
"statistics", "HOSTNAME", remote_host);
set_value = GNUNET_YES;
}
if (NULL != remote_host)
- GNUNET_CLIENT_service_test ("resolver", cfg, GNUNET_TIME_UNIT_SECONDS,
+ GNUNET_CLIENT_service_test ("resolver", cfg, GNUNET_TIME_UNIT_SECONDS,
&resolver_test_task, (void *) cfg);
else
GNUNET_SCHEDULER_add_now (&main_task, (void *) cfg);