From: Alberto Leiva Popper Date: Tue, 15 Oct 2024 17:24:09 +0000 (-0600) Subject: Mirror the previous commit on the read pipeline X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b029fa4b37f6e2149823f241d638700caa2a459;p=thirdparty%2FFORT-validator.git Mirror the previous commit on the read pipeline --- diff --git a/src/cache.c b/src/cache.c index bd90e0be..741e61c4 100644 --- a/src/cache.c +++ b/src/cache.c @@ -259,9 +259,11 @@ json2node(json_t *json) 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) diff --git a/src/rrdp.c b/src/rrdp.c index d98eee30..a42e4c6f 100644 --- a/src/rrdp.c +++ b/src/rrdp.c @@ -1476,20 +1476,14 @@ rrdp_json2state(json_t *json, struct rrdp_state **result) 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)) {