summaryrefslogtreecommitdiff
path: root/src/lib/auditor_api_deposit_confirmation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-03 17:14:00 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-03 17:14:00 +0100
commita9b3c564bdd80ad6d3db0d0c493144956c64368d (patch)
tree0d6b2e480eb87802f26d2c323d07d8a89b8f7268 /src/lib/auditor_api_deposit_confirmation.c
parent97fb6b0091ca089b997febf691be2038223a8d21 (diff)
downloadexchange-a9b3c564bdd80ad6d3db0d0c493144956c64368d.tar.gz
exchange-a9b3c564bdd80ad6d3db0d0c493144956c64368d.tar.bz2
exchange-a9b3c564bdd80ad6d3db0d0c493144956c64368d.zip
rename BANK_excecute_wire_transfer to BANK_transfer, improve error handling when curl_easy_init() fails
Diffstat (limited to 'src/lib/auditor_api_deposit_confirmation.c')
-rw-r--r--src/lib/auditor_api_deposit_confirmation.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/lib/auditor_api_deposit_confirmation.c b/src/lib/auditor_api_deposit_confirmation.c
index 54a99c719..ddaf9b7cd 100644
--- a/src/lib/auditor_api_deposit_confirmation.c
+++ b/src/lib/auditor_api_deposit_confirmation.c
@@ -290,7 +290,7 @@ TALER_AUDITOR_deposit_confirmation (struct TALER_AUDITOR_Handle *auditor,
(void) GNUNET_TIME_round_abs (&ep_expire);
(void) GNUNET_TIME_round_abs (&ep_end);
GNUNET_assert (GNUNET_YES ==
- MAH_handle_is_ready (auditor));
+ TALER_AUDITOR_handle_is_ready_ (auditor));
if (GNUNET_OK !=
verify_signatures (h_wire,
h_contract_terms,
@@ -346,20 +346,23 @@ TALER_AUDITOR_deposit_confirmation (struct TALER_AUDITOR_Handle *auditor,
dh->auditor = auditor;
dh->cb = cb;
dh->cb_cls = cb_cls;
- dh->url = MAH_path_to_url (auditor, "/deposit-confirmation");
+ dh->url = TALER_AUDITOR_path_to_url_ (auditor,
+ "/deposit-confirmation");
+ eh = TALER_AUDITOR_curl_easy_get_ (dh->url);
- eh = TAL_curl_easy_get (dh->url);
- GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (eh,
- CURLOPT_CUSTOMREQUEST,
- "PUT"));
- if (GNUNET_OK !=
- TALER_curl_easy_post (&dh->ctx,
- eh,
- deposit_confirmation_obj))
+ if ( (NULL == eh) ||
+ (CURLE_OK !=
+ curl_easy_setopt (eh,
+ CURLOPT_CUSTOMREQUEST,
+ "PUT")) ||
+ (GNUNET_OK !=
+ TALER_curl_easy_post (&dh->ctx,
+ eh,
+ deposit_confirmation_obj)) )
{
GNUNET_break (0);
- curl_easy_cleanup (eh);
+ if (NULL != eh)
+ curl_easy_cleanup (eh);
json_decref (deposit_confirmation_obj);
GNUNET_free (dh->url);
GNUNET_free (dh);
@@ -369,7 +372,7 @@ TALER_AUDITOR_deposit_confirmation (struct TALER_AUDITOR_Handle *auditor,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"URL for deposit-confirmation: `%s'\n",
dh->url);
- ctx = MAH_handle_to_context (auditor);
+ ctx = TALER_AUDITOR_handle_to_context_ (auditor);
dh->job = GNUNET_CURL_job_add2 (ctx,
eh,
dh->ctx.headers,