vhost info. remove_vhost_otherinfo removes and returns (old) value.
-/* $Id: filter_auth_simple.cpp,v 1.20 2006-06-10 14:29:12 adam Exp $
+/* $Id: filter_auth_simple.cpp,v 1.21 2006-08-30 12:27:34 adam Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
std::list<std::string> targets;
Z_OtherInformation *otherInfo = initReq->otherInfo;
- mp::util::get_vhost_otherinfo(&otherInfo, 1, targets);
+ mp::util::get_vhost_otherinfo(otherInfo, targets);
// Check each of the targets specified in the otherInfo package
std::list<std::string>::iterator i;
-/* $Id: filter_multi.cpp,v 1.23 2006-08-09 12:27:18 adam Exp $
+/* $Id: filter_multi.cpp,v 1.24 2006-08-30 12:27:34 adam Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
std::list<std::string> targets;
- mp::util::get_vhost_otherinfo(&req->otherInfo, false, targets);
+ mp::util::get_vhost_otherinfo(req->otherInfo, targets);
if (targets.size() < 1)
{
-/* $Id: filter_virt_db.cpp,v 1.44 2006-08-01 13:24:53 adam Exp $
+/* $Id: filter_virt_db.cpp,v 1.45 2006-08-30 12:27:34 adam Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
Z_InitRequest *req = gdu->u.z3950->u.initRequest;
std::list<std::string> vhosts;
- mp::util::get_vhost_otherinfo(&req->otherInfo, false, vhosts);
+ mp::util::get_vhost_otherinfo(req->otherInfo, vhosts);
if (vhosts.size() == 0)
{
f->m_init_gdu = gdu;
-/* $Id: filter_z3950_client.cpp,v 1.27 2006-06-21 14:34:16 adam Exp $
+/* $Id: filter_z3950_client.cpp,v 1.28 2006-08-30 12:27:34 adam Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
return 0;
}
std::list<std::string> vhosts;
- mp::util::get_vhost_otherinfo(&apdu->u.initRequest->otherInfo,
- true, vhosts);
+ mp::util::remove_vhost_otherinfo(&apdu->u.initRequest->otherInfo, vhosts);
size_t no_vhosts = vhosts.size();
if (no_vhosts == 0)
{
-/* $Id: util.cpp,v 1.18 2006-06-19 23:54:02 adam Exp $
+/* $Id: util.cpp,v 1.19 2006-08-30 12:27:34 adam Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
}
}
-int mp_util::get_vhost_otherinfo(
+int mp_util::get_or_remove_vhost_otherinfo(
Z_OtherInformation **otherInformation,
bool remove_flag,
std::list<std::string> &vhosts)
return cat;
}
+void mp_util::get_vhost_otherinfo(
+ Z_OtherInformation *otherInformation,
+ std::list<std::string> &vhosts)
+{
+ get_or_remove_vhost_otherinfo(&otherInformation, false, vhosts);
+}
+
+int mp_util::remove_vhost_otherinfo(
+ Z_OtherInformation **otherInformation,
+ std::list<std::string> &vhosts)
+{
+ return get_or_remove_vhost_otherinfo(otherInformation, true, vhosts);
+}
+
void mp_util::set_vhost_otherinfo(
Z_OtherInformation **otherInformation, ODR odr,
const std::list<std::string> &vhosts)
-/* $Id: util.hpp,v 1.17 2006-06-19 23:54:02 adam Exp $
+/* $Id: util.hpp,v 1.18 2006-08-30 12:27:34 adam Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
void split_zurl(std::string zurl, std::string &host,
std::list<std::string> &db);
-
- int get_vhost_otherinfo(Z_OtherInformation **otherInformation,
- bool remove_flag,
- std::list<std::string> &vhosts);
+
+ void get_vhost_otherinfo(Z_OtherInformation *otherInformation,
+ std::list<std::string> &vhosts);
+
+ int remove_vhost_otherinfo(Z_OtherInformation **otherInformation,
+ std::list<std::string> &vhosts);
void set_vhost_otherinfo(Z_OtherInformation **otherInformation,
ODR odr,
const std::list<std::string> &vhosts);
+ int get_or_remove_vhost_otherinfo(
+ Z_OtherInformation **otherInformation,
+ bool remove_flag,
+ std::list<std::string> &vhosts);
+
void get_init_diagnostics(Z_InitResponse *res,
int &error_code, std::string &addinfo);