gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: Initial work on policy handler


From: gnunet
Subject: [taler-anastasis] branch master updated: Initial work on policy handler
Date: Wed, 13 Nov 2019 09:37:34 +0100

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

dennis-neufeld pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new a0e24e1  Initial work on policy handler
a0e24e1 is described below

commit a0e24e11e1522128afc93d13f11a6604f42989b1
Author: Dennis Neufeld <address@hidden>
AuthorDate: Wed Nov 13 08:37:17 2019 +0000

    Initial work on policy handler
---
 src/backend/Makefile.am               |  3 ++-
 src/backend/anastasis-httpd.c         | 29 ++++++++++++++++++---
 src/backend/anastasis-httpd_parsing.h |  4 +--
 src/backend/anastasis-httpd_policy.c  | 49 +++++++++++++++++++++++++++++++++++
 src/backend/anastasis-httpd_policy.h  | 46 ++++++++++++++++++++++++++++++++
 src/include/anastasis_service.h       |  2 --
 6 files changed, 125 insertions(+), 8 deletions(-)

diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index 3a74b6e..df0b27e 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -15,7 +15,8 @@ anastasis_httpd_SOURCES = \
   anastasis-httpd.c anastasis-httpd.h \
   anastasis-httpd_parsing.c anastasis-httpd_parsing.h \
   anastasis-httpd_responses.c anastasis-httpd_responses.h \
-  anastasis-httpd_mhd.c anastasis-httpd_mhd.h
+  anastasis-httpd_mhd.c anastasis-httpd_mhd.h \
+  anastasis-httpd_policy.c anastasis-httpd_policy.h
 
 anastasis_httpd_LDADD = \
   $(top_builddir)/src/util/libanastasisutil.la \
diff --git a/src/backend/anastasis-httpd.c b/src/backend/anastasis-httpd.c
index 38556a8..6f31550 100644
--- a/src/backend/anastasis-httpd.c
+++ b/src/backend/anastasis-httpd.c
@@ -26,6 +26,7 @@
 #include "anastasis-httpd_parsing.h"
 #include "anastasis-httpd_mhd.h"
 #include "anastasis_database_lib.h"
+#include "anastasis-httpd_policy.h"
 
 /**
  * Backlog for listen operation on unix-domain sockets.
@@ -201,12 +202,34 @@ url_handler (void *cls,
                     strlen ("/policy/")))
   {
     // return handle_policy (...);
+    if (0 == strcmp (method, MHD_HTTP_METHOD_GET))
+    {
+      return ANASTASIS_MHD_handler_policy_GET (connection,
+                                               con_cls,
+                                               upload_data,
+                                               upload_data_size);
+    }
+    if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
+    {
+      return ANASTASIS_MHD_handler_policy_POST (connection,
+                                                con_cls,
+                                                upload_data,
+                                                upload_data_size);
+    }
   }
   if (0 == strncmp (url,
                     "/truth/",
                     strlen ("/truth/")))
   {
     // return handle_truth (...);
+    if (0 == strcmp (method, MHD_HTTP_METHOD_GET))
+    {
+
+    }
+    if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
+    {
+      
+    }
   }
   for (unsigned int i = 0; NULL != handlers[i].url; i++)
   {
@@ -439,10 +462,10 @@ run (void *cls,
                                    "WARNING",
                                    NULL));
   if (NULL ==
-     (db = ANASTASIS_DB_plugin_load (config)))
+      (db = ANASTASIS_DB_plugin_load (config)))
   {
-     GNUNET_SCHEDULER_shutdown ();
-     return;
+    GNUNET_SCHEDULER_shutdown ();
+    return;
   }
 
   {
diff --git a/src/backend/anastasis-httpd_parsing.h 
b/src/backend/anastasis-httpd_parsing.h
index d6e1039..3e5816a 100644
--- a/src/backend/anastasis-httpd_parsing.h
+++ b/src/backend/anastasis-httpd_parsing.h
@@ -20,8 +20,8 @@
  * @author Benedikt Mueller
  * @author Christian Grothoff
  */
-#ifndef TALER_EXCHANGE_HTTPD_PARSING_H
-#define TALER_EXCHANGE_HTTPD_PARSING_H
+#ifndef ANASTASIS_HTTPD_PARSING_H
+#define ANASTASIS_HTTPD_PARSING_H
 
 #include <microhttpd.h>
 #include <taler/taler_util.h>
diff --git a/src/backend/anastasis-httpd_policy.c 
b/src/backend/anastasis-httpd_policy.c
new file mode 100644
index 0000000..efbbdf3
--- /dev/null
+++ b/src/backend/anastasis-httpd_policy.c
@@ -0,0 +1,49 @@
+/*
+  This file is part of TALER
+  Copyright (C) 2014, 2015, 2016 GNUnet e.V.
+
+  TALER is free software; you can redistribute it and/or modify it under the
+  terms of the GNU Affero General Public License as published by the Free 
Software
+  Foundation; either version 3, or (at your option) any later version.
+
+  TALER 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 Affero General Public License for more 
details.
+
+  You should have received a copy of the GNU Affero General Public License 
along with
+  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file anastasis-httpd_policy.c
+ * @brief functions to handle incoming requests on /policy/
+ * @author Dennis Neufeld
+ * @author Dominik Meister
+ * @author Christian Grothoff
+ */
+
+#include "anastasis-httpd.h"
+#include <gnunet/gnunet_util_lib.h>
+
+/**
+ * 
+ */
+int
+ANASTASIS_MHD_handler_policy_GET (struct MHD_Connection *connection,
+                                  void **con_cls,
+                                  const char *upload_data,
+                                  size_t *upload_data_size)
+{
+    return GNUNET_OK;
+}
+
+/**
+ * 
+ */
+int
+ANASTASIS_MHD_handler_policy_POST (struct MHD_Connection *connection,
+                                   void **con_cls,
+                                   const char *upload_data,
+                                   size_t *upload_data_size)
+{
+    return GNUNET_OK;
+}
\ No newline at end of file
diff --git a/src/backend/anastasis-httpd_policy.h 
b/src/backend/anastasis-httpd_policy.h
new file mode 100644
index 0000000..9159401
--- /dev/null
+++ b/src/backend/anastasis-httpd_policy.h
@@ -0,0 +1,46 @@
+/*
+  This file is part of TALER
+  Copyright (C) 2014, 2015, 2016 GNUnet e.V.
+
+  TALER is free software; you can redistribute it and/or modify it under the
+  terms of the GNU Affero General Public License as published by the Free 
Software
+  Foundation; either version 3, or (at your option) any later version.
+
+  TALER 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 Affero General Public License for more 
details.
+
+  You should have received a copy of the GNU Affero General Public License 
along with
+  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file anastasis-httpd_policy.h
+ * @brief functions to handle incoming requests on /policy/
+ * @author Dennis Neufeld
+ * @author Dominik Meister
+ * @author Christian Grothoff
+ */
+#ifndef ANASTASIS_HTTPD_POLICY_H
+#define ANASTASIS_HTTPD_POLICY_H
+#include <microhttpd.h>
+
+/**
+ * 
+ */
+int
+ANASTASIS_MHD_handler_policy_GET (struct MHD_Connection *connection,
+                                  void **con_cls,
+                                  const char *upload_data,
+                                  size_t *upload_data_size);
+
+/**
+ * 
+ */
+int
+ANASTASIS_MHD_handler_policy_POST (struct MHD_Connection *connection,
+                                   void **con_cls,
+                                   const char *upload_data,
+                                   size_t *upload_data_size);
+
+
+#endif
\ No newline at end of file
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index 201ebc0..7e65055 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -28,8 +28,6 @@
 #include <jansson.h>
 
 
-/* ****************** Anastasis crypto primitives ************* */
-
 /**
  * An EdDSA public key that is used to identify a user's account.
  */

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



reply via email to

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