X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fseshigh.c;h=5a6a26f4c44344a4662e62c741b9590caf42f95c;hp=25558230b3ef739c8f40f0fdf5b05c1ff199d7a9;hb=36d8976c55a2681d0057a0c200356a283e897b91;hpb=b70c72a5a3914502cbdd17588e74e6c74bd282b6 diff --git a/src/seshigh.c b/src/seshigh.c index 2555823..5a6a26f 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -671,7 +671,7 @@ static int retrieve_fetch(association *assoc, bend_fetch_rr *rr) 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; @@ -730,6 +730,8 @@ static int srw_bend_fetch(association *assoc, int pos, 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); @@ -1088,6 +1090,7 @@ static void srw_bend_search(association *assoc, for (i = 0; irecords[j].recordPacking = packing; @@ -1096,7 +1099,7 @@ static void srw_bend_search(association *assoc, 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, @@ -1109,6 +1112,8 @@ static void srw_bend_search(association *assoc, } if (srw_res->records[j].recordData_buf) j++; + if (last_in_set) + break; } srw_res->num_records = j; if (!j) @@ -2595,6 +2600,8 @@ static Z_Records *pack_records(association *a, char *setname, Odr_int start, return 0; reclist->records[reclist->num_records] = thisrec; reclist->num_records++; + if (freq.last_in_set) + break; } *num = reclist->num_records; return records;