- else
- yaz_log(YLOG_WARN, "Expected record, but got NULL");
- }
-}
-
-#ifdef RETIRED
-
-void client_present_response(struct client *cl, Z_APDU *a)
-{
- Z_PresentResponse *r = a->u.presentResponse;
- Z_Records *recs = r->records;
-
- if (recs && recs->which == Z_Records_NSD)
- {
- WRBUF w = wrbuf_alloc();
-
- Z_DiagRec dr, *dr_p = &dr;
- dr.which = Z_DiagRec_defaultFormat;
- dr.u.defaultFormat = recs->u.nonSurrogateDiagnostic;
-
- wrbuf_printf(w, "Present response NSD %s: ",
- cl->database->database->url);
-
- cl->diagnostic = diag_to_wrbuf(&dr_p, 1, w);
-
- yaz_log(YLOG_WARN, "%s", wrbuf_cstr(w));
-
- cl->state = Client_Error;
- wrbuf_destroy(w);
-
- client_show_raw_error(cl, "non surrogate diagnostics");
- }
- else if (recs && recs->which == Z_Records_multipleNSD)
- {
- WRBUF w = wrbuf_alloc();
-
- wrbuf_printf(w, "Present response multipleNSD %s: ",
- cl->database->database->url);
- cl->diagnostic =
- diag_to_wrbuf(recs->u.multipleNonSurDiagnostics->diagRecs,
- recs->u.multipleNonSurDiagnostics->num_diagRecs,
- w);
- yaz_log(YLOG_WARN, "%s", wrbuf_cstr(w));
- cl->state = Client_Error;
- wrbuf_destroy(w);
- }
- else if (recs && !*r->presentStatus && cl->state != Client_Error)
- {
- yaz_log(YLOG_DEBUG, "Good Present response %s",
- cl->database->database->url);
-
- // we can mix show raw and normal show ..
- if (cl->show_raw && cl->show_raw->active)
- {
- cl->show_raw->active = 0; // no longer active
- ingest_raw_records(cl, recs);
- }
- else
- ingest_records(cl, recs);
- cl->state = Client_Continue;
- }
- else if (*r->presentStatus)
- {
- yaz_log(YLOG_WARN, "Bad Present response %s",
- cl->database->database->url);
- cl->state = Client_Error;
- client_show_raw_error(cl, "bad present response");