gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: worked on backend


From: gnunet
Subject: [taler-anastasis] branch master updated: worked on backend
Date: Mon, 11 Nov 2019 17:10:13 +0100

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

ds-meister pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 6d91b3d  worked on backend
6d91b3d is described below

commit 6d91b3db6693bee9069a1b9e1194689ab62b5875
Author: Dominik Meister <address@hidden>
AuthorDate: Mon Nov 11 17:10:04 2019 +0100

    worked on backend
---
 src/backend/Makefile.am                 |  3 ++-
 src/backend/anastasis-httpd.c           | 45 +++++++++++++++++++++++----------
 src/backend/anastasis-httpd.h           |  2 +-
 src/backend/anastasis-httpd_responses.c |  2 +-
 src/backend/anastasis.conf              |  2 +-
 src/util/os_installation.c              |  2 +-
 6 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index 41be385..04791a4 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -1,7 +1,7 @@
 # This Makefile.am is in the public domain
 AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/backend-lib/
 
-pkgcfgdir = $(prefix)/share/taler/config.d/
+pkgcfgdir = $(prefix)/share/anastasis/config.d/
 
 pkgcfg_DATA = \
   anastasis.conf
@@ -19,6 +19,7 @@ anastasis_httpd_SOURCES = \
   anastasis-httpd_mhd.c anastasis-httpd_mhd.h
 
 anastasis_httpd_LDADD = \
+  $(top_builddir)/src/stasis/libanastasisdb.la \
   -lmicrohttpd \
   -ljansson \
   -lgnunetcurl \
diff --git a/src/backend/anastasis-httpd.c b/src/backend/anastasis-httpd.c
index 4ddab6e..42db89c 100644
--- a/src/backend/anastasis-httpd.c
+++ b/src/backend/anastasis-httpd.c
@@ -40,7 +40,7 @@ static long long unsigned port;
 /**
  * Should a "Connection: close" header be added to each HTTP response?
  */
-int TMH_merchant_connection_close;
+int TMH_anastasis_connection_close;
 
 /**
  * Task running the HTTP server.
@@ -68,6 +68,11 @@ static char *serve_unixpath;
  */
 static mode_t unixpath_mode;
 
+/**
+ * Connection handle to the our database
+ */
+struct ANASTASIS_DatabasePlugin *db;
+
 
 /**
  * Return GNUNET_YES if given a valid correlation ID and
@@ -252,6 +257,11 @@ do_shutdown (void *cls)
     MHD_stop_daemon (mhd);
     mhd = NULL;
   }
+  if (NULL != db)
+  {
+    ANASTASIS_DB_plugin_unload (db);
+    db = NULL;
+  }
 }
 
 
@@ -422,6 +432,15 @@ run (void *cls,
                  GNUNET_log_setup ("anastasis-httpd",
                                    "WARNING",
                                    NULL));
+/*  if (NULL ==
+     (db = ANASTASIS_DB_plugin_load (config)))
+  {
+     GNUNET_SCHEDULER_shutdown ();
+     return;
+  }
+*/
+
+
   {
     const char *choices[] = {"tcp",
                              "unix",
@@ -432,13 +451,13 @@ run (void *cls,
     if (GNUNET_OK !=
         GNUNET_CONFIGURATION_get_value_choice (config,
                                                "anastasis",
-                                               "serve",
+                                               "SERVE",
                                                choices,
                                                &serve_type))
     {
       GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-                                 "merchant",
-                                 "serve",
+                                 "anastasis",
+                                 "SERVE",
                                  "serve type required");
       GNUNET_SCHEDULER_shutdown ();
       return;
@@ -452,12 +471,12 @@ run (void *cls,
 
       if (GNUNET_OK !=
           GNUNET_CONFIGURATION_get_value_filename (config,
-                                                   "merchant",
+                                                   "anastasis",
                                                    "unixpath",
                                                    &serve_unixpath))
       {
         GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-                                   "merchant",
+                                   "anastasis",
                                    "unixpath",
                                    "unixpath required");
         GNUNET_SCHEDULER_shutdown ();
@@ -474,12 +493,12 @@ run (void *cls,
 
       if (GNUNET_OK !=
           GNUNET_CONFIGURATION_get_value_string (config,
-                                                 "merchant",
+                                                 "anastasis",
                                                  "UNIXPATH_MODE",
                                                  &mode))
       {
         GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-                                   "merchant",
+                                   "anastasis",
                                    "UNIXPATH_MODE");
         GNUNET_SCHEDULER_shutdown ();
         return;
@@ -489,7 +508,7 @@ run (void *cls,
       if (0 != errno)
       {
         GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-                                   "merchant",
+                                   "anastasis",
                                    "UNIXPATH_MODE",
                                    "must be octal number");
         GNUNET_free (mode);
@@ -564,19 +583,19 @@ run (void *cls,
 
       if (GNUNET_SYSERR ==
           GNUNET_CONFIGURATION_get_value_number (config,
-                                                 "merchant",
+                                                 "anastasis",
                                                  "PORT",
                                                  &port))
       {
         GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-                                   "merchant",
+                                   "anastasis",
                                    "PORT");
         GNUNET_SCHEDULER_shutdown ();
         return;
       }
       if (GNUNET_OK ==
           GNUNET_CONFIGURATION_get_value_string (config,
-                                                 "merchant",
+                                                 "anastasis",
                                                  "BIND_TO",
                                                  &bind_to))
       {
@@ -697,7 +716,7 @@ main (int argc,
     GNUNET_GETOPT_option_flag ('C',
                                "connection-close",
                                "force HTTP connections to be closed after each 
request",
-                               &TMH_merchant_connection_close),
+                               &TMH_anastasis_connection_close),
 
     GNUNET_GETOPT_OPTION_END
   };
diff --git a/src/backend/anastasis-httpd.h b/src/backend/anastasis-httpd.h
index fb72c0f..be57c13 100644
--- a/src/backend/anastasis-httpd.h
+++ b/src/backend/anastasis-httpd.h
@@ -129,7 +129,7 @@ struct TM_HandlerContext
 /**
  * Should a "Connection: close" header be added to each HTTP response?
  */
-extern int TMH_merchant_connection_close;
+extern int TMH_anastasis_connection_close;
 
 /**
  * Kick MHD to run now, to be called after MHD_resume_connection().
diff --git a/src/backend/anastasis-httpd_responses.c 
b/src/backend/anastasis-httpd_responses.c
index f15fc89..2b5a8a0 100644
--- a/src/backend/anastasis-httpd_responses.c
+++ b/src/backend/anastasis-httpd_responses.c
@@ -332,7 +332,7 @@ TMH_RESPONSE_reply_bad_request (struct MHD_Connection 
*connection,
 void
 TMH_RESPONSE_add_global_headers (struct MHD_Response *response)
 {
-  if (TMH_merchant_connection_close)
+  if (TMH_anastasis_connection_close)
     GNUNET_break (MHD_YES ==
                   MHD_add_response_header (response,
                                            MHD_HTTP_HEADER_CONNECTION,
diff --git a/src/backend/anastasis.conf b/src/backend/anastasis.conf
index 74e508a..43ce9d0 100644
--- a/src/backend/anastasis.conf
+++ b/src/backend/anastasis.conf
@@ -18,7 +18,7 @@ PORT = 9966
 
 
 # Which unix domain path should we bind to? Only used if "SERVE" is 'unix'.
-UNIXPATH = ${ANASTASIS_RUNTIME_DIR}/backup.http
+UNIXPATH = ${ANASTASIS_RUNTIME_DIR}/backend.http
 # What should be the file access permissions (see chmod) for "UNIXPATH"?
 UNIXPATH_MODE = 660
 
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 5859967..d82b3d1 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -34,7 +34,7 @@
 static const struct GNUNET_OS_ProjectData anastasis_pd = {
   .libname = "libanastasisutil",
   .project_dirname = "anastasis",
-  .binary_name = "anastasis-exchange-httpd",
+  .binary_name = "anastasis-httpd",
   .env_varname = "ANASTASIS_PREFIX",
   .base_config_varname = "ANASTASIS_BASE_CONFIG",
   .bug_email = "address@hidden",

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



reply via email to

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