X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fseshigh.c;h=83ecd1d9e30b2d3b529734b1e1f6e7e019f293c0;hp=690e872856a83edf524e7be732f2c6bffc79cb30;hb=af019cc83166ab755de4b9c9133c23caacc2f103;hpb=5ee8b8431f852d06d1963134d38c1bb8fe6343fa diff --git a/src/seshigh.c b/src/seshigh.c index 690e872..83ecd1d 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.115 2007-04-16 21:53:09 adam Exp $ + * $Id: seshigh.c,v 1.116 2007-05-02 11:53:25 adam Exp $ */ /** * \file seshigh.c @@ -496,6 +496,7 @@ 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->bend_sort = NULL; assoc->init->bend_search = NULL; assoc->init->bend_present = NULL; @@ -2282,9 +2283,21 @@ 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, 0); + } + 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; @@ -2301,7 +2314,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); @@ -2340,7 +2352,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.115 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.116 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode,