Fix compiler warnings.
This reverts changes made in b0d00823eb
. The warnings
are fixed by changing the functions signatures, instead of casting
their pointers.
This commit is contained in:
parent
e83964badb
commit
60c533562c
@ -70,16 +70,17 @@ struct TALER_BANK_AdminAddIncomingHandle
|
||||
*
|
||||
* @param cls the `struct TALER_BANK_AdminAddIncomingHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_admin_add_incoming_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_BANK_AdminAddIncomingHandle *aai = cls;
|
||||
uint64_t row_id = UINT64_MAX;
|
||||
enum TALER_ErrorCode ec;
|
||||
const json_t *j = response;
|
||||
|
||||
aai->job = NULL;
|
||||
switch (response_code)
|
||||
@ -96,7 +97,7 @@ handle_admin_add_incoming_finished (void *cls,
|
||||
};
|
||||
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_JSON_parse (json,
|
||||
GNUNET_JSON_parse (j,
|
||||
spec,
|
||||
NULL, NULL))
|
||||
{
|
||||
@ -111,27 +112,27 @@ handle_admin_add_incoming_finished (void *cls,
|
||||
case MHD_HTTP_BAD_REQUEST:
|
||||
/* This should never happen, either us or the bank is buggy
|
||||
(or API version conflict); just pass JSON reply to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_FORBIDDEN:
|
||||
/* Access denied */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_UNAUTHORIZED:
|
||||
/* Nothing really to verify, bank says one of the signatures is
|
||||
invalid; as we checked them, this should never happen, we
|
||||
should pass the JSON reply to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_NOT_FOUND:
|
||||
/* Nothing really to verify, this should never
|
||||
happen, we should pass the JSON reply to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_INTERNAL_SERVER_ERROR:
|
||||
/* Server had an internal issue; we should retry, but this API
|
||||
leaves this to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
default:
|
||||
/* unexpected response code */
|
||||
@ -139,7 +140,7 @@ handle_admin_add_incoming_finished (void *cls,
|
||||
"Unexpected response code %u\n",
|
||||
(unsigned int) response_code);
|
||||
GNUNET_break (0);
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
response_code = 0;
|
||||
break;
|
||||
}
|
||||
@ -147,7 +148,7 @@ handle_admin_add_incoming_finished (void *cls,
|
||||
response_code,
|
||||
ec,
|
||||
row_id,
|
||||
json);
|
||||
j);
|
||||
TALER_BANK_admin_add_incoming_cancel (aai);
|
||||
}
|
||||
|
||||
@ -247,7 +248,7 @@ TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx,
|
||||
aai->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_NO,
|
||||
(GC_JCC) &handle_admin_add_incoming_finished,
|
||||
&handle_admin_add_incoming_finished,
|
||||
aai);
|
||||
return aai;
|
||||
}
|
||||
|
@ -169,15 +169,16 @@ parse_account_history (struct TALER_BANK_HistoryHandle *hh,
|
||||
*
|
||||
* @param cls the `struct TALER_BANK_HistoryHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_history_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_BANK_HistoryHandle *hh = cls;
|
||||
enum TALER_ErrorCode ec;
|
||||
const json_t *j = response;
|
||||
|
||||
hh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -188,7 +189,7 @@ handle_history_finished (void *cls,
|
||||
case MHD_HTTP_OK:
|
||||
if (GNUNET_OK !=
|
||||
parse_account_history (hh,
|
||||
json))
|
||||
j))
|
||||
{
|
||||
GNUNET_break_op (0);
|
||||
response_code = 0;
|
||||
@ -204,27 +205,27 @@ handle_history_finished (void *cls,
|
||||
case MHD_HTTP_BAD_REQUEST:
|
||||
/* This should never happen, either us or the bank is buggy
|
||||
(or API version conflict); just pass JSON reply to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_FORBIDDEN:
|
||||
/* Access denied */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_UNAUTHORIZED:
|
||||
/* Nothing really to verify, bank says one of the signatures is
|
||||
invalid; as we checked them, this should never happen, we
|
||||
should pass the JSON reply to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_NOT_FOUND:
|
||||
/* Nothing really to verify, this should never
|
||||
happen, we should pass the JSON reply to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_INTERNAL_SERVER_ERROR:
|
||||
/* Server had an internal issue; we should retry, but this API
|
||||
leaves this to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
default:
|
||||
/* unexpected response code */
|
||||
@ -232,7 +233,7 @@ handle_history_finished (void *cls,
|
||||
"Unexpected response code %u\n",
|
||||
(unsigned int) response_code);
|
||||
GNUNET_break (0);
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
response_code = 0;
|
||||
break;
|
||||
}
|
||||
@ -242,7 +243,7 @@ handle_history_finished (void *cls,
|
||||
TALER_BANK_DIRECTION_NONE,
|
||||
0LLU,
|
||||
NULL,
|
||||
json);
|
||||
j);
|
||||
TALER_BANK_history_cancel (hh);
|
||||
}
|
||||
|
||||
@ -350,7 +351,7 @@ TALER_BANK_history (struct GNUNET_CURL_Context *ctx,
|
||||
hh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_NO,
|
||||
(GC_JCC) &handle_history_finished,
|
||||
&handle_history_finished,
|
||||
hh);
|
||||
return hh;
|
||||
}
|
||||
|
@ -70,15 +70,16 @@ struct TALER_BANK_RejectHandle
|
||||
*
|
||||
* @param cls the `struct TALER_BANK_RejectHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_reject_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_BANK_RejectHandle *rh = cls;
|
||||
enum TALER_ErrorCode ec;
|
||||
const json_t *j = response;
|
||||
|
||||
rh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -97,27 +98,27 @@ handle_reject_finished (void *cls,
|
||||
case MHD_HTTP_BAD_REQUEST:
|
||||
/* This should never happen, either us or the bank is buggy
|
||||
(or API version conflict); just pass JSON reply to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_FORBIDDEN:
|
||||
/* Access denied */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_UNAUTHORIZED:
|
||||
/* Nothing really to verify, bank says one of the signatures is
|
||||
invalid; as we checked them, this should never happen, we
|
||||
should pass the JSON reply to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_NOT_FOUND:
|
||||
/* Nothing really to verify, this should never
|
||||
happen, we should pass the JSON reply to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
case MHD_HTTP_INTERNAL_SERVER_ERROR:
|
||||
/* Server had an internal issue; we should retry, but this API
|
||||
leaves this to the application */
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
break;
|
||||
default:
|
||||
/* unexpected response code */
|
||||
@ -125,7 +126,7 @@ handle_reject_finished (void *cls,
|
||||
"Unexpected response code %u\n",
|
||||
(unsigned int) response_code);
|
||||
GNUNET_break (0);
|
||||
ec = TALER_BANK_parse_ec_ (json);
|
||||
ec = TALER_BANK_parse_ec_ (j);
|
||||
response_code = 0;
|
||||
break;
|
||||
}
|
||||
@ -215,7 +216,7 @@ TALER_BANK_reject (struct GNUNET_CURL_Context *ctx,
|
||||
rh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_NO,
|
||||
(GC_JCC) &handle_reject_finished,
|
||||
&handle_reject_finished,
|
||||
rh);
|
||||
return rh;
|
||||
}
|
||||
|
@ -193,16 +193,17 @@ verify_deposit_signature_forbidden (const struct TALER_EXCHANGE_DepositHandle *d
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_DepositHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_deposit_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_DepositHandle *dh = cls;
|
||||
struct TALER_ExchangePublicKeyP exchange_pub;
|
||||
struct TALER_ExchangePublicKeyP *ep = NULL;
|
||||
const json_t *j = response;
|
||||
|
||||
dh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -212,7 +213,7 @@ handle_deposit_finished (void *cls,
|
||||
case MHD_HTTP_OK:
|
||||
if (GNUNET_OK !=
|
||||
verify_deposit_signature_ok (dh,
|
||||
json,
|
||||
j,
|
||||
&exchange_pub))
|
||||
{
|
||||
GNUNET_break_op (0);
|
||||
@ -231,7 +232,7 @@ handle_deposit_finished (void *cls,
|
||||
/* Double spending; check signatures on transaction history */
|
||||
if (GNUNET_OK !=
|
||||
verify_deposit_signature_forbidden (dh,
|
||||
json))
|
||||
j))
|
||||
{
|
||||
GNUNET_break_op (0);
|
||||
response_code = 0;
|
||||
@ -261,9 +262,9 @@ handle_deposit_finished (void *cls,
|
||||
}
|
||||
dh->cb (dh->cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
ep,
|
||||
json);
|
||||
j);
|
||||
TALER_EXCHANGE_deposit_cancel (dh);
|
||||
}
|
||||
|
||||
@ -511,7 +512,7 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
|
||||
dh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
(GC_JCC) &handle_deposit_finished,
|
||||
&handle_deposit_finished,
|
||||
dh);
|
||||
return dh;
|
||||
}
|
||||
|
@ -834,13 +834,14 @@ TALER_EXCHANGE_check_keys_current (struct TALER_EXCHANGE_Handle *exchange,
|
||||
static void
|
||||
keys_completed_cb (void *cls,
|
||||
long response_code,
|
||||
const json_t *resp_obj)
|
||||
const void *resp_obj)
|
||||
{
|
||||
struct KeysRequest *kr = cls;
|
||||
struct TALER_EXCHANGE_Handle *exchange = kr->exchange;
|
||||
struct TALER_EXCHANGE_Keys kd;
|
||||
struct TALER_EXCHANGE_Keys kd_old;
|
||||
enum TALER_EXCHANGE_VersionCompatibility vc;
|
||||
const json_t *j = resp_obj;
|
||||
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||
"Received keys from URL `%s' with status %ld.\n",
|
||||
@ -863,7 +864,7 @@ keys_completed_cb (void *cls,
|
||||
exchange);
|
||||
return;
|
||||
case MHD_HTTP_OK:
|
||||
if (NULL == resp_obj)
|
||||
if (NULL == j)
|
||||
{
|
||||
response_code = 0;
|
||||
break;
|
||||
@ -902,7 +903,7 @@ keys_completed_cb (void *cls,
|
||||
}
|
||||
|
||||
if (GNUNET_OK !=
|
||||
decode_keys_json (resp_obj,
|
||||
decode_keys_json (j,
|
||||
GNUNET_YES,
|
||||
&kd,
|
||||
&vc))
|
||||
@ -927,7 +928,7 @@ keys_completed_cb (void *cls,
|
||||
break;
|
||||
}
|
||||
json_decref (exchange->key_data_raw);
|
||||
exchange->key_data_raw = json_deep_copy (resp_obj);
|
||||
exchange->key_data_raw = json_deep_copy (j);
|
||||
exchange->retry_delay = GNUNET_TIME_UNIT_ZERO;
|
||||
break;
|
||||
default:
|
||||
@ -1484,7 +1485,7 @@ request_keys (void *cls)
|
||||
kr->job = GNUNET_CURL_job_add (exchange->ctx,
|
||||
eh,
|
||||
GNUNET_NO,
|
||||
(GC_JCC) &keys_completed_cb,
|
||||
&keys_completed_cb,
|
||||
kr);
|
||||
exchange->kr = kr;
|
||||
}
|
||||
|
@ -158,14 +158,15 @@ verify_payback_signature_ok (const struct TALER_EXCHANGE_PaybackHandle *ph,
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_PaybackHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_payback_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_PaybackHandle *ph = cls;
|
||||
const json_t *j = response;
|
||||
|
||||
ph->job = NULL;
|
||||
switch (response_code)
|
||||
@ -175,7 +176,7 @@ handle_payback_finished (void *cls,
|
||||
case MHD_HTTP_OK:
|
||||
if (GNUNET_OK !=
|
||||
verify_payback_signature_ok (ph,
|
||||
json))
|
||||
j))
|
||||
{
|
||||
GNUNET_break_op (0);
|
||||
response_code = 0;
|
||||
@ -194,7 +195,7 @@ handle_payback_finished (void *cls,
|
||||
const struct TALER_EXCHANGE_DenomPublicKey *dki;
|
||||
|
||||
dki = ph->pk;
|
||||
history = json_object_get (json,
|
||||
history = json_object_get (j,
|
||||
"history");
|
||||
if (GNUNET_OK !=
|
||||
TALER_EXCHANGE_verify_coin_history (dki->fee_deposit.currency,
|
||||
@ -207,11 +208,11 @@ handle_payback_finished (void *cls,
|
||||
}
|
||||
ph->cb (ph->cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
&total,
|
||||
GNUNET_TIME_UNIT_FOREVER_ABS,
|
||||
NULL,
|
||||
json);
|
||||
j);
|
||||
TALER_EXCHANGE_payback_cancel (ph);
|
||||
return;
|
||||
}
|
||||
@ -243,11 +244,11 @@ handle_payback_finished (void *cls,
|
||||
}
|
||||
ph->cb (ph->cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
NULL,
|
||||
GNUNET_TIME_UNIT_FOREVER_ABS,
|
||||
NULL,
|
||||
json);
|
||||
j);
|
||||
TALER_EXCHANGE_payback_cancel (ph);
|
||||
}
|
||||
|
||||
@ -344,7 +345,7 @@ TALER_EXCHANGE_payback (struct TALER_EXCHANGE_Handle *exchange,
|
||||
ph->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
(GC_JCC) &handle_payback_finished,
|
||||
&handle_payback_finished,
|
||||
ph);
|
||||
return ph;
|
||||
}
|
||||
|
@ -1032,16 +1032,17 @@ verify_refresh_melt_signature_forbidden (struct TALER_EXCHANGE_RefreshMeltHandle
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_RefreshMeltHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_refresh_melt_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_RefreshMeltHandle *rmh = cls;
|
||||
uint32_t noreveal_index = TALER_CNC_KAPPA; /* invalid value */
|
||||
struct TALER_ExchangePublicKeyP exchange_pub;
|
||||
const json_t *j = response;
|
||||
|
||||
rmh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -1051,7 +1052,7 @@ handle_refresh_melt_finished (void *cls,
|
||||
case MHD_HTTP_OK:
|
||||
if (GNUNET_OK !=
|
||||
verify_refresh_melt_signature_ok (rmh,
|
||||
json,
|
||||
j,
|
||||
&exchange_pub,
|
||||
&noreveal_index))
|
||||
{
|
||||
@ -1062,10 +1063,10 @@ handle_refresh_melt_finished (void *cls,
|
||||
{
|
||||
rmh->melt_cb (rmh->melt_cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
noreveal_index,
|
||||
(0 == response_code) ? NULL : &exchange_pub,
|
||||
json);
|
||||
j);
|
||||
rmh->melt_cb = NULL;
|
||||
}
|
||||
break;
|
||||
@ -1077,7 +1078,7 @@ handle_refresh_melt_finished (void *cls,
|
||||
/* Double spending; check signatures on transaction history */
|
||||
if (GNUNET_OK !=
|
||||
verify_refresh_melt_signature_forbidden (rmh,
|
||||
json))
|
||||
j))
|
||||
{
|
||||
GNUNET_break_op (0);
|
||||
response_code = 0;
|
||||
@ -1108,10 +1109,10 @@ handle_refresh_melt_finished (void *cls,
|
||||
if (NULL != rmh->melt_cb)
|
||||
rmh->melt_cb (rmh->melt_cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
UINT32_MAX,
|
||||
NULL,
|
||||
json);
|
||||
j);
|
||||
TALER_EXCHANGE_refresh_melt_cancel (rmh);
|
||||
}
|
||||
|
||||
@ -1218,7 +1219,7 @@ TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange,
|
||||
rmh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
(GC_JCC) &handle_refresh_melt_finished,
|
||||
&handle_refresh_melt_finished,
|
||||
rmh);
|
||||
return rmh;
|
||||
}
|
||||
@ -1411,14 +1412,15 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshRevealHandle *rrh,
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_RefreshHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_refresh_reveal_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_RefreshRevealHandle *rrh = cls;
|
||||
const json_t *j = response;
|
||||
|
||||
rrh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -1433,7 +1435,7 @@ handle_refresh_reveal_finished (void *cls,
|
||||
|
||||
memset (sigs, 0, sizeof (sigs));
|
||||
ret = refresh_reveal_ok (rrh,
|
||||
json,
|
||||
j,
|
||||
coin_privs,
|
||||
sigs);
|
||||
if (GNUNET_OK != ret)
|
||||
@ -1448,7 +1450,7 @@ handle_refresh_reveal_finished (void *cls,
|
||||
rrh->md->num_fresh_coins,
|
||||
coin_privs,
|
||||
sigs,
|
||||
json);
|
||||
j);
|
||||
rrh->reveal_cb = NULL;
|
||||
}
|
||||
for (unsigned int i=0;i<rrh->md->num_fresh_coins;i++)
|
||||
@ -1481,11 +1483,11 @@ handle_refresh_reveal_finished (void *cls,
|
||||
if (NULL != rrh->reveal_cb)
|
||||
rrh->reveal_cb (rrh->reveal_cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
json);
|
||||
j);
|
||||
TALER_EXCHANGE_refresh_reveal_cancel (rrh);
|
||||
}
|
||||
|
||||
@ -1645,7 +1647,7 @@ TALER_EXCHANGE_refresh_reveal (struct TALER_EXCHANGE_Handle *exchange,
|
||||
rrh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
(GC_JCC) &handle_refresh_reveal_finished,
|
||||
&handle_refresh_reveal_finished,
|
||||
rrh);
|
||||
return rrh;
|
||||
}
|
||||
|
@ -301,14 +301,15 @@ parse_refresh_link_ok (struct TALER_EXCHANGE_RefreshLinkHandle *rlh,
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_RefreshLinkHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_refresh_link_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_RefreshLinkHandle *rlh = cls;
|
||||
const json_t *j = response;
|
||||
|
||||
rlh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -318,7 +319,7 @@ handle_refresh_link_finished (void *cls,
|
||||
case MHD_HTTP_OK:
|
||||
if (GNUNET_OK !=
|
||||
parse_refresh_link_ok (rlh,
|
||||
json))
|
||||
j))
|
||||
{
|
||||
GNUNET_break_op (0);
|
||||
response_code = 0;
|
||||
@ -348,12 +349,12 @@ handle_refresh_link_finished (void *cls,
|
||||
if (NULL != rlh->link_cb)
|
||||
rlh->link_cb (rlh->link_cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
json);
|
||||
j);
|
||||
TALER_EXCHANGE_refresh_link_cancel (rlh);
|
||||
}
|
||||
|
||||
@ -415,7 +416,7 @@ TALER_EXCHANGE_refresh_link (struct TALER_EXCHANGE_Handle *exchange,
|
||||
rlh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
(GC_JCC) &handle_refresh_link_finished,
|
||||
&handle_refresh_link_finished,
|
||||
rlh);
|
||||
return rlh;
|
||||
}
|
||||
|
@ -133,16 +133,17 @@ verify_refund_signature_ok (const struct TALER_EXCHANGE_RefundHandle *rh,
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_RefundHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_refund_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_RefundHandle *rh = cls;
|
||||
struct TALER_ExchangePublicKeyP exchange_pub;
|
||||
struct TALER_ExchangePublicKeyP *ep = NULL;
|
||||
const json_t *j = response;
|
||||
|
||||
rh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -152,7 +153,7 @@ handle_refund_finished (void *cls,
|
||||
case MHD_HTTP_OK:
|
||||
if (GNUNET_OK !=
|
||||
verify_refund_signature_ok (rh,
|
||||
json,
|
||||
j,
|
||||
&exchange_pub))
|
||||
{
|
||||
GNUNET_break_op (0);
|
||||
@ -203,9 +204,9 @@ handle_refund_finished (void *cls,
|
||||
}
|
||||
rh->cb (rh->cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
ep,
|
||||
json);
|
||||
j);
|
||||
TALER_EXCHANGE_refund_cancel (rh);
|
||||
}
|
||||
|
||||
@ -386,7 +387,7 @@ refund_obj = json_pack ("{s:o, s:o," /* amount/fee */
|
||||
rh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
(GC_JCC) &handle_refund_finished,
|
||||
&handle_refund_finished,
|
||||
rh);
|
||||
return rh;
|
||||
}
|
||||
|
@ -456,14 +456,15 @@ free_rhistory (struct TALER_EXCHANGE_ReserveHistory *rhistory,
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_ReserveStatusHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_reserve_status_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_ReserveStatusHandle *rsh = cls;
|
||||
const json_t *j = response;
|
||||
|
||||
rsh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -483,7 +484,7 @@ handle_reserve_status_finished (void *cls,
|
||||
};
|
||||
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_JSON_parse (json,
|
||||
GNUNET_JSON_parse (j,
|
||||
spec,
|
||||
NULL,
|
||||
NULL))
|
||||
@ -492,7 +493,7 @@ handle_reserve_status_finished (void *cls,
|
||||
response_code = 0;
|
||||
break;
|
||||
}
|
||||
history = json_object_get (json,
|
||||
history = json_object_get (j,
|
||||
"history");
|
||||
if (NULL == history)
|
||||
{
|
||||
@ -531,7 +532,7 @@ handle_reserve_status_finished (void *cls,
|
||||
rsh->cb (rsh->cb_cls,
|
||||
response_code,
|
||||
TALER_EC_NONE,
|
||||
json,
|
||||
j,
|
||||
&balance,
|
||||
len,
|
||||
rhistory);
|
||||
@ -567,8 +568,8 @@ handle_reserve_status_finished (void *cls,
|
||||
{
|
||||
rsh->cb (rsh->cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
json,
|
||||
TALER_JSON_get_error_code (j),
|
||||
j,
|
||||
NULL,
|
||||
0, NULL);
|
||||
rsh->cb = NULL;
|
||||
@ -631,7 +632,7 @@ TALER_EXCHANGE_reserve_status (struct TALER_EXCHANGE_Handle *exchange,
|
||||
rsh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_NO,
|
||||
(GC_JCC) &handle_reserve_status_finished,
|
||||
&handle_reserve_status_finished,
|
||||
rsh);
|
||||
return rsh;
|
||||
}
|
||||
@ -891,14 +892,15 @@ reserve_withdraw_payment_required (struct TALER_EXCHANGE_ReserveWithdrawHandle *
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_ReserveWithdrawHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_reserve_withdraw_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_ReserveWithdrawHandle *wsh = cls;
|
||||
const json_t *j = response;
|
||||
|
||||
wsh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -908,7 +910,7 @@ handle_reserve_withdraw_finished (void *cls,
|
||||
case MHD_HTTP_OK:
|
||||
if (GNUNET_OK !=
|
||||
reserve_withdraw_ok (wsh,
|
||||
json))
|
||||
j))
|
||||
{
|
||||
GNUNET_break_op (0);
|
||||
response_code = 0;
|
||||
@ -923,7 +925,7 @@ handle_reserve_withdraw_finished (void *cls,
|
||||
check the signatures in the history... */
|
||||
if (GNUNET_OK !=
|
||||
reserve_withdraw_payment_required (wsh,
|
||||
json))
|
||||
j))
|
||||
{
|
||||
GNUNET_break_op (0);
|
||||
response_code = 0;
|
||||
@ -958,9 +960,9 @@ handle_reserve_withdraw_finished (void *cls,
|
||||
{
|
||||
wsh->cb (wsh->cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
NULL,
|
||||
json);
|
||||
j);
|
||||
wsh->cb = NULL;
|
||||
}
|
||||
TALER_EXCHANGE_reserve_withdraw_cancel (wsh);
|
||||
@ -1039,7 +1041,7 @@ reserve_withdraw_internal (struct TALER_EXCHANGE_Handle *exchange,
|
||||
wsh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
(GC_JCC) &handle_reserve_withdraw_finished,
|
||||
&handle_reserve_withdraw_finished,
|
||||
wsh);
|
||||
return wsh;
|
||||
}
|
||||
|
@ -134,12 +134,12 @@ verify_deposit_wtid_signature_ok (const struct TALER_EXCHANGE_TrackTransactionHa
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_TrackTransactionHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_deposit_wtid_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_TrackTransactionHandle *dwh = cls;
|
||||
const struct TALER_WireTransferIdentifierRawP *wtid = NULL;
|
||||
@ -148,6 +148,7 @@ handle_deposit_wtid_finished (void *cls,
|
||||
struct TALER_Amount coin_contribution_s;
|
||||
struct TALER_ExchangePublicKeyP exchange_pub;
|
||||
struct TALER_ExchangePublicKeyP *ep = NULL;
|
||||
const json_t *j = response;
|
||||
|
||||
dwh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -164,7 +165,7 @@ handle_deposit_wtid_finished (void *cls,
|
||||
};
|
||||
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_JSON_parse (json,
|
||||
GNUNET_JSON_parse (j,
|
||||
spec,
|
||||
NULL, NULL))
|
||||
{
|
||||
@ -179,7 +180,7 @@ handle_deposit_wtid_finished (void *cls,
|
||||
coin_contribution = &coin_contribution_s;
|
||||
if (GNUNET_OK !=
|
||||
verify_deposit_wtid_signature_ok (dwh,
|
||||
json,
|
||||
j,
|
||||
&exchange_pub))
|
||||
{
|
||||
GNUNET_break_op (0);
|
||||
@ -200,7 +201,7 @@ handle_deposit_wtid_finished (void *cls,
|
||||
};
|
||||
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_JSON_parse (json,
|
||||
GNUNET_JSON_parse (j,
|
||||
spec,
|
||||
NULL, NULL))
|
||||
{
|
||||
@ -238,9 +239,9 @@ handle_deposit_wtid_finished (void *cls,
|
||||
}
|
||||
dwh->cb (dwh->cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
ep,
|
||||
json,
|
||||
j,
|
||||
wtid,
|
||||
execution_time,
|
||||
coin_contribution);
|
||||
@ -337,7 +338,7 @@ TALER_EXCHANGE_track_transaction (struct TALER_EXCHANGE_Handle *exchange,
|
||||
dwh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
(GC_JCC) &handle_deposit_wtid_finished,
|
||||
&handle_deposit_wtid_finished,
|
||||
dwh);
|
||||
return dwh;
|
||||
}
|
||||
|
@ -248,14 +248,15 @@ check_track_transfer_response_ok (struct TALER_EXCHANGE_TrackTransferHandle *wdh
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_TrackTransferHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_track_transfer_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_TrackTransferHandle *wdh = cls;
|
||||
const json_t *j = response;
|
||||
|
||||
wdh->job = NULL;
|
||||
switch (response_code)
|
||||
@ -265,7 +266,7 @@ handle_track_transfer_finished (void *cls,
|
||||
case MHD_HTTP_OK:
|
||||
if (GNUNET_OK ==
|
||||
check_track_transfer_response_ok (wdh,
|
||||
json))
|
||||
j))
|
||||
return;
|
||||
GNUNET_break_op (0);
|
||||
response_code = 0;
|
||||
@ -298,9 +299,9 @@ handle_track_transfer_finished (void *cls,
|
||||
}
|
||||
wdh->cb (wdh->cb_cls,
|
||||
response_code,
|
||||
TALER_JSON_get_error_code (json),
|
||||
TALER_JSON_get_error_code (j),
|
||||
NULL,
|
||||
json,
|
||||
j,
|
||||
NULL,
|
||||
GNUNET_TIME_UNIT_ZERO_ABS,
|
||||
NULL,
|
||||
@ -359,7 +360,7 @@ TALER_EXCHANGE_track_transfer (struct TALER_EXCHANGE_Handle *exchange,
|
||||
wdh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
(GC_JCC) &handle_track_transfer_finished,
|
||||
&handle_track_transfer_finished,
|
||||
wdh);
|
||||
return wdh;
|
||||
}
|
||||
|
@ -202,15 +202,16 @@ lookup_fee (const struct FeeMap *fm,
|
||||
*
|
||||
* @param cls the `struct TALER_EXCHANGE_WireHandle`
|
||||
* @param response_code HTTP response code, 0 on error
|
||||
* @param json parsed JSON result, NULL on error
|
||||
* @param response parsed JSON result, NULL on error
|
||||
*/
|
||||
static void
|
||||
handle_wire_finished (void *cls,
|
||||
long response_code,
|
||||
const json_t *json)
|
||||
const void *response)
|
||||
{
|
||||
struct TALER_EXCHANGE_WireHandle *wh = cls;
|
||||
enum TALER_ErrorCode ec;
|
||||
const json_t *j = response;
|
||||
|
||||
wh->job = NULL;
|
||||
ec = TALER_EC_NONE;
|
||||
@ -232,7 +233,7 @@ handle_wire_finished (void *cls,
|
||||
};
|
||||
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_JSON_parse (json,
|
||||
GNUNET_JSON_parse (j,
|
||||
spec,
|
||||
NULL, NULL))
|
||||
{
|
||||
@ -359,7 +360,7 @@ handle_wire_finished (void *cls,
|
||||
if (NULL != wh->cb)
|
||||
wh->cb (wh->cb_cls,
|
||||
response_code,
|
||||
(0 == response_code) ? ec : TALER_JSON_get_error_code (json),
|
||||
(0 == response_code) ? ec : TALER_JSON_get_error_code (j),
|
||||
0,
|
||||
NULL);
|
||||
TALER_EXCHANGE_wire_cancel (wh);
|
||||
@ -412,7 +413,7 @@ TALER_EXCHANGE_wire (struct TALER_EXCHANGE_Handle *exchange,
|
||||
wh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
(GC_JCC) &handle_wire_finished,
|
||||
&handle_wire_finished,
|
||||
wh);
|
||||
return wh;
|
||||
}
|
||||
|
@ -37,12 +37,6 @@
|
||||
"JSON parsing failed at %s:%u: %s (%s)\n", \
|
||||
__FILE__, __LINE__, error.text, error.source)
|
||||
|
||||
|
||||
/**
|
||||
* A shorter name to make type casts less verbose.
|
||||
*/
|
||||
typedef GNUNET_CURL_JobCompletionCallback GC_JCC;
|
||||
|
||||
/**
|
||||
* Convert a TALER amount to a JSON object.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user