- cl->state = Client_Failed; // FIXME need to do something to the connection
-}
-
-
-static void ingest_raw_records(struct client *cl, Z_Records *r)
-{
- Z_NamePlusRecordList *rlist;
- Z_NamePlusRecord *npr;
- xmlDoc *doc;
- xmlChar *buf_out;
- int len_out;
- if (r->which != Z_Records_DBOSD)
- {
- client_show_raw_error(cl, "non-surrogate diagnostics");
- return;
- }
-
- rlist = r->u.databaseOrSurDiagnostics;
- if (rlist->num_records != 1 || !rlist->records || !rlist->records[0])
- {
- client_show_raw_error(cl, "no records");
- return;
- }
- npr = rlist->records[0];
- if (npr->which != Z_NamePlusRecord_databaseRecord)
- {
- client_show_raw_error(cl, "surrogate diagnostic");
- return;
- }
-
- 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++)