summaryrefslogtreecommitdiff
path: root/src/reducer/anastasis_api_redux.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-04-05 17:16:04 +0200
committerChristian Grothoff <christian@grothoff.org>2022-04-05 17:16:04 +0200
commit71f889186973ef26e8ae684ec47fd570138bc4e5 (patch)
tree02898d03575384c26b5399d28d702d97f4683403 /src/reducer/anastasis_api_redux.c
parent452aa5391b75ab6637b62398f9b0627593570d5d (diff)
downloadanastasis-71f889186973ef26e8ae684ec47fd570138bc4e5.tar.gz
anastasis-71f889186973ef26e8ae684ec47fd570138bc4e5.tar.bz2
anastasis-71f889186973ef26e8ae684ec47fd570138bc4e5.zip
adapt to latest GNUnet API: GNUNET_JSON_spec_mark_optional() changed
Diffstat (limited to 'src/reducer/anastasis_api_redux.c')
-rw-r--r--src/reducer/anastasis_api_redux.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c
index bcc0e77..bc2cb5e 100644
--- a/src/reducer/anastasis_api_redux.c
+++ b/src/reducer/anastasis_api_redux.c
@@ -1254,19 +1254,22 @@ enter_user_attributes (json_t *state,
const char *attribute_value;
const char *regexp = NULL;
const char *reglog = NULL;
- int optional = false;
+ bool optional = false;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("name",
&name),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("validation-regex",
- &regexp)),
+ &regexp),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("validation-logic",
- &reglog)),
+ &reglog),
+ NULL),
GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_boolean ("optional",
- &optional)),
+ GNUNET_JSON_spec_bool ("optional",
+ &optional),
+ NULL),
GNUNET_JSON_spec_end ()
};
@@ -2024,16 +2027,20 @@ ANASTASIS_reducer_lookup_salt (const json_t *state,
const json_t *cfg;
uint32_t http_status = 0;
bool disabled = false;
+ bool no_salt;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_bool ("disabled",
- &disabled)),
+ &disabled),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_uint32 ("http_status",
- &http_status)),
+ &http_status),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_fixed_auto ("salt",
- salt)),
+ salt),
+ &no_salt),
GNUNET_JSON_spec_end ()
};
@@ -2062,9 +2069,7 @@ ANASTASIS_reducer_lookup_salt (const json_t *state,
}
if (disabled)
return GNUNET_NO;
- if (NULL ==
- json_object_get (cfg,
- "salt"))
+ if (no_salt)
return GNUNET_NO;
return GNUNET_OK;
}