if (cl->session)
{
NMEM nmem = nmem_create();
- int rc = ingest_xml_record(cl, xdoc, offset, nmem);
+ int rc = ingest_xml_record(cl, xdoc, offset, nmem, 1);
if (rc == -1)
session_log(se, YLOG_WARN,
"Failed to ingest xdoc from %s #%d",
{
int ret = 0;
struct session *se = client_get_session(cl);
- struct conf_service *service = se->service;
-
- insert_settings_values(sdb, xdoc, root, service);
if (!check_record_filter(root, sdb))
{
return ret;
}
-int ingest_xml_record(struct client *cl, xmlDoc *xdoc,
- int record_no, NMEM nmem);
-
/** \brief ingest XML record
\param cl client holds the result set for record
\param rec record buffer (0 terminated)
struct session_database *sdb = client_get_database(cl);
struct conf_service *service = se->service;
xmlDoc *xdoc = normalize_record(se, sdb, service, rec, nmem);
- int r = ingest_xml_record(cl, xdoc, record_no, nmem);
+ int r = ingest_xml_record(cl, xdoc, record_no, nmem, 0);
client_store_xdoc(cl, record_no, xdoc);
return r;
}
int ingest_xml_record(struct client *cl, xmlDoc *xdoc,
- int record_no, NMEM nmem)
+ int record_no, NMEM nmem, int cached_copy)
{
struct session *se = client_get_session(cl);
struct session_database *sdb = client_get_database(cl);
if (sroot->type == XML_ELEMENT_NODE &&
!strcmp((const char *) sroot->name, "record"))
{
+ if (!cached_copy)
+ insert_settings_values(sdb, xdoc, root, service);
r = ingest_sub_record(cl, xdoc, sroot, record_no, nmem, sdb,
mk);
}
mk->value = nmem_strdup(nmem, mergekey_norm);
mk->next = 0;
+ if (!cached_copy)
+ insert_settings_values(sdb, xdoc, root, service);
r = ingest_sub_record(cl, xdoc, root, record_no, nmem, sdb, mk);
}
}
int ingest_record(struct client *cl, const char *rec, int record_no, NMEM nmem);
int ingest_xml_record(struct client *cl, xmlDoc *xdoc,
- int record_no, NMEM nmem);
+ int record_no, NMEM nmem, int cached_copy);
void session_alert_watch(struct session *s, int what);
void add_facet(struct session *s, const char *type, const char *value, int count);