gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: handle description field no long


From: gnunet
Subject: [taler-merchant] branch master updated: handle description field no longer being a simple string
Date: Fri, 28 Feb 2020 00:15:21 +0100

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 4dde5aa  handle description field no longer being a simple string
4dde5aa is described below

commit 4dde5aad410c2d44e3a52d319e309b3f4127e22f
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Feb 28 00:15:18 2020 +0100

    handle description field no longer being a simple string
---
 src/backend/taler-merchant-httpd_order.c | 28 +++++-----------------------
 1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_order.c 
b/src/backend/taler-merchant-httpd_order.c
index a862178..0c4e5c8 100644
--- a/src/backend/taler-merchant-httpd_order.c
+++ b/src/backend/taler-merchant-httpd_order.c
@@ -68,34 +68,16 @@ check_products (json_t *products)
     return GNUNET_SYSERR;
   }
   json_array_foreach (products, index, value) {
-    const char *description;
-    const char *error_name;
-    unsigned int error_line;
-    int res;
-    struct GNUNET_JSON_Specification spec[] = {
-      GNUNET_JSON_spec_string ("description", &description),
-      /* FIXME: there are other fields in the product specification
-         that are currently not labeled as optional. Maybe check
-         those as well, or make them truly optional. */
-      GNUNET_JSON_spec_end ()
-    };
-
-    /* extract fields we need to sign separately */
-    res = GNUNET_JSON_parse (value,
-                             spec,
-                             &error_name,
-                             &error_line);
-    if (GNUNET_OK != res)
+
+    if (NULL == json_object_get (value,
+                                 "description"))
     {
       GNUNET_break (0);
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Product description parsing failed at #%u: %s:%u\n",
-                  (unsigned int) index,
-                  error_name,
-                  error_line);
+                  "Product description parsing failed at product #%u\n",
+                  (unsigned int) index);
       return GNUNET_SYSERR;
     }
-    GNUNET_JSON_parse_free (spec);
   }
   return GNUNET_OK;
 }

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



reply via email to

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