/**
* Handler for ARM replies.
*
- * @param cls our "struct GNUNET_ARM_Handle"
+ * @param cls our `struct GNUNET_ARM_Handle`
* @param msg the message received from the arm service
*/
static void
-client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
+client_notify_handler (void *cls,
+ const struct GNUNET_MessageHeader *msg)
{
struct GNUNET_ARM_Handle *h = cls;
const struct GNUNET_ARM_Message *arm_msg;
cm = find_cm_by_id (h, id);
if (NULL == cm)
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Message with unknown id %llu\n", id);
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Message with unknown id %llu\n",
+ id);
return;
}
fail = GNUNET_NO;
if (NULL != cm->list_cont)
cm->list_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, rcount,
list);
- GNUNET_free (list);
+ GNUNET_free_non_null (list);
break;
}
GNUNET_free (cm->msg);
/**
* Transmit the next message to the arm service.
*
- * @param cls closure with the 'struct GNUNET_ARM_Handle'
- * @param size number of bytes available in buf
+ * @param cls closure with the `struct GNUNET_ARM_Handle`
+ * @param size number of bytes available in @a buf
* @param buf where the callee should write the message
- * @return number of bytes written to buf
+ * @return number of bytes written to @a buf
*/
static size_t
transmit_arm_message (void *cls, size_t size, void *buf)
notify_connection = GNUNET_NO;
LOG (GNUNET_ERROR_TYPE_DEBUG,
- "transmit_arm_message is running with %p buffer of size %lu. ARM is known to be %s\n",
- buf, size, h->currently_down ? "unconnected" : "connected");
+ "transmit_arm_message is running with %p buffer of size %lu. ARM is known to be %s\n",
+ buf, size, h->currently_down ? "unconnected" : "connected");
GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task);
h->cth = NULL;
if ((GNUNET_YES == h->currently_down) && (NULL != buf))
}
if (NULL == (cm = h->control_pending_head))
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Queue is empty, not sending anything\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Queue is empty, not sending anything\n");
msize = 0;
goto end;
}
{
struct GNUNET_ARM_Handle *h;
- h = GNUNET_malloc (sizeof (struct GNUNET_ARM_Handle));
+ h = GNUNET_new (struct GNUNET_ARM_Handle);
h->cfg = GNUNET_CONFIGURATION_dup (cfg);
h->currently_down = GNUNET_YES;
h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
}
-#include "do_start_process.c"
-
-
/**
* A client specifically requested starting of ARM itself.
* This function is called with information about whether
/* Means we are ONLY running locally */
/* we're clearly running a test, don't daemonize */
if (NULL == config)
- proc = do_start_process (GNUNET_NO, cm->std_inheritance,
- NULL, loprefix, quotedbinary,
- /* no daemonization! */
- lopostfix, NULL);
+ proc = GNUNET_OS_start_process_s (GNUNET_NO, cm->std_inheritance,
+ NULL, loprefix, quotedbinary,
+ /* no daemonization! */
+ lopostfix, NULL);
else
- proc = do_start_process (GNUNET_NO, cm->std_inheritance,
+ proc = GNUNET_OS_start_process_s (GNUNET_NO, cm->std_inheritance,
NULL, loprefix, quotedbinary, "-c", config,
- /* no daemonization! */
- lopostfix, NULL);
+ /* no daemonization! */
+ lopostfix, NULL);
}
else
{
if (NULL == config)
- proc = do_start_process (GNUNET_NO, cm->std_inheritance,
- NULL, loprefix, quotedbinary,
- "-d", lopostfix, NULL);
+ proc = GNUNET_OS_start_process_s (GNUNET_NO, cm->std_inheritance,
+ NULL, loprefix, quotedbinary,
+ "-d", lopostfix, NULL);
else
- proc = do_start_process (GNUNET_NO, cm->std_inheritance,
- NULL, loprefix, quotedbinary, "-c", config,
- "-d", lopostfix, NULL);
+ proc = GNUNET_OS_start_process_s (GNUNET_NO, cm->std_inheritance,
+ NULL, loprefix, quotedbinary, "-c",
+ config,
+ "-d", lopostfix, NULL);
}
GNUNET_free (binary);
GNUNET_free (quotedbinary);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Requesting LIST from ARM service with timeout: %s\n",
GNUNET_STRINGS_relative_time_to_string (timeout, GNUNET_YES));
- cm = GNUNET_malloc (sizeof (struct ARMControlMessage));
+ cm = GNUNET_new (struct ARMControlMessage);
cm->h = h;
cm->list_cont = cont;
cm->cont_cls = cont_cls;