summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_management_post_keys.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-11-25 21:19:13 +0100
committerChristian Grothoff <christian@grothoff.org>2020-11-25 21:19:13 +0100
commitfd91a6adede7af1f477f8858a7109351d9899417 (patch)
tree4845cc9411576a99bbc2ac75e95b78150ed1c692 /src/lib/exchange_api_management_post_keys.c
parent87bc48f5138e65f900d581e902c8f6f07cdd0a6c (diff)
downloadexchange-fd91a6adede7af1f477f8858a7109351d9899417.tar.gz
exchange-fd91a6adede7af1f477f8858a7109351d9899417.tar.bz2
exchange-fd91a6adede7af1f477f8858a7109351d9899417.zip
implement first new client API
Diffstat (limited to 'src/lib/exchange_api_management_post_keys.c')
-rw-r--r--src/lib/exchange_api_management_post_keys.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/lib/exchange_api_management_post_keys.c b/src/lib/exchange_api_management_post_keys.c
index fe8131b1d..7cbf27b31 100644
--- a/src/lib/exchange_api_management_post_keys.c
+++ b/src/lib/exchange_api_management_post_keys.c
@@ -29,7 +29,34 @@
/**
* @brief Handle for a POST /management/keys request.
*/
-struct TALER_EXCHANGE_ManagementPostKeysHandle;
+struct TALER_EXCHANGE_ManagementPostKeysHandle
+{
+
+ /**
+ * The url for this request.
+ */
+ char *url;
+
+ /**
+ * Handle for the request.
+ */
+ struct GNUNET_CURL_Job *job;
+
+ /**
+ * Function to call with the result.
+ */
+ TALER_EXCHANGE_ManagementGetKeysCallback cb;
+
+ /**
+ * Closure for @a cb.
+ */
+ void *cb_cls;
+
+ /**
+ * Reference to the execution context.
+ */
+ struct GNUNET_CURL_Context *ctx;
+};
/**
@@ -57,4 +84,13 @@ TALER_EXCHANGE_post_management_keys (
*/
void
TALER_EXCHANGE_post_management_keys_cancel (
- struct TALER_EXCHANGE_ManagementPostKeysHandle *ph);
+ struct TALER_EXCHANGE_ManagementPostKeysHandle *ph)
+{
+ if (NULL != ph->job)
+ {
+ GNUNET_CURL_job_cancel (ph->job);
+ ph->job = NULL;
+ }
+ GNUNET_free (ph->url);
+ GNUNET_free (ph);
+}