Clixon config option CLICON_XMLDB_CACHE renamed to CLICON_DATASTORE_CACHE and changed type from boolean to datastore_cache

This commit is contained in:
Olof hagsand 2019-05-09 14:25:16 +02:00
parent 70221742f7
commit 99b7a1fe5b
13 changed files with 207 additions and 150 deletions

View file

@ -102,13 +102,12 @@ db_merge(clicon_handle h,
cxobj *xt = NULL;
/* Get data as xml from db1 */
if (xmldb_get(h, (char*)db1, NULL, &xt, NULL) < 0)
if (xmldb_get(h, (char*)db1, NULL, 0, &xt, NULL) < 0)
goto done;
/* Merge xml into db2. Without commit */
retval = xmldb_put(h, (char*)db2, OP_MERGE, xt, clicon_username_get(h), cbret);
done:
if (xt)
xml_free(xt);
xmldb_get_free(h, &xt);
return retval;
}
@ -270,8 +269,7 @@ startup_extraxml(clicon_handle h,
ok:
retval = 1;
done:
if (xt && !clicon_option_bool(h, "CLICON_XMLDB_CACHE"))
xml_free(xt);
xmldb_get_free(h, &xt);
if (xmldb_delete(h, db) != 0 && errno != ENOENT)
return -1;
return retval;