From: Adam Dickmeiss Date: Thu, 29 Jan 2009 09:09:57 +0000 (+0100) Subject: Added member named_result_sets for init handler struct for the GFS. X-Git-Tag: v3.0.42~3 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=0f88139455a3aeffeca0a5650ca5d3d99abc1c17 Added member named_result_sets for init handler struct for the GFS. This allows a server to disable named result sets. Until now all negoation was handled exclusively by the GFS(server) and the client. The server implementation had no way to tell the system that it does not handle named result sets. --- diff --git a/NEWS b/NEWS index a0f3264..8329188 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +Added member named_result_sets for init handler struct for the GFS. This +allows a server to disable named result sets. + --- 3.0.41 2008/12/29 Fixed Fixed test that makes VERSION_SHA1 appear on dist versions too. diff --git a/doc/frontend.xml b/doc/frontend.xml index fe1bd27..c22e915 100644 --- a/doc/frontend.xml +++ b/doc/frontend.xml @@ -409,6 +409,8 @@ typedef struct bend_initrequest /** \brief SRU record update handler */ int (*bend_srw_update)(void *handle, bend_update_rr *rr); + /** \brief whether named result sets are supported (0=disable, 1=enable) */ + int named_result_sets; } bend_initrequest; typedef struct bend_initresult diff --git a/include/yaz/backend.h b/include/yaz/backend.h index c1ed03c..2cf6fa2 100644 --- a/include/yaz/backend.h +++ b/include/yaz/backend.h @@ -308,6 +308,8 @@ typedef struct bend_initrequest /** \brief SRU record update handler */ int (*bend_srw_update)(void *handle, bend_update_rr *rr); + /** \brief whether named result sets are supported (0=disable, 1=enable) */ + int named_result_sets; } bend_initrequest; /** \brief result for init handler (must be filled by handler) */ diff --git a/src/seshigh.c b/src/seshigh.c index 277e568..23b7fe5 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -509,6 +509,7 @@ static void assoc_init_reset(association *assoc) assoc->init->bend_explain = NULL; assoc->init->bend_srw_scan = NULL; assoc->init->bend_srw_update = NULL; + assoc->init->named_result_sets = 0; assoc->init->charneg_request = NULL; assoc->init->charneg_response = NULL; @@ -2198,6 +2199,10 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) assoc->init->charneg_request = negotiation; } + /* by default named_result_sets is 0 .. Enable it if client asks for it. */ + if (ODR_MASK_GET(req->options, Z_Options_namedResultSets)) + assoc->init->named_result_sets = 1; + assoc->backend = 0; if (cb) { @@ -2264,7 +2269,8 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) ODR_MASK_SET(resp->options, Z_Options_extendedServices); strcat(options, " extendedServices"); } - if (ODR_MASK_GET(req->options, Z_Options_namedResultSets)) + if (ODR_MASK_GET(req->options, Z_Options_namedResultSets) + && assoc->init->named_result_sets) { ODR_MASK_SET(resp->options, Z_Options_namedResultSets); strcat(options, " namedresults");