* C-code changes:
  - Replaced stream uri:s w constants
  - Replaced large debug print code with single clicon_log_xml
  - Restconf put and post handling refactored using new parse API
This commit is contained in:
Olof hagsand 2020-02-24 15:25:06 +01:00
parent de3853a126
commit a71c256898
27 changed files with 308 additions and 250 deletions

View file

@ -581,7 +581,8 @@ stream_notify(clicon_handle h,
goto done;
}
/* From RFC5277 */
cprintf(cb, "<notification xmlns=\"urn:ietf:params:xml:ns:netconf:notification:1.0\"><eventTime>%s</eventTime>%s</notification>", timestr, str);
cprintf(cb, "<notification xmlns=\"%s\"><eventTime>%s</eventTime>%s</notification>",
NOTIFICATION_RFC5277_NAMESPACE, timestr, str);
if (xml_parse_string(cbuf_get(cb), yspec, &xev) < 0)
goto done;
if (xml_rootchild(xev, 0, &xev) < 0)
@ -644,7 +645,9 @@ stream_notify_xml(clicon_handle h,
clicon_err(OE_UNIX, errno, "time2str");
goto done;
}
cprintf(cb, "<notification xmlns=\"urn:ietf:params:xml:ns:netconf:notification:1.0\"><eventTime>%s</eventTime>NULL</notification>", timestr); /* XXX str is always NULL */
cprintf(cb, "<notification xmlns=\"%s\"><eventTime>%s</eventTime>NULL</notification>",
NOTIFICATION_RFC5277_NAMESPACE,
timestr); /* XXX str is always NULL */
if (xml_parse_string(cbuf_get(cb), yspec, &xev) < 0)
goto done;
if (xml_rootchild(xev, 0, &xev) < 0)