diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-09-18 22:11:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-09-18 22:11:28 +0200 |
commit | dfe576f9379954ab8164da7521bef930d3af3948 (patch) | |
tree | b7fffe7cfc8767df6b672ccfd08614b550352f1c /src/mhd | |
parent | 12cff1b4439ab5dcc26fcf79e19518ae1bdce069 (diff) |
more work on new history logic
Diffstat (limited to 'src/mhd')
-rw-r--r-- | src/mhd/mhd_parsing.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mhd/mhd_parsing.c b/src/mhd/mhd_parsing.c index b1f8417e4..381b064fa 100644 --- a/src/mhd/mhd_parsing.c +++ b/src/mhd/mhd_parsing.c @@ -210,6 +210,42 @@ TALER_MHD_parse_request_arg_timeout (struct MHD_Connection *connection, enum GNUNET_GenericReturnValue +TALER_MHD_parse_request_arg_number (struct MHD_Connection *connection, + const char *name, + uint64_t *off) +{ + const char *ts; + char dummy; + unsigned long long num; + + ts = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + name); + if (NULL == ts) + return GNUNET_OK; + if (1 != + sscanf (ts, + "%llu%c", + &num, + &dummy)) + { + MHD_RESULT mret; + + GNUNET_break_op (0); + mret = TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + name); + return (MHD_YES == mret) + ? GNUNET_NO + : GNUNET_SYSERR; + } + *off = (uint64_t) num; + return GNUNET_OK; +} + + +enum GNUNET_GenericReturnValue TALER_MHD_parse_json_data (struct MHD_Connection *connection, const json_t *root, struct GNUNET_JSON_Specification *spec) |