if (json_get_str(json, "path", &str))
goto fail;
node->map.path = pstrdup(str);
- if (json_get_int(json, "dlerr", &node->dlerr))
+ error = json_get_int(json, "dlerr", &node->dlerr);
+ if (error != 0 && error != ENOENT)
goto fail;
- if (json_get_ts(json, "mtim", &node->mtim))
+ error = json_get_ts(json, "mtim", &node->mtim);
+ if (error != 0 && error != ENOENT)
goto fail;
error = json_get_object(json, "rrdp", &rrdp);
if (error < 0)
STAILQ_INIT(&state->delta_hashes);
error = json_get_str(json, TAGNAME_SESSION, &str);
- if (error) {
- if (error > 0)
- pr_op_err("Node is missing the '" TAGNAME_SESSION "' tag.");
+ if (error < 0)
goto revert_notif;
- }
- state->session.session_id = pstrdup(str);
+ state->session.session_id = (error == 0) ? pstrdup(str) : NULL;
error = json_get_str(json, TAGNAME_SERIAL, &str);
- if (error) {
- if (error > 0)
- pr_op_err("Node is missing the '" TAGNAME_SERIAL "' tag.");
+ if (error < 0)
goto revert_session;
- }
- state->session.serial.str = pstrdup(str);
+ state->session.serial.str = (error == 0) ? pstrdup(str) : NULL;
state->session.serial.num = BN_create();
if (!BN_dec2bn(&state->session.serial.num, state->session.serial.str)) {