gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] 01/02: changes for AGPL handling


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 01/02: changes for AGPL handling
Date: Wed, 06 Jun 2018 00:32:56 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit 90e29258a5339d232ea1b22f3f83d61701b52358
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Jun 6 00:32:36 2018 +0200

    changes for AGPL handling
---
 README                         | 16 ++++++----------
 src/include/gnunet_mq_lib.h    | 18 ++++++++++++++++++
 src/include/gnunet_protocols.h | 17 ++++++++++++++++-
 src/include/gnunet_util_lib.h  |  8 ++++++++
 src/util/mq.c                  | 37 +++++++++++++++++++++++++++++++++++++
 src/util/service.c             | 40 ++++++++++++++++++++++++++++++++++++----
 6 files changed, 121 insertions(+), 15 deletions(-)

diff --git a/README b/README
index 80a87d274..61c54b4f4 100644
--- a/README
+++ b/README
@@ -15,8 +15,11 @@ GNU package (http://www.gnu.org/).
 This is an ALPHA release.  There are known and significant bugs as
 well as many missing features in this release.
 
-GNUnet is free software released under the GNU General Public License
-(v3 or later). For details see the COPYING file in this directory.
+GNUnet is free software released under the GNU Affero General Public
+License (v3 or later). For details see the COPYING file in this
+directory.  If you fork this software, you MUST adjust GNUNET_AGPL_URL
+in src/include/gnunet_util_lib.h to point to the source code of your
+fork!
 
 Additional documentation about GNUnet can be found at
 https://gnunet.org/ and in the doc/ folder.
@@ -25,16 +28,9 @@ https://gnunet.org/ and in the doc/ folder.
 Dependencies:
 =============
 
-Please note that for many of its dependencies GNUnet requires very
-recent versions of the libraries which are often NOT to be found in
-stable distributions in 2014.  While using older packages may in some
-cases on some operating systems may seem to work in some limited
-fashion, we are in many cases aware of serious problems with older
-packages.  Hence please make sure to use  the versions listed below.
-
 These are the direct dependencies for running GNUnet:
 
-- libmicrohttpd >= 0.9.42
+- libmicrohttpd >= 0.9.52
 - libgcrypt     >= 1.6
 - libgnurl      >= 7.35.0 (available from https://gnunet.org/gnurl)
 - libunistring  >= 0.9.2
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h
index fe699c48f..daf1869fb 100644
--- a/src/include/gnunet_mq_lib.h
+++ b/src/include/gnunet_mq_lib.h
@@ -340,6 +340,24 @@ GNUNET_MQ_copy_handlers (const struct 
GNUNET_MQ_MessageHandler *handlers);
 
 
 /**
+ * Copy an array of handlers, appending AGPL handler.
+ *
+ * Useful if the array has been delared in local memory and needs to be
+ * persisted for future use.
+ *
+ * @param handlers Array of handlers to be copied. Can be NULL (nothing done).
+ * @param agpl_handler function to call for AGPL handling
+ * @param agpl_cls closure for @a agpl_handler
+ * @return A newly allocated array of handlers.
+ *         Needs to be freed with #GNUNET_free.
+ */
+struct GNUNET_MQ_MessageHandler *
+GNUNET_MQ_copy_handlers2 (const struct GNUNET_MQ_MessageHandler *handlers,
+                          GNUNET_MQ_MessageCallback agpl_handler,
+                          void *agpl_cls);
+
+
+/**
  * Count the handlers in a handler array.
  *
  * @param handlers Array of handlers to be counted.
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 7040f2cbf..60dbeeb78 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2001--2015 GNUnet e.V.
+     Copyright (C) 2001--2018 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
@@ -86,6 +86,21 @@ extern "C"
 #define GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE 5
 
 
/*******************************************************************************
+ * AGPL source code download
+ * 
*****************************************************************************/
+
+/**
+ * Message to request source code link.
+ */
+#define GNUNET_MESSAGE_TYPE_REQUEST_AGPL 6
+
+/**
+ * Source code link.
+ */
+#define GNUNET_MESSAGE_TYPE_RESPONSE_AGPL 7
+
+
+/*******************************************************************************
  * ARM message types
  
******************************************************************************/
 
diff --git a/src/include/gnunet_util_lib.h b/src/include/gnunet_util_lib.h
index a9bd6c33f..e82e6caee 100644
--- a/src/include/gnunet_util_lib.h
+++ b/src/include/gnunet_util_lib.h
@@ -52,6 +52,14 @@ extern "C"
  */
 #define GNUNET_MIN_MESSAGE_SIZE sizeof (struct GNUNET_MessageHeader)
 
+/**
+ * NOTE: You MUST adjust this URL to point to the location of a
+ * publicly accessible repository (or TGZ) containing the sources of
+ * THIS release. Otherwise, you are violating the Affero GPL if you make
+ * this service available to anyone but yourself.
+ */
+#define GNUNET_AGPL_URL "https://gnunet.org/git/gnunet.git#"; PACKAGE_VERSION;
+
 
 #include "gnunet_crypto_lib.h"
 #include "gnunet_bandwidth_lib.h"
diff --git a/src/util/mq.c b/src/util/mq.c
index 81a42e0c6..bf8f95790 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -1216,6 +1216,43 @@ GNUNET_MQ_copy_handlers (const struct 
GNUNET_MQ_MessageHandler *handlers)
 
 
 /**
+ * Copy an array of handlers, appending AGPL handler.
+ *
+ * Useful if the array has been delared in local memory and needs to be
+ * persisted for future use.
+ *
+ * @param handlers Array of handlers to be copied. Can be NULL (nothing done).
+ * @param agpl_handler function to call for AGPL handling
+ * @param agpl_cls closure for @a agpl_handler
+ * @return A newly allocated array of handlers.
+ *         Needs to be freed with #GNUNET_free.
+ */
+struct GNUNET_MQ_MessageHandler *
+GNUNET_MQ_copy_handlers2 (const struct GNUNET_MQ_MessageHandler *handlers,
+                          GNUNET_MQ_MessageCallback agpl_handler,
+                          void *agpl_cls)
+{
+  struct GNUNET_MQ_MessageHandler *copy;
+  unsigned int count;
+
+  if (NULL == handlers)
+    return NULL;
+  count = GNUNET_MQ_count_handlers (handlers);
+  copy = GNUNET_new_array (count + 2,
+                           struct GNUNET_MQ_MessageHandler);
+  GNUNET_memcpy (copy,
+                 handlers,
+                 count * sizeof (struct GNUNET_MQ_MessageHandler));
+  copy[count].mv = NULL;
+  copy[count].cb = agpl_handler;
+  copy[count].cls = agpl_cls;
+  copy[count].type = GNUNET_MESSAGE_TYPE_REQUEST_AGPL;
+  copy[count].expected_size = sizeof (struct GNUNET_MessageHeader);
+  return copy;
+}
+
+
+/**
  * Count the handlers in a handler array.
  *
  * @param handlers Array of handlers to be counted.
diff --git a/src/util/service.c b/src/util/service.c
index 1156093f4..ae1809950 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -1572,6 +1572,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
  * special cases.
@@ -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),

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]