X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fseshigh.c;h=24041a68bb47cc3ce900a29e1949f3c5b9104ec8;hb=9c8fdeb92bede48bce060ec8ee50624c5622a633;hp=11ffa7235ea7fcf5f22e8d560d89c0cfd5c6a2ae;hpb=f60c0db8c4379047cdd75e2be50549abc0a1c74a;p=yaz-moved-to-github.git diff --git a/src/seshigh.c b/src/seshigh.c index 11ffa72..24041a6 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.120 2007-05-30 08:12:17 adam Exp $ + * $Id: seshigh.c,v 1.122 2007-06-05 06:52:23 adam Exp $ */ /** * \file seshigh.c @@ -1856,7 +1856,7 @@ static void process_http_request(association *assoc, request *req) #endif {0, 0, 0} }; - char ctype[60]; + char ctype[80]; int ret; p = z_get_HTTP_Response(o, 200); hres = p->u.HTTP_Response; @@ -1874,7 +1874,7 @@ static void process_http_request(association *assoc, request *req) hres->code = http_code; strcpy(ctype, "text/xml"); - if (charset) + if (charset && strlen(charset) < sizeof(ctype)-30) { strcat(ctype, "; charset="); strcat(ctype, charset); @@ -2290,36 +2290,32 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) strcat(options, " sort"); } - if (!assoc->init->charneg_response && !assoc->init->charneg_request) + if (ODR_MASK_GET(req->options, Z_Options_negotiationModel)) { - if (assoc->init->query_charset) + Z_OtherInformationUnit *p0; + + if (!assoc->init->charneg_response) { - assoc->init->charneg_response = yaz_set_response_charneg( - assoc->encode, assoc->init->query_charset, 0, - assoc->init->records_in_same_charset); + 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"); + } } - else + if (assoc->init->charneg_response + && (p0=yaz_oi_update(&resp->otherInfo, assoc->encode, NULL, 0, 0))) { - 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; - - yaz_oi_APDU(apdu, &p); - - if ((p0=yaz_oi_update(p, assoc->encode, NULL, 0, 0))) { - ODR_MASK_SET(resp->options, Z_Options_negotiationModel); - p0->which = Z_OtherInfo_externallyDefinedInfo; p0->information.externallyDefinedInfo = assoc->init->charneg_response; + ODR_MASK_SET(resp->options, Z_Options_negotiationModel); + strcat(options, " negotiation"); } - 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); @@ -2359,7 +2355,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.120 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.122 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode,