From: Adam Dickmeiss Date: Mon, 30 Apr 2012 10:14:06 +0000 (+0200) Subject: virt_db: return other diagnostic if init is rejected X-Git-Tag: v1.3.35~7^2 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=7e6c60abf88038e050951cf31b322f2883e815f7;p=metaproxy-moved-to-github.git virt_db: return other diagnostic if init is rejected Diagnostic 236: "Access to specified database denied" is returned, but only if init response from backend does not carry diagnostics aleady. --- diff --git a/etc/config3.xml b/etc/config3.xml index 3ae07fd..1f73053 100644 --- a/etc/config3.xml +++ b/etc/config3.xml @@ -28,12 +28,16 @@ bagel.indexdata.dk:80 + cf + connect.indexdata.com + + gils - indexdata.dk/gils + z3950.indexdata.dk/gils marc - indexdata.dk/marc + z3950.indexdata.dk/marc1 loc diff --git a/src/filter_virt_db.cpp b/src/filter_virt_db.cpp index b583757..f2420bf 100644 --- a/src/filter_virt_db.cpp +++ b/src/filter_virt_db.cpp @@ -233,7 +233,7 @@ yf::VirtualDB::BackendPtr yf::VirtualDB::Frontend::init_backend( Z_GDU *gdu = init_package.response().get(); // we hope to get an init response - error_code = YAZ_BIB1_DATABASE_UNAVAILABLE; + error_code = 0; if (gdu && gdu->which == Z_GDU_Z3950 && gdu->u.z3950->which == Z_APDU_initResponse) { @@ -249,6 +249,13 @@ yf::VirtualDB::BackendPtr yf::VirtualDB::Frontend::init_backend( } mp::util::get_init_diagnostics(res, error_code, addinfo); } + if (error_code == 0) + { + std::list::const_iterator db_it = databases.begin(); + error_code = YAZ_BIB1_ACCESS_TO_SPECIFIED_DATABASE_DENIED; + if (db_it != databases.end()) + addinfo = *db_it; + } if (!init_package.session().is_closed()) { Package close_package(b->m_backend_session, package.origin());