X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fseshigh.c;h=bad7a31c1973662a0427ce647481ae9aee5da434;hb=20f83e699d4868d263393996bd4b98fee045e360;hp=5b2ecf61b0c02f0913ca55042df07ef5e523a9e8;hpb=7a4064cd15f6c6b34c1180e1bc51f0d0e90da320;p=yaz-moved-to-github.git diff --git a/src/seshigh.c b/src/seshigh.c index 5b2ecf6..bad7a31 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.113 2007-04-12 13:52:57 adam Exp $ + * $Id: seshigh.c,v 1.117 2007-05-02 12:36:34 adam Exp $ */ /** * \file seshigh.c @@ -496,6 +496,8 @@ static void assoc_init_reset(association *assoc) assoc->init->implementation_version = 0; assoc->init->implementation_id = 0; assoc->init->implementation_name = 0; + assoc->init->query_charset = 0; + assoc->init->records_in_same_charset = 0; assoc->init->bend_sort = NULL; assoc->init->bend_search = NULL; assoc->init->bend_present = NULL; @@ -625,7 +627,7 @@ static int retrieve_fetch(association *assoc, bend_fetch_rr *rr) if (input_syntax_raw) { char oidbuf[OID_STR_MAX]; - oid_to_dotstring(input_syntax_raw, oidbuf); + oid_oid_to_dotstring(input_syntax_raw, oidbuf); rr->errstring = odr_strdup(rr->stream, oidbuf); } return -1; @@ -679,10 +681,8 @@ static int srw_bend_fetch(association *assoc, int pos, rr.setname = "default"; rr.number = pos; rr.referenceId = 0; - rr.request_format = yaz_string_to_oid_odr(yaz_oid_std(), - CLASS_RECSYN, - OID_STR_XML, - assoc->decode); + rr.request_format = odr_oiddup(assoc->decode, yaz_oid_recsyn_xml); + rr.comp = (Z_RecordComposition *) odr_malloc(assoc->decode, sizeof(*rr.comp)); rr.comp->which = Z_RecordComp_complex; @@ -2148,9 +2148,7 @@ static int process_z_response(association *assoc, request *req, Z_APDU *res) static char *get_vhost(Z_OtherInformation *otherInfo) { - const int *oid = yaz_string_to_oid(yaz_oid_std(), - CLASS_USERINFO, OID_STR_PROXY); - return yaz_oi_get_string_oid(&otherInfo, oid, 1, 0); + return yaz_oi_get_string_oid(&otherInfo, yaz_oid_userinfo_proxy, 1, 0); } /* @@ -2286,9 +2284,22 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) ODR_MASK_SET(resp->options, Z_Options_sort); strcat(options, " sort"); } - - if (ODR_MASK_GET(req->options, Z_Options_negotiationModel) - && assoc->init->charneg_response) + + if (!assoc->init->charneg_response && !assoc->init->charneg_request) + { + if (assoc->init->query_charset) + { + assoc->init->charneg_response = yaz_set_response_charneg( + assoc->encode, assoc->init->query_charset, 0, + assoc->init->records_in_same_charset); + } + else + { + yaz_log(YLOG_WARN, "default query_charset not defined by backend"); + } + } + if (assoc->init->charneg_response + && ODR_MASK_GET(req->options, Z_Options_negotiationModel)) { Z_OtherInformation **p; Z_OtherInformationUnit *p0; @@ -2305,7 +2316,6 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) ODR_MASK_SET(resp->options, Z_Options_negotiationModel); strcat(options, " negotiation"); } - if (ODR_MASK_GET(req->options, Z_Options_triggerResourceCtrl)) ODR_MASK_SET(resp->options, Z_Options_triggerResourceCtrl); @@ -2344,7 +2354,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.113 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.117 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode, @@ -3499,11 +3509,10 @@ static Z_APDU *process_ESRequest(association *assoc, request *reqb, int *fd) /* Do something with the members of bend_extendedservice */ if (esrequest.taskPackage) { - const int *oid = yaz_string_to_oid(yaz_oid_std(), - CLASS_EXTSERV, OID_STR_EXTENDED); - resp->taskPackage = z_ext_record_oid(assoc->encode, oid, - (const char *) esrequest.taskPackage, - -1); + resp->taskPackage = z_ext_record_oid( + assoc->encode, yaz_oid_recsyn_extended, + (const char *) esrequest.taskPackage, -1 + ); } yaz_log(YLOG_DEBUG,"Send the result apdu"); return apdu;