[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-donau] branch master updated: charity get
From: |
gnunet |
Subject: |
[taler-donau] branch master updated: charity get |
Date: |
Fri, 05 Jan 2024 17:10:15 +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 c7198a7 charity get
c7198a7 is described below
commit c7198a769483803a8437e4c5cebdf81d13d493a3
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
AuthorDate: Fri Jan 5 17:09:44 2024 +0100
charity get
---
src/donau/donau-httpd_get-charity.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/src/donau/donau-httpd_get-charity.c
b/src/donau/donau-httpd_get-charity.c
index bdd3795..48c3358 100644
--- a/src/donau/donau-httpd_get-charity.c
+++ b/src/donau/donau-httpd_get-charity.c
@@ -42,14 +42,10 @@ DH_handler_charity_get (
struct DH_RequestContext *rc,
const char *const args[])
{
- int charity_id;
+ unsigned long long int charity_id;
if ( (NULL == args[0]) ||
- (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (args[0],
- strlen (args[0]),
- &charity_id,
- sizeof (charity_id))) )
+ (1 != sscanf(args[0], "%llu", &charity_id)))
{
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (rc->connection,
@@ -75,8 +71,8 @@ DH_handler_charity_get (
charity_info = json_array ();
GNUNET_assert (NULL != charity_info);
qs = DH_plugin->select_charity_info (DH_plugin->cls,
- &charity_id,
- charity_info);
+ &charity_id,
+ charity_info);
switch (qs)
{
case GNUNET_DB_STATUS_HARD_ERROR:
@@ -90,7 +86,6 @@ DH_handler_charity_get (
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
if (none)
{
- json_decref (charity_info);
return TALER_MHD_reply_static (
rc->connection,
MHD_HTTP_NO_CONTENT,
@@ -102,11 +97,20 @@ DH_handler_charity_get (
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
break;
}
- return TALER_MHD_REPLY_JSON_PACK (
- rc->connection,
- MHD_HTTP_OK,
- GNUNET_JSON_pack_array_steal ("charity_info",
- charity_info));
+
+ static struct MHD_Response *resp;
+
+ if (NULL == resp)
+ {
+ resp = TALER_MHD_MAKE_JSON_PACK (
+ GNUNET_JSON_pack_string ("url",
+ qs->charity_url),
+ GNUNET_JSON_pack_string ("name",
+ qs->charity_name));
+ }
+ return MHD_queue_response (rc->connection,
+ MHD_HTTP_OK,
+ resp);
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-donau] branch master updated: charity get,
gnunet <=