X-Git-Url: http://git.indexdata.com/?p=yazproxy-moved-to-github.git;a=blobdiff_plain;f=src%2Fyaz-proxy-config.cpp;h=2102e9afbaa2628029f6c8e1e79854ae74efb816;hp=772b678f9dded0cc20b25faf8f519278e9dd81de;hb=cc9b18cf01e91da8c8902923916946d8668f7cbd;hpb=a2d288bc0361884aa6e2fa953ef2766e3e1a90e7 diff --git a/src/yaz-proxy-config.cpp b/src/yaz-proxy-config.cpp index 772b678..2102e9a 100644 --- a/src/yaz-proxy-config.cpp +++ b/src/yaz-proxy-config.cpp @@ -1,4 +1,4 @@ -/* $Id: yaz-proxy-config.cpp,v 1.5 2004-08-10 09:02:16 adam Exp $ +/* $Id: yaz-proxy-config.cpp,v 1.6 2004-08-29 13:01:43 adam Exp $ Copyright (c) 1998-2004, Index Data. This file is part of the yaz-proxy. @@ -447,7 +447,8 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, Odr_oid *syntax, Z_RecordComposition *comp, char **addinfo, char **stylesheet, char **schema, - char **backend_type) + char **backend_type, + char **backend_charset) { if (stylesheet) { @@ -464,6 +465,11 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, xfree (*backend_type); *backend_type = 0; } + if (backend_charset) + { + xfree (*backend_charset); + *backend_charset = 0; + } #if HAVE_XSLT int syntax_has_matched = 0; xmlNodePtr ptr; @@ -483,6 +489,7 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, const char *match_stylesheet = 0; const char *match_identifier = 0; const char *match_backend_type = 0; + const char *match_backend_charset = 0; struct _xmlAttr *attr; for (attr = ptr->properties; attr; attr = attr->next) { @@ -505,6 +512,10 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, attr->children && attr->children->type == XML_TEXT_NODE) match_backend_type = (const char *) attr->children->content; + if (!strcmp((const char *) attr->name, "backendcharset") && + attr->children && attr->children->type == XML_TEXT_NODE) + match_backend_charset = (const char *) + attr->children->content; } if (match_type) { @@ -547,6 +558,11 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, xfree(*backend_type); *backend_type = xstrdup(match_backend_type); } + if (backend_charset && match_backend_charset) + { + xfree(*backend_charset); + *backend_charset = xstrdup(match_backend_charset); + } if (match_marcxml) { return -1;