From dd07add29a1023330edd1ccfc4e54991082bfe86 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 30 Aug 2016 11:02:34 +0000 Subject: [PATCH] -recover lost service_main from SVN 37845 --- src/util/service_new.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/util/service_new.c b/src/util/service_new.c index 773e09c5f..9608fbf22 100644 --- a/src/util/service_new.c +++ b/src/util/service_new.c @@ -317,7 +317,7 @@ have_non_monitor_clients (struct GNUNET_SERVICE_Handle *sh) * @param cls our `struct GNUNET_SERVICE_Handle` */ static void -service_main (void *cls) +service_shutdown (void *cls) { struct GNUNET_SERVICE_Handle *sh = cls; struct GNUNET_SERVICE_Client *client; @@ -343,6 +343,28 @@ service_main (void *cls) } +/** + * First task run by any service. Initializes our shutdown task, + * starts the listening operation on our listen sockets and launches + * the custom logic of the application service. + * + * @param cls our `struct GNUNET_SERVICE_Handle` + */ +static void +service_main (void *cls) +{ + struct GNUNET_SERVICE_Handle *sh = cls; + + if (GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN != sh->options) + GNUNET_SCHEDULER_add_shutdown (&service_shutdown, + sh); + GNUNET_SERVICE_resume (sh); + sh->service_init_cb (sh->cb_cls, + sh->cfg, + sh); +} + + /** * Parse an IPv4 access control list. * -- 2.25.1