remarks on deposit issues

This commit is contained in:
Christian Grothoff 2015-01-16 15:14:18 +01:00
parent 17865db5fc
commit 3553e60733
3 changed files with 15 additions and 11 deletions

View File

@ -44,6 +44,7 @@
* @param deposit deposit request to confirm * @param deposit deposit request to confirm
* @return MHD result code * @return MHD result code
*/ */
// FIXME: this should be in taler-mint-httpd_responses.c
static int static int
helper_deposit_send_response_success (struct MHD_Connection *connection, helper_deposit_send_response_success (struct MHD_Connection *connection,
struct Deposit *deposit) struct Deposit *deposit)
@ -108,7 +109,7 @@ TALER_MINT_handler_deposit (struct RequestHandler *rh,
wire = NULL; wire = NULL;
resp = NULL; resp = NULL;
if (-1 == json_unpack (json, if (-1 == json_unpack (json,
"{s:s s:o}", "{s:s, s:o}",
"type", &deposit_type, "type", &deposit_type,
"wire", &wire)) "wire", &wire))
{ {
@ -117,7 +118,7 @@ TALER_MINT_handler_deposit (struct RequestHandler *rh,
resp_code = MHD_HTTP_BAD_REQUEST; resp_code = MHD_HTTP_BAD_REQUEST;
goto EXITIF_exit; 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); GNUNET_break_op (0);
resp = json_pack ("{s:s}", "error", "Bad format"); resp = json_pack ("{s:s}", "error", "Bad format");
@ -130,6 +131,8 @@ TALER_MINT_handler_deposit (struct RequestHandler *rh,
do { \ do { \
if (cond) { GNUNET_break (0); goto EXITIF_exit; } \ if (cond) { GNUNET_break (0); goto EXITIF_exit; } \
} while (0) } 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) \ #define PARSE_DATA(field, addr) \
EXITIF (GNUNET_OK != \ EXITIF (GNUNET_OK != \
GNUNET_MINT_parse_navigate_json \ GNUNET_MINT_parse_navigate_json \

View File

@ -268,7 +268,7 @@ TALER_MINT_parse_post_cleanup_callback (void *con_cls)
* *
* @param connection the connection to send an error response to * @param connection the connection to send an error response to
* @param root the JSON node to start the navigation at. * @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 * @return GNUNET_YES if navigation was successful
* GNUNET_NO if json is malformed, error response was generated * GNUNET_NO if json is malformed, error response was generated
* GNUNET_SYSERR on internal error (no response was generated, * GNUNET_SYSERR on internal error (no response was generated,

View File

@ -122,14 +122,15 @@ enum TALER_MINT_JsonNavigationCommand
* *
* @param connection the connection to send an error response to * @param connection the connection to send an error response to
* @param root the JSON node to start the navigation at. * @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 * @return GNUNET_YES if navigation was successful
* GNUNET_NO if json is malformed, error response was generated * GNUNET_NO if json is malformed, error response was generated
* GNUNET_SYSERR on internal error * GNUNET_SYSERR on internal error
*/ */
int int
GNUNET_MINT_parse_navigate_json (struct MHD_Connection *connection, 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 connection the MHD connection
* @param param_name the name of the parameter with the key * @param param_name the name of the parameter with the key
* @param[out] out_data pointer to store the result * @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 * @return
* GNUNET_YES if the the argument is present * GNUNET_YES if the the argument is present
* GNUNET_NO if the argument is absent or malformed * GNUNET_NO if the argument is absent or malformed