-/* $Id: filter_auth_simple.cpp,v 1.18 2006-03-16 10:40:59 adam Exp $
+/* $Id: filter_auth_simple.cpp,v 1.19 2006-05-15 11:43:01 adam Exp $
Copyright (c) 2005-2006, Index Data.
%LICENSE%
static bool contains(std::list<std::string> list, std::string thing) {
std::list<std::string>::const_iterator i;
for (i = list.begin(); i != list.end(); i++)
- if (*i == thing)
+ if (mp::util::database_name_normalize(*i) ==
+ mp::util::database_name_normalize(thing))
return true;
-
+
return false;
}
-/* $Id: filter_virt_db.cpp,v 1.37 2006-04-29 08:09:13 adam Exp $
+/* $Id: filter_virt_db.cpp,v 1.38 2006-05-15 11:43:01 adam Exp $
Copyright (c) 2005-2006, Index Data.
%LICENSE%
FrontendPtr get_frontend(Package &package);
void release_frontend(Package &package);
private:
- boost::mutex m_sessions_mutex;
std::map<std::string, Virt_db::Map>m_maps;
-
typedef std::map<std::string,Virt_db::Set>::iterator Sets_it;
-
boost::mutex m_mutex;
boost::condition m_cond_session_ready;
std::map<mp::Session, FrontendPtr> m_clients;
}
}
-using namespace mp;
-
yf::Virt_db::BackendPtr yf::Virt_db::Frontend::lookup_backend_from_databases(
std::list<std::string> databases)
{
for (; db_it != databases.end(); db_it++)
{
std::map<std::string, Virt_db::Map>::iterator map_it;
- map_it = m_p->m_maps.find(*db_it);
+ map_it = m_p->m_maps.find(mp::util::database_name_normalize(*db_it));
if (map_it == m_p->m_maps.end()) // database not found
{
error_code = YAZ_BIB1_DATABASE_UNAVAILABLE;
std::list<std::string> targets,
std::string route)
{
- m_p->m_maps[db] = Virt_db::Map(targets, route);
+ m_p->m_maps[mp::util::database_name_normalize(db)]
+ = Virt_db::Map(targets, route);
}
std::list<std::string> targets;
targets.push_back(target);
- m_p->m_maps[db] = Virt_db::Map(targets, route);
+ m_p->m_maps[mp::util::database_name_normalize(db)]
+ = Virt_db::Map(targets, route);
}
void yf::Virt_db::process(Package &package) const
-/* $Id: util.cpp,v 1.14 2006-03-16 10:40:59 adam Exp $
+/* $Id: util.cpp,v 1.15 2006-05-15 11:43:01 adam Exp $
Copyright (c) 2005-2006, Index Data.
%LICENSE%
namespace mp = metaproxy_1;
+std::string mp::util::database_name_normalize(const std::string &s)
+{
+ std::string r = s;
+ size_t i;
+ for (i = 0; i < r.length(); i++)
+ {
+ int ch = r[i];
+ if (ch >= 'A' && ch <= 'Z')
+ r[i] = ch + 'a' - 'A';
+ }
+ return r;
+
+}
+
void mp::util::piggyback(int smallSetUpperBound,
int largeSetLowerBound,
int mediumSetPresentNumber,
-/* $Id: util.hpp,v 1.13 2006-03-16 10:40:59 adam Exp $
+/* $Id: util.hpp,v 1.14 2006-05-15 11:43:01 adam Exp $
Copyright (c) 2005-2006, Index Data.
%LICENSE%
namespace metaproxy_1 {
namespace util {
+ std::string database_name_normalize(const std::string &s);
+
bool pqf(ODR odr, Z_APDU *apdu, const std::string &q);
std::string zQueryToString(Z_Query *query);