- doc = record_to_xml(client_get_database(cl), npr->u.databaseRecord);
- if (!doc)
- {
- client_show_raw_error(cl, "unable to convert record to xml");
- return;
- }
-
- xmlDocDumpMemory(doc, &buf_out, &len_out);
- xmlFreeDoc(doc);
-
- cl->show_raw->record_handler(cl->show_raw->data,
- (const char *) buf_out, len_out);
-
- xmlFree(buf_out);
- xfree(cl->show_raw);
- cl->show_raw = 0;
-}
-
-static void ingest_records(struct client *cl, Z_Records *r)
-{
-#if USE_TIMING
- yaz_timing_t t = yaz_timing_create();
-#endif
- struct record *rec;
- struct session *s = client_get_session(cl);
- Z_NamePlusRecordList *rlist;
- int i;
-
- if (r->which != Z_Records_DBOSD)
- return;
- rlist = r->u.databaseOrSurDiagnostics;
- for (i = 0; i < rlist->num_records; i++)
- {
- Z_NamePlusRecord *npr = rlist->records[i];
-
- cl->records++;
- if (npr->which != Z_NamePlusRecord_databaseRecord)
- {
- yaz_log(YLOG_WARN,
- "Unexpected record type, probably diagnostic %s",
- cl->database->database->url);
- continue;
- }
-
- rec = ingest_record(cl, npr->u.databaseRecord, cl->records);
- if (!rec)
- continue;
- }
- if (rlist->num_records)
- session_alert_watch(s, SESSION_WATCH_SHOW);
- if (rlist->num_records)
- session_alert_watch(s, SESSION_WATCH_RECORD);
-
-#if USE_TIMING
- yaz_timing_stop(t);
- yaz_log(YLOG_LOG, "ingest_records %6.5f %3.2f %3.2f",
- yaz_timing_get_real(t), yaz_timing_get_user(t),
- yaz_timing_get_sys(t));
- yaz_timing_destroy(&t);
-#endif