From fd91a6adede7af1f477f8858a7109351d9899417 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 25 Nov 2020 21:19:13 +0100 Subject: implement first new client API --- src/lib/exchange_api_management_wire_disable.c | 40 ++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'src/lib/exchange_api_management_wire_disable.c') diff --git a/src/lib/exchange_api_management_wire_disable.c b/src/lib/exchange_api_management_wire_disable.c index c51b350e3..05d4832f4 100644 --- a/src/lib/exchange_api_management_wire_disable.c +++ b/src/lib/exchange_api_management_wire_disable.c @@ -29,7 +29,34 @@ /** * @brief Handle for a POST /management/wire/disable request. */ -struct TALER_EXCHANGE_ManagementWireDisableHandle; +struct TALER_EXCHANGE_ManagementWireDisableHandle +{ + + /** + * The url for this request. + */ + char *url; + + /** + * Handle for the request. + */ + struct GNUNET_CURL_Job *job; + + /** + * Function to call with the result. + */ + TALER_EXCHANGE_ManagementWireDisableCallback cb; + + /** + * Closure for @a cb. + */ + void *cb_cls; + + /** + * Reference to the execution context. + */ + struct GNUNET_CURL_Context *ctx; +}; /** @@ -62,4 +89,13 @@ TALER_EXCHANGE_management_disable_wire ( */ void TALER_EXCHANGE_management_disable_wire_cancel ( - struct TALER_EXCHANGE_ManagementWireDisableHandle *wh); + struct TALER_EXCHANGE_ManagementWireDisableHandle *wh) +{ + if (NULL != wh->job) + { + GNUNET_CURL_job_cancel (wh->job); + wh->job = NULL; + } + GNUNET_free (wh->url); + GNUNET_free (wh); +} -- cgit v1.2.3