gnunet-svn
[Top][All Lists]
Advanced

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

[taler-donau] branch master updated: [httpd] added post route


From: gnunet
Subject: [taler-donau] branch master updated: [httpd] added post route
Date: Tue, 09 Jan 2024 12:51:05 +0100

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

johannes-casaburi pushed a commit to branch master
in repository donau.

The following commit(s) were added to refs/heads/master by this push:
     new dc8df52  [httpd] added post route
dc8df52 is described below

commit dc8df52d1dc59ff1550757503b9a3e625da5a2a3
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
AuthorDate: Tue Jan 9 12:50:22 2024 +0100

    [httpd] added post route
---
 contrib/gana                         |  2 +-
 src/donau/donau-httpd.c              |  8 +++++++-
 src/donau/donau-httpd_charity.h      |  7 ++++---
 src/donau/donau-httpd_post-charity.c | 12 ++++++------
 4 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/contrib/gana b/contrib/gana
index 6d3fb42..40f6cf1 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit 6d3fb428f0a2dd5bc5f35516ea77c32c2cf0ecfa
+Subproject commit 40f6cf1015231663064eda98aa1e403cddd7b970
diff --git a/src/donau/donau-httpd.c b/src/donau/donau-httpd.c
index 5b15cf5..907c283 100644
--- a/src/donau/donau-httpd.c
+++ b/src/donau/donau-httpd.c
@@ -52,7 +52,7 @@
  * Above what request latency do we start to log?
  */
  #define WARN_LATENCY GNUNET_TIME_relative_multiply ( \
-    GNUNET_TIME_UNIT_MILLISECONDS, 500)
+           GNUNET_TIME_UNIT_MILLISECONDS, 500)
 
 /**
  * Are clients allowed to request /keys for times other than the
@@ -451,6 +451,12 @@ handle_mhd_request (void *cls,
       .method = MHD_HTTP_METHOD_GET,
       .handler.get = &DH_handler_charities_get
     },
+    /* POST charities */
+    {
+      .url = "charities",
+      .method = MHD_HTTP_METHOD_POST,
+      .handler.post = &DH_handler_charity_post
+    },
     /**
     etc
 
diff --git a/src/donau/donau-httpd_charity.h b/src/donau/donau-httpd_charity.h
index f16c764..190438f 100644
--- a/src/donau/donau-httpd_charity.h
+++ b/src/donau/donau-httpd_charity.h
@@ -33,9 +33,10 @@
  * @return MHD result code
  */
 MHD_RESULT
-TEH_handler_charity_post (
-  struct MHD_Connection *connection,
-  const json_t *root);
+DH_handler_charity_post (
+  struct DH_RequestContext *rc,
+  const json_t *root,
+  const char *const args[]);
 
 
 /**
diff --git a/src/donau/donau-httpd_post-charity.c 
b/src/donau/donau-httpd_post-charity.c
index 6fde1f1..e6c2160 100644
--- a/src/donau/donau-httpd_post-charity.c
+++ b/src/donau/donau-httpd_post-charity.c
@@ -96,9 +96,9 @@ insert_charity (void *cls,
 
 
 MHD_RESULT
-DH_handler_charity_post (
-  struct MHD_Connection *connection,
-  const json_t *root)
+DH_handler_charity_post (struct DH_RequestContext *rc,
+                         const json_t *root,
+                         const char *const args[])
 {
   struct InsertCharityContext icc;
 
@@ -113,7 +113,7 @@ DH_handler_charity_post (
   {
     enum GNUNET_GenericReturnValue res;
 
-    res = TALER_MHD_parse_json_data (connection,
+    res = TALER_MHD_parse_json_data (rc->connection,
                                      root,
                                      spec);
     if (GNUNET_SYSERR == res)
@@ -129,7 +129,7 @@ DH_handler_charity_post (
     MHD_RESULT mhd_ret;
 
     if (GNUNET_OK !=
-        DH_DB_run_transaction (connection,
+        DH_DB_run_transaction (rc->connection,
                                "insert_charity",
                                DH_MT_REQUEST_OTHER,
                                &mhd_ret,
@@ -140,7 +140,7 @@ DH_handler_charity_post (
     }
   }
   return TALER_MHD_reply_static (
-    connection,
+    rc->connection,
     MHD_HTTP_NO_CONTENT,
     NULL,
     NULL,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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