X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;ds=sidebyside;f=src%2Fyaz-proxy-config.cpp;h=4f19e06beff2f0ad20f336a3c5c68c389116834d;hb=2bfdeda2d9f42b091c9250a44ccda63cc9bdc723;hp=55e39ac60304fb3b60af9fbe80a97d5c502b8ab0;hpb=82b0575e71269b113acb2bb7c7541a470ed07c9a;p=yazproxy-moved-to-github.git diff --git a/src/yaz-proxy-config.cpp b/src/yaz-proxy-config.cpp index 55e39ac..4f19e06 100644 --- a/src/yaz-proxy-config.cpp +++ b/src/yaz-proxy-config.cpp @@ -208,7 +208,7 @@ void Yaz_ProxyConfigP::return_limit(xmlNodePtr ptr, if (t) *limit_pdu = atoi(t); } - if (ptr->type == XML_ELEMENT_NODE + if (ptr->type == XML_ELEMENT_NODE && !strcmp((const char *) ptr->name, "search")) { const char *t = get_text(ptr); @@ -268,11 +268,11 @@ void Yaz_ProxyConfigP::return_target_info(xmlNodePtr ptr, return_limit(ptr, keepalive_limit_bw, keepalive_limit_pdu, &dummy, &dummy); } - if (ptr->type == XML_ELEMENT_NODE + if (ptr->type == XML_ELEMENT_NODE && !strcmp((const char *) ptr->name, "limit")) return_limit(ptr, limit_bw, limit_pdu, limit_req, limit_search); - if (ptr->type == XML_ELEMENT_NODE + if (ptr->type == XML_ELEMENT_NODE && !strcmp((const char *) ptr->name, "target-timeout")) { const char *t = get_text(ptr); @@ -729,7 +729,8 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, char **backend_type, char **backend_charset, char **usemarcon_ini_stage1, - char **usemarcon_ini_stage2 + char **usemarcon_ini_stage2, + char **backend_elementset ) { if (stylesheet) @@ -762,6 +763,8 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, xfree (*usemarcon_ini_stage2); *usemarcon_ini_stage2 = 0; } + xfree(*backend_elementset); + *backend_elementset = 0; #if YAZ_HAVE_XSLT int syntax_has_matched = 0; xmlNodePtr ptr; @@ -784,6 +787,7 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, const char *match_backend_charset = 0; const char *match_usemarcon_ini_stage1 = 0; const char *match_usemarcon_ini_stage2 = 0; + const char *match_elementset = 0; struct _xmlAttr *attr; for (attr = ptr->properties; attr; attr = attr->next) { @@ -818,6 +822,9 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, attr->children && attr->children->type == XML_TEXT_NODE) match_usemarcon_ini_stage2 = (const char *) attr->children->content; + if (!strcmp((const char *) attr->name, "backendelementset") && + attr->children && attr->children->type == XML_TEXT_NODE) + match_elementset = (const char *) attr->children->content; } if (match_type) { @@ -830,7 +837,7 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, } else if (syntax) { - Odr_oid *match_oid + Odr_oid *match_oid = yaz_string_to_oid_odr(yaz_oid_std(), CLASS_RECSYN, match_type, odr); @@ -867,6 +874,11 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, xfree(*backend_charset); *backend_charset = xstrdup(match_backend_charset); } + if (match_elementset) + { + xfree(*backend_elementset); + *backend_elementset = xstrdup(match_elementset); + } if (usemarcon_ini_stage1 && match_usemarcon_ini_stage1) { xfree(*usemarcon_ini_stage1); @@ -1277,11 +1289,11 @@ char *Yaz_ProxyConfig::get_explain_doc(ODR odr, const char *name, else { xmlNodePtr ptr2 = xmlCopyNode(ptr_explain, 1); - + xmlDocPtr doc = xmlNewDoc((const xmlChar *) "1.0"); - + xmlDocSetRootElement(doc, ptr2); - + xmlChar *buf_out; xmlDocDumpMemory(doc, &buf_out, len); char *content = (char*) odr_malloc(odr, *len);