From 155b86cb13bcc6d1055b2a26856f7e4195f496bd Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 29 Jul 2011 16:19:07 +0200 Subject: [PATCH] zoom: add facililty to dump APDUs. Triggered by in the zoom filter configuation. --- src/filter_zoom.cpp | 21 +++++++++++++++++++-- xml/schema/filter_zoom.rnc | 3 +++ xml/schema/filter_zoom.rng | 9 +++++++++ xml/schema/filter_zoom.xsd | 6 ++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 2ac339d..f2b8f54 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -145,6 +145,7 @@ namespace metaproxy_1 { std::string file_path; std::string content_proxy_server; std::string content_tmp_file; + bool apdu_log; CCL_bibset bibset; std::string element_transform; std::string element_raw; @@ -360,7 +361,8 @@ void yf::Zoom::Impl::release_frontend(mp::Package &package) } } -yf::Zoom::Impl::Impl() : element_transform("pz2") , element_raw("raw") +yf::Zoom::Impl::Impl() : + apdu_log(false), element_transform("pz2") , element_raw("raw") { bibset = ccl_qual_mk(); } @@ -587,6 +589,19 @@ void yf::Zoom::Impl::configure(const xmlNode *ptr, bool test_only, attr->name)); } } + else if (!strcmp((const char *) ptr->name, "log")) + { + const struct _xmlAttr *attr; + for (attr = ptr->properties; attr; attr = attr->next) + { + if (!strcmp((const char *) attr->name, "apdu")) + apdu_log = mp::xml::get_bool(attr->children, false); + else + throw mp::filter::FilterException( + "Bad attribute " + std::string((const char *) + attr->name)); + } + } else { throw mp::filter::FilterException @@ -713,7 +728,9 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( b->set_option("rpnCharset", sptr->query_encoding); b->set_option("timeout", "40"); - + + if (m_p->apdu_log) + b->set_option("apdulog", "1"); std::string authentication = sptr->authentication; std::string proxy = sptr->cfProxy; diff --git a/xml/schema/filter_zoom.rnc b/xml/schema/filter_zoom.rnc index 40ff2ca..3696773 100644 --- a/xml/schema/filter_zoom.rnc +++ b/xml/schema/filter_zoom.rnc @@ -53,6 +53,9 @@ filter_zoom = element mp:contentProxy { attribute server { xsd:string }?, attribute tmp_file { xsd:string }? + }?, + element mp:log { + attribute apdu { xsd:boolean }? }? diff --git a/xml/schema/filter_zoom.rng b/xml/schema/filter_zoom.rng index bffc0cc..6b69c99 100644 --- a/xml/schema/filter_zoom.rng +++ b/xml/schema/filter_zoom.rng @@ -193,5 +193,14 @@ + + + + + + + + + diff --git a/xml/schema/filter_zoom.xsd b/xml/schema/filter_zoom.xsd index 13ec017..a9b5def 100644 --- a/xml/schema/filter_zoom.xsd +++ b/xml/schema/filter_zoom.xsd @@ -9,6 +9,7 @@ + @@ -110,6 +111,11 @@ + + + + + -- 1.7.10.4