X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fseshigh.c;h=ec058c6d69ff17577f3c216dbe08033452588f66;hb=c437556fbbc225557c621c28d5c3a70e03c345de;hp=6349c4e0881c366a8dc4c90d8a9f48beebd9d716;hpb=725fc033b729b22a1e0cfba614192b6fbfaeda4f;p=yaz-moved-to-github.git diff --git a/src/seshigh.c b/src/seshigh.c index 6349c4e..ec058c6 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.24 2004-05-10 07:48:56 adam Exp $ + * $Id: seshigh.c,v 1.30 2004-09-30 18:40:13 adam Exp $ */ /* @@ -510,9 +510,22 @@ static int srw_bend_fetch(association *assoc, int pos, rr.comp->u.complex->generic = (Z_Specification *) odr_malloc(assoc->decode, sizeof(Z_Specification)); + + /* schema uri = recordSchema (or NULL if recordSchema is not given) */ rr.comp->u.complex->generic->which = Z_Schema_uri; rr.comp->u.complex->generic->schema.uri = srw_req->recordSchema; + + /* ESN = recordSchema if recordSchema is present */ rr.comp->u.complex->generic->elementSpec = 0; + if (srw_req->recordSchema) + { + rr.comp->u.complex->generic->elementSpec = + (Z_ElementSpec *) odr_malloc(assoc->encode, sizeof(Z_ElementSpec)); + rr.comp->u.complex->generic->elementSpec->which = + Z_ElementSpec_elementSetName; + rr.comp->u.complex->generic->elementSpec->u.elementSetName = + srw_req->recordSchema; + } rr.stream = assoc->encode; rr.print = assoc->print; @@ -606,7 +619,8 @@ static void srw_bend_search(association *assoc, request *req, const char *pqf_msg; size_t off; int code = yaz_pqf_error (pqf_parser, &pqf_msg, &off); - yaz_log(LOG_LOG, "%*s^\n", off+4, ""); + if (off < 200) + yaz_log(LOG_LOG, "%*s^\n", (int)off+4, ""); yaz_log(LOG_LOG, "Bad PQF: %s (code %d)\n", pqf_msg, code); srw_error = 10; @@ -649,7 +663,6 @@ static void srw_bend_search(association *assoc, request *req, rr.search_info = 0; yaz_log_zquery(rr.query); (assoc->init->bend_search)(assoc->backend, &rr); - srw_res->numberOfRecords = odr_intdup(assoc->encode, rr.hits); if (rr.errcode) { yaz_log(LOG_DEBUG, "bend_search returned Bib-1 code %d", rr.errcode); @@ -761,7 +774,7 @@ static void srw_bend_explain(association *assoc, request *req, if (srw_req->recordPacking && !strcmp(srw_req->recordPacking, "xml")) packing = Z_SRW_recordPacking_XML; - srw_res->record.recordSchema = 0; + srw_res->record.recordSchema = rr.schema; srw_res->record.recordPacking = packing; srw_res->record.recordData_buf = rr.explain_buf; srw_res->record.recordData_len = strlen(rr.explain_buf); @@ -1033,6 +1046,8 @@ static int process_z_request(association *assoc, request *req, char **msg) return -1; } break; + case Z_APDU_triggerResourceControlRequest: + return 0; default: *msg = "Bad APDU received"; return -1; @@ -1285,6 +1300,8 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) ODR_MASK_SET(resp->options, Z_Options_negotiationModel); strcat(options, " negotiation"); } + + ODR_MASK_SET(resp->options, Z_Options_triggerResourceCtrl); if (ODR_MASK_GET(req->protocolVersion, Z_ProtocolVersion_1)) { @@ -1321,7 +1338,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.24 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.30 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode,