From a9ae2171b897dfc9635e9ab72a04d65379bf2208 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 16 Jan 2020 21:57:40 +0100 Subject: reuse TALER_url_join --- src/bank-lib/bank_api_credit.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/bank-lib/bank_api_credit.c') diff --git a/src/bank-lib/bank_api_credit.c b/src/bank-lib/bank_api_credit.c index be4c1972e..95e91d7db 100644 --- a/src/bank-lib/bank_api_credit.c +++ b/src/bank-lib/bank_api_credit.c @@ -257,19 +257,27 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx, ( (0 == start_row) && (0 < num_results) ) ) GNUNET_asprintf (&url, - "/history/incoming?delta=%lld", + "history/incoming?delta=%lld", (long long) num_results); else GNUNET_asprintf (&url, - "/history/incoming?delta=%lld&start=%llu", + "history/incoming?delta=%lld&start=%llu", (long long) num_results, start_row); hh = GNUNET_new (struct TALER_BANK_CreditHistoryHandle); hh->hcb = hres_cb; hh->hcb_cls = hres_cb_cls; + hh->request_url = TALER_url_join (bank_base_url, + url, + NULL); + GNUNET_free (url); + if (NULL == hh->request_url) + { + GNUNET_free (hh); + GNUNET_break (0); + return NULL; + } hh->bank_base_url = GNUNET_strdup (bank_base_url); - hh->request_url = TALER_BANK_path_to_url_ (bank_base_url, - url); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Requesting history at `%s'\n", hh->request_url); @@ -285,7 +293,6 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx, GNUNET_break (0); TALER_BANK_credit_history_cancel (hh); curl_easy_cleanup (eh); - GNUNET_free (url); return NULL; } hh->job = GNUNET_CURL_job_add2 (ctx, @@ -293,7 +300,6 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx, NULL, &handle_history_finished, hh); - GNUNET_free (url); return hh; } -- cgit v1.2.3