/**
 * Handler for SHUTDOWN message.
 *
 * @param cls closure (refers to service)
 * @param client identification of the client
 * @param message the actual message
 */
static void
handle_shutdown (void *cls, struct GNUNET_SERVER_Client *client,
		 const struct GNUNET_MessageHeader *message)
{
  GNUNET_SCHEDULER_shutdown ();
  GNUNET_SERVER_client_persist_ (client);
}
示例#2
0
/**
 * Handler for STOP message.
 *
 * @param cls closure (refers to service)
 * @param client identification of the client
 * @param message the actual message
 */
static void
handle_stop (void *cls, struct GNUNET_SERVER_Client *client,
                 const struct GNUNET_MessageHeader *message)
{
  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
              _("Initiating shutdown as requested by client.\n"));
  GNUNET_SERVER_client_persist_ (client);
  GNUNET_SCHEDULER_shutdown ();
  /* ARM won't exponentially increase restart delay if we
   * terminate normally. This changes the return code.
   */
  special_ret = 1;
}