- // z3950'fy number of records requested
- // protect against requesting records out of range
- *apdu->u.presentRequest->numberOfRecordsRequested
- = std::min(max_recs,
- *sru_pdu_res->u.response->numberOfRecords - start + 1);
-
- // z3950'fy recordPacking
- int record_packing = Z_SRW_recordPacking_XML;
- if (sr_req->recordPacking && 's' == *(sr_req->recordPacking))
- record_packing = Z_SRW_recordPacking_string;
-
- // RecordSyntax will always be XML
- apdu->u.presentRequest->preferredRecordSyntax
- = odr_oiddup(odr_en, yaz_oid_recsyn_xml);
-
- // z3950'fy record schema
- if (sr_req->recordSchema)
- {
- apdu->u.presentRequest->recordComposition
- = (Z_RecordComposition *)
- odr_malloc(odr_en, sizeof(Z_RecordComposition));
- apdu->u.presentRequest->recordComposition->which
- = Z_RecordComp_simple;
- apdu->u.presentRequest->recordComposition->u.simple
- = mp_util::build_esn_from_schema(odr_en,
- (const char *)
- sr_req->recordSchema);
- }
-
- // z3950'fy time to live - flagged as diagnostics above
- //if (sr_req->resultSetTTL)
-
- // attaching Z3950 package to filter chain
- z3950_package.request() = apdu;
-
- // sending Z30.50 present request
- z3950_package.move();
-
- //check successful Z3950 present response
- Z_GDU *z3950_gdu = z3950_package.response().get();
- if (!z3950_gdu || z3950_gdu->which != Z_GDU_Z3950
- || z3950_gdu->u.z3950->which != Z_APDU_presentResponse
- || !z3950_gdu->u.z3950->u.presentResponse)