aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-06-21 18:47:42 +0200
committerChristian Grothoff <christian@grothoff.org>2015-06-21 18:47:42 +0200
commitbba46ca85a0b9871d8c635b63acdc3051d3f37f9 (patch)
treef75e6e8465bdd63e94fd731ed2f171586944eddb
parentd5e581b5e61a706c83778fa493bf4c9e80f228b0 (diff)
compile mint_api_deposit.c
-rw-r--r--src/mint-lib/Makefile.am3
-rw-r--r--src/mint-lib/mint_api_deposit.c25
2 files changed, 21 insertions, 7 deletions
diff --git a/src/mint-lib/Makefile.am b/src/mint-lib/Makefile.am
index ac538392f..e7a3fa316 100644
--- a/src/mint-lib/Makefile.am
+++ b/src/mint-lib/Makefile.am
@@ -16,7 +16,8 @@ libtalermint_la_LDFLAGS = \
libtalermint_la_SOURCES = \
mint_api_context.c mint_api_context.h \
mint_api_json.c mint_api_json.h \
- mint_api_handle.c mint_api_handle.h
+ mint_api_handle.c mint_api_handle.h \
+ mint_api_deposit.c
libtalermint_la_LIBADD = \
-lgnunetutil \
diff --git a/src/mint-lib/mint_api_deposit.c b/src/mint-lib/mint_api_deposit.c
index 87a12448f..90a98e45e 100644
--- a/src/mint-lib/mint_api_deposit.c
+++ b/src/mint-lib/mint_api_deposit.c
@@ -25,10 +25,21 @@
#include <jansson.h>
#include <gnunet/gnunet_util_lib.h>
#include "taler_mint_service.h"
+#include "mint_api_context.h"
+#include "mint_api_handle.h"
#include "taler_signatures.h"
/**
+ * Print JSON parsing related error information
+ */
+#define JSON_WARN(error) \
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \
+ "JSON parsing failed at %s:%u: %s (%s)", \
+ __FILE__, __LINE__, error.text, error.source)
+
+
+/**
* @brief A Deposit Handle
*/
struct TALER_MINT_DepositHandle
@@ -241,7 +252,9 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint,
}
GNUNET_break (0); /* FIXME: verify all sigs! */
- deposit_obj = json_new (); /* FIXME: actually build JSON request */
+ /* FIXME: actually build JSON request */
+ deposit_obj = json_pack ("{s:s}",
+ "hello", "world");
dh = GNUNET_new (struct TALER_MINT_DepositHandle);
dh->mint = mint;
@@ -266,13 +279,13 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint,
CURLOPT_POSTFIELDSIZE,
strlen (dh->json_enc)));
GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (c,
+ curl_easy_setopt (eh,
CURLOPT_WRITEFUNCTION,
- &keys_download_cb));
+ &deposit_download_cb));
GNUNET_assert (CURLE_OK ==
- curl_easy_setopt (c,
+ curl_easy_setopt (eh,
CURLOPT_WRITEDATA,
- kr));
+ dh));
GNUNET_assert (NULL != (dh->headers =
curl_slist_append (dh->headers,
"Content-Type: application/json")));
@@ -283,7 +296,7 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint,
ctx = MAH_handle_to_context (mint);
dh->job = MAC_job_add (ctx,
eh,
- &handle_deposit_reply,
+ &handle_deposit_finished,
dh);
return dh;
}