diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-06-21 08:02:36 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-06-21 08:02:36 +0200 |
commit | a37a8d34d54cd91fba321a225ae626e8594c6a48 (patch) | |
tree | 4403bc4b76adb2974d15e1b33d6a6dfe7e443823 /src/lib | |
parent | 17789253e9194c66bb9ddb081425a35212ac7bf3 (diff) | |
download | exchange-a37a8d34d54cd91fba321a225ae626e8594c6a48.tar.xz |
-towards API atomization
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/auditor_api_exchanges.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/lib/auditor_api_exchanges.c b/src/lib/auditor_api_exchanges.c index 9f35c7077..8acf59467 100644 --- a/src/lib/auditor_api_exchanges.c +++ b/src/lib/auditor_api_exchanges.c @@ -45,11 +45,6 @@ struct TALER_AUDITOR_ListExchangesHandle { /** - * The connection to auditor this request handle will use - */ - struct TALER_AUDITOR_Handle *auditor; - - /** * The url for this request. */ char *url; @@ -122,14 +117,15 @@ handle_exchanges_finished (void *cls, } { struct TALER_AUDITOR_ExchangeInfo ei[GNUNET_NZL (ja_len)]; - bool ok; + bool ok = true; - ok = true; for (unsigned int i = 0; i<ja_len; i++) { struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_fixed_auto ("master_pub", &ei[i].master_pub), - GNUNET_JSON_spec_string ("exchange_url", &ei[i].exchange_url), + GNUNET_JSON_spec_fixed_auto ("master_pub", + &ei[i].master_pub), + GNUNET_JSON_spec_string ("exchange_url", + &ei[i].exchange_url), GNUNET_JSON_spec_end () }; @@ -192,23 +188,20 @@ handle_exchanges_finished (void *cls, struct TALER_AUDITOR_ListExchangesHandle * -TALER_AUDITOR_list_exchanges (struct TALER_AUDITOR_Handle *auditor, +TALER_AUDITOR_list_exchanges (struct GNUNET_CURL_Context *ctx, + const char *url, TALER_AUDITOR_ListExchangesResultCallback cb, void *cb_cls) { struct TALER_AUDITOR_ListExchangesHandle *leh; - struct GNUNET_CURL_Context *ctx; CURL *eh; - GNUNET_assert (GNUNET_YES == - TALER_AUDITOR_handle_is_ready_ (auditor)); - leh = GNUNET_new (struct TALER_AUDITOR_ListExchangesHandle); - leh->auditor = auditor; leh->cb = cb; leh->cb_cls = cb_cls; - leh->url = TALER_AUDITOR_path_to_url_ (auditor, - "/exchanges"); + leh->url = TALER_url_join (url, + "exchanges", + NULL); if (NULL == leh->url) { GNUNET_free (leh); @@ -225,7 +218,6 @@ TALER_AUDITOR_list_exchanges (struct TALER_AUDITOR_Handle *auditor, GNUNET_free (leh); return NULL; } - ctx = TALER_AUDITOR_handle_to_context_ (auditor); leh->job = GNUNET_CURL_job_add (ctx, eh, &handle_exchanges_finished, |