slen = strlen (watch->subsystem) + 1;
nlen = strlen (watch->name) + 1;
nsize = sizeof (struct GNUNET_MessageHeader) + slen + nlen;
- if (nsize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ if (nsize >= GNUNET_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
return;
/**
- * Handle a #GNUNET_MESSAGE_TYPE_TEST (sic) message. We receive this
- * message at the end of the shutdown when the service confirms that
- * all data has been written to disk.
+ * Handle a #GNUNET_MESSAGE_TYPE_STATISTICS_DISCONNECT_CONFIRM
+ * message. We receive this message at the end of the shutdown when
+ * the service confirms that all data has been written to disk.
*
* @param cls our `struct GNUNET_STATISTICS_Handle *`
* @param msg the message
*/
static void
-handle_test (void *cls,
- const struct GNUNET_MessageHeader *msg)
+handle_disconnect_confirm (void *cls,
+ const struct GNUNET_MessageHeader *msg)
{
struct GNUNET_STATISTICS_Handle *h = cls;
return;
}
LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Received TEST message from statistics, can complete disconnect\n");
+ "Received DISCONNNECT_CONFIRM message from statistics, can complete disconnect\n");
if (NULL != h->destroy_task)
GNUNET_SCHEDULER_cancel (h->destroy_task);
h->destroy_task = GNUNET_SCHEDULER_add_now (&do_destroy,
try_connect (struct GNUNET_STATISTICS_Handle *h)
{
struct GNUNET_MQ_MessageHandler handlers[] = {
- GNUNET_MQ_hd_fixed_size (test,
- GNUNET_MESSAGE_TYPE_TEST,
+ GNUNET_MQ_hd_fixed_size (disconnect_confirm,
+ GNUNET_MESSAGE_TYPE_STATISTICS_DISCONNECT_CONFIRM,
struct GNUNET_MessageHeader,
h),
GNUNET_MQ_hd_fixed_size (statistics_end,
return GNUNET_NO;
if (NULL != h->mq)
return GNUNET_YES;
- h->mq = GNUNET_CLIENT_connecT (h->cfg,
+ h->mq = GNUNET_CLIENT_connect (h->cfg,
"statistics",
handlers,
&mq_error_handler,
return;
}
if (0 < GNUNET_MQ_get_length (h->mq))
- return; /* Wait for queue to be reduced more */
+ return; /* Wait for queue to be reduced more */
/* schedule next action */
while (NULL == h->current)
{
"Notifying service that we are done\n");
h->do_destroy = GNUNET_SYSERR; /* in 'TEST' mode */
env = GNUNET_MQ_msg (hdr,
- GNUNET_MESSAGE_TYPE_TEST);
+ GNUNET_MESSAGE_TYPE_STATISTICS_DISCONNECT);
GNUNET_MQ_notify_sent (env,
&schedule_action,
h);
slen1 = strlen (subsystem) + 1;
slen2 = strlen (name) + 1;
GNUNET_assert (slen1 + slen2 + sizeof (struct GNUNET_MessageHeader) <
- GNUNET_SERVER_MAX_MESSAGE_SIZE);
+ GNUNET_MAX_MESSAGE_SIZE);
ai = GNUNET_new (struct GNUNET_STATISTICS_GetHandle);
ai->sh = handle;
ai->subsystem = GNUNET_strdup (subsystem);
slen = strlen (h->subsystem) + 1;
nlen = strlen (name) + 1;
nsize = sizeof (struct GNUNET_STATISTICS_SetMessage) + slen + nlen;
- if (nsize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ if (nsize >= GNUNET_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
return;
}
for (ai = h->action_head; NULL != ai; ai = ai->next)
{
- if (! ( (0 == strcmp (ai->subsystem, h->subsystem)) &&
- (0 == strcmp (ai->name, name)) &&
+ if (! ( (0 == strcmp (ai->subsystem,
+ h->subsystem)) &&
+ (0 == strcmp (ai->name,
+ name)) &&
( (ACTION_UPDATE == ai->type) ||
(ACTION_SET == ai->type) ) ) )
continue;