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 | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-products.c b/src/backend/taler-merchant-httpd_private-post-products.c index 987857b4..9387a657 100644 --- a/src/backend/taler-merchant-httpd_private-post-products.c +++ b/src/backend/taler-merchant-httpd_private-post-products.c @@ -59,8 +59,8 @@ products_equal (const struct TALER_MERCHANTDB_ProductDetails *p1, (p1->total_stock == p2->total_stock) && (p1->total_sold == p2->total_sold) && (p1->total_lost == p2->total_lost) && - (1 == json_equal (p1->image, - p2->image)) && + (0 == strcmp (p1->image, + p2->image)) && (1 == json_equal (p1->address, p2->address)) && (p1->next_restock.abs_value_us == @@ -92,8 +92,8 @@ TMH_private_post_products (const struct TMH_RequestHandler *rh, (const char **) &pd.unit), TALER_JSON_spec_amount ("price", &pd.price), - GNUNET_JSON_spec_json ("image", - &pd.image), + GNUNET_JSON_spec_string ("image", + (const char **) &pd.image), GNUNET_JSON_spec_json ("taxes", &pd.taxes), GNUNET_JSON_spec_json ("address", @@ -113,9 +113,12 @@ TMH_private_post_products (const struct TMH_RequestHandler *rh, hc->request_body, spec); if (GNUNET_OK != res) + { + GNUNET_break_op (0); return (GNUNET_NO == res) ? MHD_YES : MHD_NO; + } } if (0 != strcasecmp (pd.price.currency, @@ -210,6 +213,8 @@ retry: } GNUNET_JSON_parse_free (spec); if (qs < 0) + { + GNUNET_break_op (0); return TALER_MHD_reply_with_error ( connection, MHD_HTTP_INTERNAL_SERVER_ERROR, @@ -217,6 +222,7 @@ retry: ? TALER_EC_GENERIC_DB_SOFT_FAILURE : TALER_EC_GENERIC_DB_COMMIT_FAILED, NULL); + } return TALER_MHD_reply_static (connection, MHD_HTTP_NO_CONTENT, NULL, |