/**
* Handle for interacting with ARM.
- */
+ */
struct GNUNET_ARM_Handle
{
return;
}
pid = do_start_process (loprefix,
- binary,
- "-c", config,
+ binary,
+ "-c", config,
#if DEBUG_ARM
"-L", "DEBUG",
#endif
* Process a response from ARM to a request for a change in service
* status.
*
- * @param cls the request context
+ * @param cls the request context
* @param msg the response
*/
static void
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Error receiving response to `%s' request from ARM for service `%s'\n"),
- (sc->type == GNUNET_MESSAGE_TYPE_ARM_START)
+ (sc->type == GNUNET_MESSAGE_TYPE_ARM_START)
? "START"
: "STOP",
(const char*) &sc[1]);
GNUNET_CLIENT_disconnect (sc->h->client, GNUNET_NO);
- sc->h->client = GNUNET_CLIENT_connect (sc->h->sched,
- "arm",
+ sc->h->client = GNUNET_CLIENT_connect (sc->h->sched,
+ "arm",
sc->h->cfg);
GNUNET_assert (NULL != sc->h->client);
GNUNET_CLIENT_ignore_shutdown (sc->h->client, GNUNET_YES);
* @param timeout how long to wait before failing for good
* @param cb callback to invoke when service is ready
* @param cb_cls closure for callback
- * @param type type of the request
+ * @param type type of the request
*/
static void
change_service (struct GNUNET_ARM_Handle *h,
}
#if DEBUG_ARM
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- (type == GNUNET_MESSAGE_TYPE_ARM_START)
- ? _("Requesting start of service `%s'.\n")
+ (type == GNUNET_MESSAGE_TYPE_ARM_START)
+ ? _("Requesting start of service `%s'.\n")
: _("Requesting termination of service `%s'.\n"),
service_name);
#endif
GNUNET_YES,
&handle_response,
sctx))
- {
+ {
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
(type == GNUNET_MESSAGE_TYPE_ARM_START)
? _("Error while trying to transmit request to start `%s' to ARM\n")
/**
* Callback from the arm stop service call, indicates that the arm service
- * is well and truly dead.
+ * is well and truly dead, won't die, or an error occurred.
*
* @param cls closure for the callback
- * @param tc scheduler context
+ * @param reason reason for callback, GNUNET_NO if arm is shutdown
+ * GNUNET_YES if arm remains running, and GNUNET_SYSERR on error
*/
void arm_shutdown_callback (void *cls,
int reason)
*/
void
GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h,
- const char *service_name,
+ const char *service_name,
struct GNUNET_TIME_Relative timeout,
GNUNET_ARM_Callback cb, void *cb_cls)
{
{
struct MultiContext *mc = cls;
char *pos;
-
+
if (NULL == (pos = mc->services[mc->pos]))
{
GNUNET_free (mc->services);
*/
static void
run_multi_request (const struct GNUNET_CONFIGURATION_Handle *cfg,
- struct GNUNET_SCHEDULER_Handle *sched,
+ struct GNUNET_SCHEDULER_Handle *sched,
ServiceOperation op,
va_list va)
{
struct MultiContext *mc;
struct GNUNET_ARM_Handle *h;
const char *c;
-
+
h = GNUNET_ARM_connect (cfg, sched, NULL);
if (NULL == h)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Error while trying to transmit to ARM service\n"));
- return;
+ return;
}
total = 1;
va_copy (cp, va);
mc->op = op;
total = 0;
va_copy (cp, va);
- while (NULL != (c = va_arg (cp, const char*)))
+ while (NULL != (c = va_arg (cp, const char*)))
mc->services[total++] = GNUNET_strdup (c);
va_end (cp);
next_operation (mc, GNUNET_YES);