+ }
+ h->backoff = GNUNET_TIME_UNIT_MILLISECONDS;
+ h->current = NULL;
+ schedule_action (h);
+ if (NULL != c->cont)
+ {
+ c->cont (c->cls,
+ GNUNET_OK);
+ c->cont = NULL;
+ }
+ free_action_item (c);
+}
+
+
+/**
+ * Try to (re)connect to the statistics service.
+ *
+ * @param h statistics handle to reconnect
+ * @return #GNUNET_YES on success, #GNUNET_NO on failure.
+ */
+static int
+try_connect (struct GNUNET_STATISTICS_Handle *h)
+{
+ struct GNUNET_MQ_MessageHandler handlers[] = {
+ GNUNET_MQ_hd_fixed_size (disconnect_confirm,
+ GNUNET_MESSAGE_TYPE_STATISTICS_DISCONNECT_CONFIRM,
+ struct GNUNET_MessageHeader,
+ h),
+ GNUNET_MQ_hd_fixed_size (statistics_end,
+ GNUNET_MESSAGE_TYPE_STATISTICS_END,
+ struct GNUNET_MessageHeader,
+ h),
+ GNUNET_MQ_hd_var_size (statistics_value,
+ GNUNET_MESSAGE_TYPE_STATISTICS_VALUE,
+ struct GNUNET_STATISTICS_ReplyMessage,
+ h),
+ GNUNET_MQ_hd_fixed_size (statistics_watch_value,
+ GNUNET_MESSAGE_TYPE_STATISTICS_WATCH_VALUE,
+ struct GNUNET_STATISTICS_WatchValueMessage,
+ h),
+ GNUNET_MQ_handler_end ()
+ };
+ struct GNUNET_STATISTICS_GetHandle *gh;
+ struct GNUNET_STATISTICS_GetHandle *gn;
+
+ if (NULL != h->backoff_task)
+ return GNUNET_NO;
+ if (NULL != h->mq)
+ return GNUNET_YES;
+ h->mq = GNUNET_CLIENT_connect (h->cfg,
+ "statistics",
+ handlers,
+ &mq_error_handler,
+ h);
+ if (NULL == h->mq)
+ {