From dbc40ad16aa82379d2884e106d79c7d83312667a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 10 Jan 2013 11:04:38 +0100 Subject: [PATCH 1/1] New GFS search member: present_number This is a hint to the search handler how many records are going to be fetched immediately following search. There's no guarantee that it's going to be the case, since it depends on hit count (for Z39.50 piggyback) and whether errors turn up. --- include/yaz/backend.h | 5 +++-- src/seshigh.c | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/yaz/backend.h b/include/yaz/backend.h index ea2d88b..dd2806c 100644 --- a/include/yaz/backend.h +++ b/include/yaz/backend.h @@ -62,7 +62,7 @@ typedef struct { ODR decode; /**< decode stream (input) */ ODR print; /**< print stream (input) */ - bend_association association; /**< GFS association / sesssion (input) */ + bend_association association; /**< GFS association / session (input) */ Odr_int hits; /**< hits (output) */ int errcode; /**< Diagnostic code / 0 for no error (output) */ char *errstring; /**< Additional info (output) */ @@ -75,6 +75,7 @@ typedef struct { Z_SRW_extra_arg *extra_args; /**< SRU extra request parameters (input) */ char *extra_response_data; /**< SRW extra XML response (output) */ Z_OtherInformation *search_input; /**< extra search info request (input) */ + Odr_int present_number; /**< piggyback present number (>0) (input) */ } bend_search_rr; /** \brief Information for present handler. Does not replace bend_fetch. */ @@ -87,7 +88,7 @@ typedef struct { Z_RecordComposition *comp; /**< Formatting instructions (input) */ ODR stream; /**< encoding stream (input) */ ODR print; /**< printing stream (input) */ - bend_association association; /**< GFS association / sesssion (input) */ + bend_association association; /**< GFS association / session (input) */ int errcode; /**< Diagnostic code / 0 for no error (output) */ char *errstring; /**< Additional info (output) */ diff --git a/src/seshigh.c b/src/seshigh.c index ce6fbb7..223239f 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -896,6 +896,8 @@ static void srw_bend_search(association *assoc, rr.query->u.type_1 = 0; rr.extra_args = sr->extra_args; rr.extra_response_data = 0; + rr.present_number = srw_req->maximumRecords ? + *srw_req->maximumRecords : 0; if (srw_req->query_type == Z_SRW_query_type_cql) { @@ -2650,6 +2652,7 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb) bsrr->errstring = NULL; bsrr->search_info = NULL; bsrr->search_input = req->otherInfo; + bsrr->present_number = *req->mediumSetPresentNumber; if (assoc->server && assoc->server->cql_transform && req->query->which == Z_Query_type_104 -- 1.7.10.4