aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-16 15:14:18 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-16 15:14:18 +0100
commit3553e60733e4ad2c71a3daa4148182443958dd04 (patch)
tree1e459582f8e01a7cfca4e52f9d1aa82db327d3cd
parent17865db5fc19e768200fabee5aa173106d96507b (diff)
downloadexchange-3553e60733e4ad2c71a3daa4148182443958dd04.tar.gz
exchange-3553e60733e4ad2c71a3daa4148182443958dd04.tar.bz2
exchange-3553e60733e4ad2c71a3daa4148182443958dd04.zip
remarks on deposit issues
-rw-r--r--src/mint/taler-mint-httpd_deposit.c7
-rw-r--r--src/mint/taler-mint-httpd_parsing.c6
-rw-r--r--src/mint/taler-mint-httpd_parsing.h13
3 files changed, 15 insertions, 11 deletions
diff --git a/src/mint/taler-mint-httpd_deposit.c b/src/mint/taler-mint-httpd_deposit.c
index eaced51c2..7c19e060e 100644
--- a/src/mint/taler-mint-httpd_deposit.c
+++ b/src/mint/taler-mint-httpd_deposit.c
@@ -44,6 +44,7 @@
* @param deposit deposit request to confirm
* @return MHD result code
*/
+// FIXME: this should be in taler-mint-httpd_responses.c
static int
helper_deposit_send_response_success (struct MHD_Connection *connection,
struct Deposit *deposit)
@@ -108,7 +109,7 @@ TALER_MINT_handler_deposit (struct RequestHandler *rh,
wire = NULL;
resp = NULL;
if (-1 == json_unpack (json,
- "{s:s s:o}",
+ "{s:s, s:o}",
"type", &deposit_type,
"wire", &wire))
{
@@ -117,7 +118,7 @@ TALER_MINT_handler_deposit (struct RequestHandler *rh,
resp_code = MHD_HTTP_BAD_REQUEST;
goto EXITIF_exit;
}
- if (NULL == (wire_enc = json_dumps (wire, JSON_COMPACT|JSON_SORT_KEYS)))
+ if (NULL == (wire_enc = json_dumps (wire, JSON_COMPACT | JSON_SORT_KEYS)))
{
GNUNET_break_op (0);
resp = json_pack ("{s:s}", "error", "Bad format");
@@ -130,6 +131,8 @@ TALER_MINT_handler_deposit (struct RequestHandler *rh,
do { \
if (cond) { GNUNET_break (0); goto EXITIF_exit; } \
} while (0)
+ // FIXME: need to distinguish between _OK and _NO return values here,
+ // and never try to queue our own!
#define PARSE_DATA(field, addr) \
EXITIF (GNUNET_OK != \
GNUNET_MINT_parse_navigate_json \
diff --git a/src/mint/taler-mint-httpd_parsing.c b/src/mint/taler-mint-httpd_parsing.c
index 550a89224..f61049b5e 100644
--- a/src/mint/taler-mint-httpd_parsing.c
+++ b/src/mint/taler-mint-httpd_parsing.c
@@ -268,7 +268,7 @@ TALER_MINT_parse_post_cleanup_callback (void *con_cls)
*
* @param connection the connection to send an error response to
* @param root the JSON node to start the navigation at.
- * @param ... navigation specification (see JNAV_*)
+ * @param ... navigation specification (see `enum TALER_MINT_JsonNavigationCommand`)
* @return GNUNET_YES if navigation was successful
* GNUNET_NO if json is malformed, error response was generated
* GNUNET_SYSERR on internal error (no response was generated,
@@ -276,8 +276,8 @@ TALER_MINT_parse_post_cleanup_callback (void *con_cls)
*/
int
GNUNET_MINT_parse_navigate_json (struct MHD_Connection *connection,
- const json_t *root,
- ...)
+ const json_t *root,
+ ...)
{
va_list argp;
int ret;
diff --git a/src/mint/taler-mint-httpd_parsing.h b/src/mint/taler-mint-httpd_parsing.h
index a03f2b62d..a278eb705 100644
--- a/src/mint/taler-mint-httpd_parsing.h
+++ b/src/mint/taler-mint-httpd_parsing.h
@@ -122,14 +122,15 @@ enum TALER_MINT_JsonNavigationCommand
*
* @param connection the connection to send an error response to
* @param root the JSON node to start the navigation at.
- * @param ... navigation specification (see JNAV_*)
+ * @param ... navigation specification (see `enum TALER_MINT_JsonNavigationCommand`)
* @return GNUNET_YES if navigation was successful
* GNUNET_NO if json is malformed, error response was generated
* GNUNET_SYSERR on internal error
*/
int
GNUNET_MINT_parse_navigate_json (struct MHD_Connection *connection,
- const json_t *root, ...);
+ const json_t *root,
+ ...);
@@ -143,7 +144,7 @@ GNUNET_MINT_parse_navigate_json (struct MHD_Connection *connection,
* @param connection the MHD connection
* @param param_name the name of the parameter with the key
* @param[out] out_data pointer to store the result
- * @param out_size expected size of data
+ * @param out_size expected size of @a out_data
* @return
* GNUNET_YES if the the argument is present
* GNUNET_NO if the argument is absent or malformed
@@ -151,9 +152,9 @@ GNUNET_MINT_parse_navigate_json (struct MHD_Connection *connection,
*/
int
TALER_MINT_mhd_request_arg_data (struct MHD_Connection *connection,
- const char *param_name,
- void *out_data,
- size_t out_size);
+ const char *param_name,
+ void *out_data,
+ size_t out_size);