- { /*"FAILED"*/
- Z_Records *recs = r->records;
- cl->hits = 0;
- cl->state = Client_Error;
- 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, "Search 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);
- }
- else if (recs && recs->which == Z_Records_multipleNSD)
- {
- WRBUF w = wrbuf_alloc();
-
- wrbuf_printf(w, "Search 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);
- }
- }
-}
-
-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)