From 90e29258a5339d232ea1b22f3f83d61701b52358 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 6 Jun 2018 00:32:36 +0200 Subject: changes for AGPL handling --- src/util/service.c | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'src/util/service.c') diff --git a/src/util/service.c b/src/util/service.c index 1156093f4c..ae18099508 100644 --- a/src/util/service.c +++ b/src/util/service.c @@ -1571,6 +1571,36 @@ teardown_service (struct GNUNET_SERVICE_Handle *sh) } +/** + * Function to return link to AGPL source upon request. + * + * @param cls closure with the identification of the client + * @param msg AGPL request + */ +static void +return_agpl (void *cls, + const struct GNUNET_MessageHeader *msg) +{ + struct GNUNET_SERVICE_Client *client = cls; + struct GNUNET_MQ_Handle *mq; + struct GNUNET_MQ_Envelope *env; + struct GNUNET_MessageHeader *res; + size_t slen; + + slen = strlen (GNUNET_AGPL_URL) + 1; + env = GNUNET_MQ_msg_extra (res, + GNUNET_MESSAGE_TYPE_RESPONSE_AGPL, + slen); + memcpy (&res[1], + GNUNET_AGPL_URL, + slen); + mq = GNUNET_SERVICE_client_get_mq (client); + GNUNET_MQ_send (mq, + env); + GNUNET_SERVICE_client_continue (client); +} + + /** * Low-level function to start a service if the scheduler * is already running. Should only be used directly in @@ -1623,7 +1653,9 @@ GNUNET_SERVICE_start (const char *service_name, sh->connect_cb = connect_cb; sh->disconnect_cb = disconnect_cb; sh->cb_cls = cls; - sh->handlers = GNUNET_MQ_copy_handlers (handlers); + sh->handlers = GNUNET_MQ_copy_handlers2 (handlers, + &return_agpl, + NULL); if (GNUNET_OK != setup_service (sh)) { GNUNET_free_non_null (sh->handlers); @@ -1723,9 +1755,9 @@ GNUNET_SERVICE_run_ (int argc, struct GNUNET_GETOPT_CommandLineOption service_options[] = { GNUNET_GETOPT_option_cfgfile (&opt_cfg_filename), GNUNET_GETOPT_option_flag ('d', - "daemonize", - gettext_noop ("do daemonize (detach from terminal)"), - &do_daemonize), + "daemonize", + gettext_noop ("do daemonize (detach from terminal)"), + &do_daemonize), GNUNET_GETOPT_option_help (NULL), GNUNET_GETOPT_option_loglevel (&loglev), GNUNET_GETOPT_option_logfile (&logfile), -- cgit v1.2.3-18-g5258 From cbd60b5e56aac2d6711e299086383f83357794f8 Mon Sep 17 00:00:00 2001 From: "psyc://loupsycedyglgamf.onion/~lynX" Date: Tue, 5 Jun 2018 23:12:01 +0000 Subject: first batch of license fixes (boring) --- src/util/service.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/util/service.c') diff --git a/src/util/service.c b/src/util/service.c index ae18099508..568ed2aae2 100644 --- a/src/util/service.c +++ b/src/util/service.c @@ -2,20 +2,15 @@ This file is part of GNUnet. Copyright (C) 2016 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + Affero General Public License for more details. */ /** -- cgit v1.2.3-18-g5258 From 4e29ecde9b3ad3e34af359f18b6679c06b17ce78 Mon Sep 17 00:00:00 2001 From: "psyc://loupsycedyglgamf.onion/~lynX" Date: Thu, 7 Jun 2018 14:42:24 +0000 Subject: glitch in the license text detected by hyazinthe, thank you! --- src/util/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/util/service.c') diff --git a/src/util/service.c b/src/util/service.c index 568ed2aae2..f355beb79d 100644 --- a/src/util/service.c +++ b/src/util/service.c @@ -3,7 +3,7 @@ Copyright (C) 2016 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published + under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -- cgit v1.2.3-18-g5258 From 4e2504a967ba09643c6dd7e3b9ce400e30adcb3d Mon Sep 17 00:00:00 2001 From: "psyc://loupsycedyglgamf.onion/~lynX" Date: Thu, 7 Jun 2018 15:23:35 +0000 Subject: paragraph for gnunet devs that don't know how to use the web --- src/util/service.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/util/service.c') diff --git a/src/util/service.c b/src/util/service.c index f355beb79d..20cc1036da 100644 --- a/src/util/service.c +++ b/src/util/service.c @@ -11,6 +11,9 @@ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ /** -- cgit v1.2.3-18-g5258