diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-06-22 20:26:34 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-06-22 20:26:34 +0200 |
commit | 7bb95475994504fa56902159be4f4789a3793a38 (patch) | |
tree | b13ca4cf313de4eba6bdd7f82e36228c82f958df /src/lib | |
parent | 22d5b9fc3a304b89c05e4493d8bb10cef6a38134 (diff) | |
download | exchange-7bb95475994504fa56902159be4f4789a3793a38.tar.xz |
more API cleanup
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/exchange_api_reserves_get.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/lib/exchange_api_reserves_get.c b/src/lib/exchange_api_reserves_get.c index 1c2c2b027..733540235 100644 --- a/src/lib/exchange_api_reserves_get.c +++ b/src/lib/exchange_api_reserves_get.c @@ -39,11 +39,6 @@ struct TALER_EXCHANGE_ReservesGetHandle { /** - * The connection to exchange this request handle will use - */ - struct TALER_EXCHANGE_Handle *exchange; - - /** * The url for this request. */ char *url; @@ -186,23 +181,17 @@ handle_reserves_get_finished (void *cls, struct TALER_EXCHANGE_ReservesGetHandle * TALER_EXCHANGE_reserves_get ( - struct TALER_EXCHANGE_Handle *exchange, + struct GNUNET_CURL_Context *ctx, + const char *url, const struct TALER_ReservePublicKeyP *reserve_pub, struct GNUNET_TIME_Relative timeout, TALER_EXCHANGE_ReservesGetCallback cb, void *cb_cls) { struct TALER_EXCHANGE_ReservesGetHandle *rgh; - struct GNUNET_CURL_Context *ctx; CURL *eh; char arg_str[sizeof (struct TALER_ReservePublicKeyP) * 2 + 16 + 32]; - if (GNUNET_YES != - TEAH_handle_is_ready (exchange)) - { - GNUNET_break (0); - return NULL; - } { char pub_str[sizeof (struct TALER_ReservePublicKeyP) * 2]; char *end; @@ -223,22 +212,21 @@ TALER_EXCHANGE_reserves_get ( if (GNUNET_TIME_relative_is_zero (timeout)) GNUNET_snprintf (arg_str, sizeof (arg_str), - "/reserves/%s", + "reserves/%s", pub_str); else GNUNET_snprintf (arg_str, sizeof (arg_str), - "/reserves/%s?timeout_ms=%s", + "reserves/%s?timeout_ms=%s", pub_str, timeout_str); } rgh = GNUNET_new (struct TALER_EXCHANGE_ReservesGetHandle); - rgh->exchange = exchange; rgh->cb = cb; rgh->cb_cls = cb_cls; rgh->reserve_pub = *reserve_pub; - rgh->url = TEAH_path_to_url (exchange, - arg_str); + rgh->url = TALER_url_join (url, + arg_str); if (NULL == rgh->url) { GNUNET_free (rgh); @@ -252,7 +240,6 @@ TALER_EXCHANGE_reserves_get ( GNUNET_free (rgh); return NULL; } - ctx = TEAH_handle_to_context (exchange); rgh->job = GNUNET_CURL_job_add (ctx, eh, &handle_reserves_get_finished, |