diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-products.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-products.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-products.c b/src/backend/taler-merchant-httpd_private-post-products.c index 7fd62db9..c291845a 100644 --- a/src/backend/taler-merchant-httpd_private-post-products.c +++ b/src/backend/taler-merchant-httpd_private-post-products.c @@ -117,18 +117,10 @@ TMH_private_post_products (const struct TMH_RequestHandler *rh, res = TALER_MHD_parse_json_data (connection, hc->request_body, spec); - /* json is malformed */ - if (GNUNET_NO == res) - { - GNUNET_break_op (0); - return MHD_YES; - } - /* other internal errors might have occurred */ - if (GNUNET_SYSERR == res) - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_INTERNAL_INVARIANT_FAILURE, - "Impossible to parse the order"); + if (GNUNET_OK != res) + return (GNUNET_NO == res) + ? MHD_YES + : MHD_NO; } if (-1 == total_stock) @@ -148,22 +140,10 @@ TMH_private_post_products (const struct TMH_RequestHandler *rh, res = TALER_MHD_parse_json_data (connection, hc->request_body, spec); - /* json is malformed */ - if (GNUNET_NO == res) - { - GNUNET_break_op (0); - GNUNET_JSON_parse_free (spec); - return MHD_YES; - } - /* other internal errors might have occurred */ - if (GNUNET_SYSERR == res) - { - GNUNET_JSON_parse_free (spec); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - TALER_EC_INTERNAL_INVARIANT_FAILURE, - "Impossible to parse the restock time"); - } + if (GNUNET_OK != res) + return (GNUNET_NO == res) + ? MHD_YES + : MHD_NO; } else { |