+ yaz_log(YLOG_WARN, "Search error %s (%s): %s",
+ error, addinfo, client_get_url(cl));
+ }
+ else
+ {
+ ZOOM_record rec = 0;
+ const char *msg, *addinfo;
+
+ if (cl->show_raw && cl->show_raw->active)
+ {
+ if ((rec = ZOOM_resultset_record(resultset,
+ cl->show_raw->position-1)))
+ {
+ cl->show_raw->active = 0;
+ ingest_raw_record(cl, rec);
+ }
+ else
+ {
+ yaz_log(YLOG_WARN, "Expected record, but got NULL, offset=%d",
+ cl->show_raw->position-1);
+ }
+ }
+ else
+ {
+ int offset = cl->record_offset;
+ if ((rec = ZOOM_resultset_record(resultset, offset)))
+ {
+ cl->record_offset++;
+ if (ZOOM_record_error(rec, &msg, &addinfo, 0))
+ yaz_log(YLOG_WARN, "Record error %s (%s): %s (rec #%d)",
+ error, addinfo, client_get_url(cl),
+ cl->record_offset);
+ else
+ {
+ struct session_database *sdb = client_get_database(cl);
+ const char *xmlrec;
+ char type[80];
+ if (nativesyntax_to_type(sdb, type, rec))
+ yaz_log(YLOG_WARN, "Failed to determine record type");
+ if ((xmlrec = ZOOM_record_get(rec, type, NULL)))
+ {
+ if (ingest_record(cl, xmlrec, cl->record_offset))
+ {
+ session_alert_watch(cl->session, SESSION_WATCH_SHOW);
+ session_alert_watch(cl->session, SESSION_WATCH_RECORD);
+ }
+ else
+ yaz_log(YLOG_WARN, "Failed to ingest");
+ }
+ else
+ yaz_log(YLOG_WARN, "Failed to extract ZOOM record");
+ }
+
+ }
+ else
+ {
+ yaz_log(YLOG_WARN, "Expected record, but got NULL, offset=%d",
+ offset);
+ }
+ }
+ }