From f35887e8d3cdddd8ea51e5c6a6ade1ba69225d1f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 16 Jan 2006 16:05:50 +0000 Subject: [PATCH] Filter virt_db returns first unsvailable database as addinfo --- src/filter_virt_db.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/filter_virt_db.cpp b/src/filter_virt_db.cpp index 1ad040c..b35ed7c 100644 --- a/src/filter_virt_db.cpp +++ b/src/filter_virt_db.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_virt_db.cpp,v 1.26 2006-01-16 15:51:56 adam Exp $ +/* $Id: filter_virt_db.cpp,v 1.27 2006-01-16 16:05:50 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -72,7 +72,8 @@ namespace yp2 { BackendPtr lookup_backend_from_databases( std::list databases); BackendPtr create_backend_from_databases( - std::list databases); + std::list databases, + std::string &failing_database); BackendPtr init_backend(std::list database, Package &package, @@ -113,7 +114,7 @@ yf::Virt_db::BackendPtr yf::Virt_db::Frontend::lookup_backend_from_databases( } yf::Virt_db::BackendPtr yf::Virt_db::Frontend::create_backend_from_databases( - std::list databases) + std::list databases, std::string &failing_database) { BackendPtr b(new Backend); std::list::const_iterator db_it = databases.begin(); @@ -129,6 +130,7 @@ yf::Virt_db::BackendPtr yf::Virt_db::Frontend::create_backend_from_databases( map_it = m_p->m_maps.find(*db_it); if (map_it == m_p->m_maps.end()) // database not found { + failing_database = *db_it; BackendPtr ptr; return ptr; } @@ -156,11 +158,12 @@ yf::Virt_db::BackendPtr yf::Virt_db::Frontend::init_backend( std::list databases, Package &package, int &error_code, std::string &addinfo) { - BackendPtr b = create_backend_from_databases(databases); + std::string failing_database; + BackendPtr b = create_backend_from_databases(databases, failing_database); if (!b) { error_code = YAZ_BIB1_DATABASE_UNAVAILABLE; - // addinfo = database; + addinfo = failing_database; return b; } Package init_package(b->m_backend_session, package.origin()); -- 1.7.10.4