X-Git-Url: http://git.indexdata.com/?p=yazproxy-moved-to-github.git;a=blobdiff_plain;f=src%2Fyaz-proxy-config.cpp;h=18a49dd4bae55834e81b0b32008c0fa716957162;hp=82941092e4c405632fc57d171af46268469a9e16;hb=4f79f9b5b0095b2f81b1ce583f0f82462f9ee36a;hpb=5e44f9e8b9c90d13e59169f966bec3593047f603 diff --git a/src/yaz-proxy-config.cpp b/src/yaz-proxy-config.cpp index 8294109..18a49dd 100644 --- a/src/yaz-proxy-config.cpp +++ b/src/yaz-proxy-config.cpp @@ -1,5 +1,5 @@ /* This file is part of YAZ proxy - Copyright (C) 1998-2008 Index Data + Copyright (C) 1998-2011 Index Data YAZ proxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -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); @@ -389,7 +389,7 @@ int Yaz_ProxyConfigP::check_type_1_attributes(ODR odr, xmlNodePtr ptrl, if (!el->attributeType) continue; int type = *el->attributeType; - int *value = 0; + Odr_int *value = 0; if (el->which == Z_AttributeValue_numeric && el->value.numeric) value = el->value.numeric; @@ -429,7 +429,7 @@ int Yaz_ProxyConfigP::check_type_1_attributes(ODR odr, xmlNodePtr ptrl, { if (!match_list(*value, match_value)) continue; - sprintf (addinfo_str, "%d", *value); + sprintf (addinfo_str, ODR_INT_PRINTF, *value); } else continue; @@ -830,7 +830,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); @@ -1277,11 +1277,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); @@ -1367,6 +1367,7 @@ void Yaz_ProxyConfig::get_target_info(const char *name, /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab