gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: patch from Lucien


From: gnunet
Subject: [taler-exchange] branch master updated: patch from Lucien
Date: Tue, 08 Feb 2022 22:58:14 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 6cbf7218 patch from Lucien
6cbf7218 is described below

commit 6cbf7218d87e69442268d0ea3ba37170bad9c563
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Feb 8 22:58:02 2022 +0100

    patch from Lucien
---
 src/exchange/taler-exchange-httpd_csr.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_csr.c 
b/src/exchange/taler-exchange-httpd_csr.c
index 31a7614f..3c3c033e 100644
--- a/src/exchange/taler-exchange-httpd_csr.c
+++ b/src/exchange/taler-exchange-httpd_csr.c
@@ -39,6 +39,7 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
 {
   unsigned int csr_requests_num;
   json_t *csr_requests;
+  json_t *csr_response_ewvs;
   json_t *csr_response;
 
   struct GNUNET_JSON_Specification spec[] = {
@@ -58,13 +59,13 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
     res = TALER_MHD_parse_json_data (rc->connection,
                                      root,
                                      spec);
-    GNUNET_JSON_parse_free (spec);
     if (GNUNET_OK != res)
       return (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
   }
   csr_requests_num = json_array_size (csr_requests);
   if (TALER_MAX_FRESH_COINS <= csr_requests_num)
   {
+    GNUNET_JSON_parse_free (spec);
     return TALER_MHD_reply_with_error (
       rc->connection,
       MHD_HTTP_BAD_REQUEST,
@@ -90,13 +91,17 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
     enum GNUNET_GenericReturnValue res;
 
     res = TALER_MHD_parse_json_array (rc->connection,
-                                      root,
+                                      csr_requests,
                                       csr_spec,
                                       i,
                                       -1);
     if (GNUNET_OK != res)
+    {
+      GNUNET_JSON_parse_free (spec);
       return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
+    }
   }
+  GNUNET_JSON_parse_free (spec);
 
   struct TALER_DenominationCSPublicRPairP r_pubs[GNUNET_NZL 
(csr_requests_num)];
   for (unsigned int i = 0; i < csr_requests_num; i++)
@@ -179,7 +184,7 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
   }
 
   // send response
-  csr_response = json_array ();
+  csr_response_ewvs = json_array ();
   for (unsigned int i = 0; i < csr_requests_num; i++)
   {
     const struct TALER_DenominationCSPublicRPairP *r_pub = &r_pubs[i];
@@ -194,9 +199,14 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
                                      sizeof(struct GNUNET_CRYPTO_CsRPublic)));
     GNUNET_assert (NULL != csr_obj);
     GNUNET_assert (0 ==
-                   json_array_append_new (csr_response,
+                   json_array_append_new (csr_response_ewvs,
                                           csr_obj));
   }
+  csr_response = GNUNET_JSON_PACK (
+    GNUNET_JSON_pack_array_steal ("ewvs",
+                                  csr_response_ewvs));
+  GNUNET_assert (NULL != csr_response);
+
   return TALER_MHD_reply_json (rc->connection,
                                csr_response,
                                MHD_HTTP_OK);

-- 
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]