+ vhosts.push_back(std::string(vhost));
+ }
+ --cat;
+ 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)
+{
+ int cat;
+ std::list<std::string>::const_iterator it = vhosts.begin();
+ for (cat = 1; it != vhosts.end() ; cat++, it++)
+ {
+ yaz_oi_set_string_oidval(otherInformation, odr,
+ VAL_PROXY, cat, it->c_str());
+ }
+}
+
+void mp_util::split_zurl(std::string zurl, std::string &host,
+ std::list<std::string> &db)
+{
+ const char *zurl_cstr = zurl.c_str();
+ const char *sep = strchr(zurl_cstr, '/');
+
+ if (sep)
+ {
+ host = std::string(zurl_cstr, sep - zurl_cstr);
+
+ const char *cp1 = sep+1;
+ while(1)
+ {
+ const char *cp2 = strchr(cp1, '+');
+ if (cp2)
+ db.push_back(std::string(cp1, cp2 - cp1));
+ else
+ {
+ db.push_back(std::string(cp1));
+ break;
+ }
+ cp1 = cp2+1;