static int srw_bend_fetch(association *assoc, int pos,
Z_SRW_searchRetrieveRequest *srw_req,
Z_SRW_record *record,
- const char **addinfo)
+ const char **addinfo, int *last_in_set)
{
bend_fetch_rr rr;
ODR o = assoc->encode;
retrieve_fetch(assoc, &rr);
+ *last_in_set = rr.last_in_set;
+
if (rr.errcode && rr.surrogate_flag)
{
int code = yaz_diag_bib1_to_srw(rr.errcode);
for (i = 0; i<number; i++)
{
int errcode;
+ int last_in_set = 0;
const char *addinfo = 0;
srw_res->records[j].recordPacking = packing;
yaz_log(YLOG_DEBUG, "srw_bend_fetch %d", i+start);
errcode = srw_bend_fetch(assoc, i+start, srw_req,
srw_res->records + j,
- &addinfo);
+ &addinfo, &last_in_set);
if (errcode)
{
yaz_add_srw_diagnostic(assoc->encode,
}
if (srw_res->records[j].recordData_buf)
j++;
+ if (last_in_set)
+ break;
}
srw_res->num_records = j;
if (!j)
return 0;
reclist->records[reclist->num_records] = thisrec;
reclist->num_records++;
+ if (freq.last_in_set)
+ break;
}
*num = reclist->num_records;
return records;