GNUNET_assert (NULL == sl->proc);
if (GNUNET_YES == use_debug)
sl->proc =
- do_start_process (sl->pipe_control,
+ do_start_process (sl->pipe_control, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
lsocks, loprefix, sl->binary, "-c", sl->config, "-L",
"DEBUG", options, NULL);
else
sl->proc =
- do_start_process (sl->pipe_control,
+ do_start_process (sl->pipe_control, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
lsocks, loprefix, sl->binary, "-c", sl->config,
options, NULL);
if (sl->proc == NULL)
create_listen_socket (struct sockaddr *sa, socklen_t addr_len,
struct ServiceList *sl)
{
- const static int on = 1;
+ static int on = 1;
struct GNUNET_NETWORK_Handle *sock;
struct ServiceListeningInfo *sli;
pos->name,
GNUNET_TIME_absolute_get_duration (pos->killed_at).rel_value);
}
- GNUNET_OS_process_close (pos->proc);
+ GNUNET_OS_process_destroy (pos->proc);
pos->proc = NULL;
if (NULL != pos->killing_client)
{
}
-/**
- * Transmit our shutdown acknowledgement to the client.
- *
- * @param cls the 'struct GNUNET_SERVER_Client'
- * @param size number of bytes available in buf
- * @param buf where to write the message
- * @return number of bytes written
- */
-static size_t
-transmit_shutdown_ack (void *cls, size_t size, void *buf)
-{
- struct GNUNET_SERVER_Client *client = cls;
- struct GNUNET_ARM_ResultMessage *msg;
-
- if (size < sizeof (struct GNUNET_ARM_ResultMessage))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("Failed to transmit shutdown ACK.\n"));
- GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
- return 0; /* client disconnected */
- }
- /* Make the connection flushing for the purpose of ACK transmitting,
- * needed on W32 to ensure that the message is even received, harmless
- * on other platforms... */
- GNUNET_break (GNUNET_OK == GNUNET_SERVER_client_disable_corking (client));
- msg = (struct GNUNET_ARM_ResultMessage *) buf;
- msg->header.type = htons (GNUNET_MESSAGE_TYPE_ARM_RESULT);
- msg->header.size = htons (sizeof (struct GNUNET_ARM_ResultMessage));
- msg->status = htonl ((uint32_t) GNUNET_ARM_PROCESS_SHUTDOWN);
- GNUNET_SERVER_receive_done (client, GNUNET_OK);
- GNUNET_SERVER_client_drop (client);
- return sizeof (struct GNUNET_ARM_ResultMessage);
-}
-
-
/**
* Handler for SHUTDOWN message.
*
const struct GNUNET_MessageHeader *message)
{
GNUNET_SCHEDULER_shutdown ();
- GNUNET_SERVER_client_keep (client);
- GNUNET_SERVER_notify_transmit_ready (client,
- sizeof (struct GNUNET_ARM_ResultMessage),
- GNUNET_TIME_UNIT_FOREVER_REL,
- &transmit_shutdown_ack, client);
GNUNET_SERVER_client_persist_ (client);
}
+
/**
* Signal handler called for SIGCHLD. Triggers the
* respective handler by writing to the trigger pipe.
GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death);
ret =
(GNUNET_OK ==
- GNUNET_SERVICE_run (argc, argv, "arm", GNUNET_YES, &run, NULL)) ? 0 : 1;
+ GNUNET_SERVICE_run (argc, argv, "arm",
+ GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN, &run, NULL)) ? 0 : 1;
GNUNET_SIGNAL_handler_uninstall (shc_chld);
shc_chld = NULL;
GNUNET_DISK_pipe_close (sigpipe);