From 9b6f7c3b6c45c1a2d818d4c7535cf08c4dfb4017 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 24 Feb 2012 13:07:37 +0100 Subject: [PATCH] zoom: timeout is configurable Set as value of attribute 'timeout' in element 'zoom' of configuration. --- etc/config-zoom.xml | 1 + src/filter_zoom.cpp | 19 +++++++++++++++++-- xml/schema/filter_zoom.rnc | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/etc/config-zoom.xml b/etc/config-zoom.xml index e598527..d5e763d 100644 --- a/etc/config-zoom.xml +++ b/etc/config-zoom.xml @@ -196,6 +196,7 @@ tmp_file="/tmp/cf.XXXXXX.p" /> + diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 452c18f..055cebe 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -207,6 +207,7 @@ namespace metaproxy_1 { std::string proxy; xsltStylesheetPtr explain_xsp; std::map s_map; + std::string zoom_timeout; }; } } @@ -429,7 +430,8 @@ void yf::Zoom::Impl::release_frontend(mp::Package &package) } yf::Zoom::Impl::Impl() : - apdu_log(false), element_transform("pz2") , element_raw("raw") + apdu_log(false), element_transform("pz2") , element_raw("raw"), + zoom_timeout("40") { bibset = ccl_qual_mk(); @@ -712,6 +714,19 @@ void yf::Zoom::Impl::configure(const xmlNode *ptr, bool test_only, attr->name)); } } + else if (!strcmp((const char *) ptr->name, "zoom")) + { + const struct _xmlAttr *attr; + for (attr = ptr->properties; attr; attr = attr->next) + { + if (!strcmp((const char *) attr->name, "timeout")) + zoom_timeout = mp::xml::get_text(attr->children); + else + throw mp::filter::FilterException( + "Bad attribute " + std::string((const char *) + attr->name)); + } + } else { throw mp::filter::FilterException @@ -1065,7 +1080,7 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( if (sptr->query_encoding.length()) b->set_option("rpnCharset", sptr->query_encoding); - b->set_option("timeout", "40"); + b->set_option("timeout", m_p->zoom_timeout.c_str()); if (m_p->apdu_log) b->set_option("apdulog", "1"); diff --git a/xml/schema/filter_zoom.rnc b/xml/schema/filter_zoom.rnc index 08fb6f6..d15ebd6 100644 --- a/xml/schema/filter_zoom.rnc +++ b/xml/schema/filter_zoom.rnc @@ -66,6 +66,9 @@ filter_zoom = }?, element mp:log { attribute apdu { xsd:boolean }? + }?, + element mp:zoom { + attribute timeout { xsd:integer }? }? -- 1.7.10.4