+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "calling GNUNET_CONNECTION_receive\n");
+ GNUNET_assert (GNUNET_NO == client->in_receive);
+ client->in_receive = GNUNET_YES;
+ GNUNET_CONNECTION_receive (client->connection,
+ GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
+ timeout,
+ &receive_helper,
+ client);
+}
+
+
+/**
+ * Handle for a test to check if a service is running.
+ */
+struct GNUNET_CLIENT_TestHandle
+{
+ /**
+ * Function to call with the result of the test.
+ */
+ GNUNET_CLIENT_TestResultCallback cb;
+
+ /**
+ * Closure for @e cb.
+ */
+ void *cb_cls;
+
+ /**
+ * Client connection we are using for the test, if any.
+ */
+ struct GNUNET_CLIENT_Connection *client;
+
+ /**
+ * Handle for the transmission request, if any.
+ */
+ struct GNUNET_CLIENT_TransmitHandle *th;
+
+ /**
+ * Deadline for calling @e cb.
+ */
+ struct GNUNET_TIME_Absolute test_deadline;
+
+ /**
+ * ID of task used for asynchronous operations.
+ */
+ struct GNUNET_SCHEDULER_Task * task;
+
+ /**
+ * Final result to report back (once known).
+ */
+ int result;
+};
+
+
+/**
+ * Abort testing for service.
+ *
+ * @param th test handle
+ */
+void
+GNUNET_CLIENT_service_test_cancel (struct GNUNET_CLIENT_TestHandle *th)
+{
+ if (NULL != th->th)