From 0b89dffba19f762e1d34455f3030d8b8deea2db4 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sat, 4 Oct 2003 06:44:16 +0000 Subject: [PATCH] Fix non-libxml2 compilation --- src/config.xml | 2 +- src/yaz-proxy-config.cpp | 13 +++++++++++-- src/yaz-proxy.cpp | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/config.xml b/src/config.xml index c466a8d..af63747 100644 --- a/src/config.xml +++ b/src/config.xml @@ -3,7 +3,7 @@ - z3950.loc.gov:7090/voyager + z3950.loc.gov:7094/voyager 1 200000 diff --git a/src/yaz-proxy-config.cpp b/src/yaz-proxy-config.cpp index 329a037..6132ed7 100644 --- a/src/yaz-proxy-config.cpp +++ b/src/yaz-proxy-config.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2003, Index Data. * See the file LICENSE for details. * - * $Id: yaz-proxy-config.cpp,v 1.2 2003-10-03 13:01:42 adam Exp $ + * $Id: yaz-proxy-config.cpp,v 1.3 2003-10-04 06:44:16 adam Exp $ */ #include @@ -173,6 +173,7 @@ void Yaz_ProxyConfig::return_target_info(xmlNodePtr ptr, } #endif +#if HAVE_XML2 int Yaz_ProxyConfig::check_type_1_attributes(ODR odr, xmlNodePtr ptr, Z_AttributeList *attrs, char **addinfo) @@ -241,7 +242,9 @@ int Yaz_ProxyConfig::check_type_1_attributes(ODR odr, xmlNodePtr ptr, } return 0; } +#endif +#if HAVE_XML2 int Yaz_ProxyConfig::check_type_1_structure(ODR odr, xmlNodePtr ptr, Z_RPNStructure *q, char **addinfo) @@ -266,17 +269,21 @@ int Yaz_ProxyConfig::check_type_1_structure(ODR odr, xmlNodePtr ptr, } return 0; } +#endif +#if HAVE_XML2 int Yaz_ProxyConfig::check_type_1(ODR odr, xmlNodePtr ptr, Z_RPNQuery *query, char **addinfo) { // possibly check for Bib-1 return check_type_1_structure(odr, ptr, query->RPNStructure, addinfo); } +#endif int Yaz_ProxyConfig::check_query(ODR odr, const char *name, Z_Query *query, char **addinfo) { +#if HAVE_XML2 xmlNodePtr ptr; ptr = find_target_node(name); @@ -285,9 +292,11 @@ int Yaz_ProxyConfig::check_query(ODR odr, const char *name, Z_Query *query, if (query->which == Z_Query_type_1 || query->which == Z_Query_type_101) return check_type_1(odr, ptr, query->u.type_1, addinfo); } +#endif return 0; } +#if HAVE_XML2 xmlNodePtr Yaz_ProxyConfig::find_target_node(const char *name) { xmlNodePtr ptr; @@ -333,7 +342,7 @@ xmlNodePtr Yaz_ProxyConfig::find_target_node(const char *name) } return 0; } - +#endif void Yaz_ProxyConfig::get_target_info(const char *name, const char **url, diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 1390f96..0f4678a 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2003, Index Data. * See the file LICENSE for details. * - * $Id: yaz-proxy.cpp,v 1.49 2003-10-03 13:01:42 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.50 2003-10-04 06:44:16 adam Exp $ */ #include @@ -171,7 +171,7 @@ Yaz_ProxyClient *Yaz_Proxy::get_client(Z_APDU *apdu) if (!m_proxyTarget) { const char *proxy_host = get_proxy(oi); - if (!proxy_host) + if (proxy_host) { xfree(m_default_target); m_default_target = xstrdup(proxy_host); -- 1.7.10.4