aboutsummaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_get_kyc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/merchant_api_get_kyc.c')
-rw-r--r--src/lib/merchant_api_get_kyc.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/lib/merchant_api_get_kyc.c b/src/lib/merchant_api_get_kyc.c
index 0b62d2cf..c394590a 100644
--- a/src/lib/merchant_api_get_kyc.c
+++ b/src/lib/merchant_api_get_kyc.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2021 Taler Systems SA
+ Copyright (C) 2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
@@ -76,8 +76,8 @@ struct TALER_MERCHANT_KycGetHandle
static enum GNUNET_GenericReturnValue
parse_kyc (struct TALER_MERCHANT_KycGetHandle *kyc,
struct TALER_MERCHANT_KycResponse *kr,
- json_t *pends,
- json_t *touts)
+ const json_t *pends,
+ const json_t *touts)
{
unsigned int num_pends = json_array_size (pends);
unsigned int num_touts = json_array_size (touts);
@@ -186,13 +186,13 @@ handle_get_kyc_finished (void *cls,
case MHD_HTTP_BAD_GATEWAY:
case MHD_HTTP_GATEWAY_TIMEOUT:
{
- json_t *pends;
- json_t *touts;
+ const json_t *pends;
+ const json_t *touts;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_json ("pending_kycs",
- &pends),
- GNUNET_JSON_spec_json ("timeout_kycs",
- &touts),
+ GNUNET_JSON_spec_array_const ("pending_kycs",
+ &pends),
+ GNUNET_JSON_spec_array_const ("timeout_kycs",
+ &touts),
GNUNET_JSON_spec_end ()
};
@@ -205,20 +205,17 @@ handle_get_kyc_finished (void *cls,
kr.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
break;
}
- if ( (! json_is_array (pends)) ||
- (! json_is_array (touts)) ||
- (GNUNET_OK !=
- parse_kyc (kyc,
- &kr,
- pends,
- touts)) )
+ if (GNUNET_OK !=
+ parse_kyc (kyc,
+ &kr,
+ pends,
+ touts))
{
kr.hr.http_status = 0;
kr.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
break;
}
/* parse_kyc called the continuation already */
- GNUNET_JSON_parse_free (spec);
TALER_MERCHANT_kyc_get_cancel (kyc);
return;
}