From: Adam Dickmeiss Date: Sun, 11 Sep 2005 18:39:10 +0000 (+0000) Subject: Added support for specifying SRW resultSetId + resultSetIdleTime in a X-Git-Tag: YAZ.2.1.10~71 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=1fe36f21be4d9ae40e62162651d144e0fd787df5;p=yaz-moved-to-github.git Added support for specifying SRW resultSetId + resultSetIdleTime in a Generic Frontend Server's search handler. Patch by Ko van der Sloot. --- diff --git a/NEWS b/NEWS index e54c687..6c496dd 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ Added 'exit' as synonym for 'quit' in yaz-client Possible compatibility problems with earlier versions marked with '*'. +Added support for specifying srw resultset id + resultset TTL in a +Generic Frontend Server's search handler. Patch by Ko van der Sloot. + Do not build the separate Multi-threaded (MT) library libyazthread.la. Instead make the library libyaz.la multi-threaded. Threading as a whole can still be disabled by configure option --disable-threads. Previosly, diff --git a/include/yaz/backend.h b/include/yaz/backend.h index ef78d7a..5f6ad17 100644 --- a/include/yaz/backend.h +++ b/include/yaz/backend.h @@ -23,7 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Id: backend.h,v 1.32 2005-06-25 15:46:01 adam Exp $ + * $Id: backend.h,v 1.33 2005-09-11 18:39:11 adam Exp $ */ /** @@ -65,6 +65,8 @@ typedef struct { char *errstring; /* system error string or NULL */ Z_OtherInformation *search_info; /* additional search info */ char *srw_sortKeys; /* holds SRU/SRW sortKeys info */ + char *srw_setname; /* holds SRU/SRW generated resultsetID */ + int *srw_setnameIdleTime; /* holds SRU/SRW life-time */ } bend_search_rr; /* extended present handler. Does not replace bend_fetch. */ diff --git a/src/seshigh.c b/src/seshigh.c index e307b62..f398c25 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.60 2005-08-30 20:13:51 adam Exp $ + * $Id: seshigh.c,v 1.61 2005-09-11 18:39:11 adam Exp $ */ /** * \file seshigh.c @@ -722,7 +722,8 @@ static void srw_bend_search(association *assoc, request *req, rr.basenames = &srw_req->database; rr.referenceId = 0; rr.srw_sortKeys = 0; - + rr.srw_setname = 0; + rr.srw_setnameIdleTime = 0; rr.query = (Z_Query *) odr_malloc (assoc->decode, sizeof(*rr.query)); rr.query->u.type_1 = 0; @@ -827,6 +828,13 @@ static void srw_bend_search(association *assoc, request *req, start, number, rr.hits); srw_res->numberOfRecords = odr_intdup(assoc->encode, rr.hits); + if (rr.srw_setname) + { + srw_res->resultSetId = + odr_strdup(assoc->encode, rr.srw_setname ); + srw_res->resultSetIdleTime = + odr_intdup(assoc->encode, *rr.srw_setnameIdleTime ); + } if (number > 0) { int i; @@ -1767,7 +1775,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) assoc->init->implementation_name, odr_prepend(assoc->encode, "GFS", resp->implementationName)); - version = odr_strdup(assoc->encode, "$Revision: 1.60 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.61 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode, @@ -2015,6 +2023,8 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb, bsrr->referenceId = req->referenceId; save_referenceId (reqb, bsrr->referenceId); bsrr->srw_sortKeys = 0; + bsrr->srw_setname = 0; + bsrr->srw_setnameIdleTime = 0; yaz_log (log_requestdetail, "ResultSet '%s'", req->resultSetName); if (req->databaseNames)