X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Ffilter_multi.cpp;h=6866f3d174e49bf9aa4d485d61d2d1ffae559bee;hb=c8c77a99eb358f5dafeeb9d175a3f3a77520f741;hp=a91fc7ab7c65f196dad9a7d891e432f1e2b7e99b;hpb=2e6b6e87fae70c8acbcd7c428ca511d7095f1d55;p=metaproxy-moved-to-github.git diff --git a/src/filter_multi.cpp b/src/filter_multi.cpp index a91fc7a..6866f3d 100644 --- a/src/filter_multi.cpp +++ b/src/filter_multi.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_multi.cpp,v 1.6 2006-01-17 18:55:55 adam Exp $ +/* $Id: filter_multi.cpp,v 1.8 2006-01-18 10:57:27 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -87,7 +87,7 @@ namespace yp2 { private: boost::mutex m_sessions_mutex; std::mapm_maps; - + std::map m_target_route; boost::mutex m_mutex; boost::condition m_cond_session_ready; std::map m_clients; @@ -301,6 +301,7 @@ void yf::Multi::Frontend::init(Package &package, Z_GDU *gdu) Backend *b = new Backend; b->m_vhost = *t_it; + b->m_route = m_p->m_target_route[*t_it]; // b->m_route unset b->m_package = PackagePtr(new Package(s, package.origin())); @@ -316,9 +317,11 @@ void yf::Multi::Frontend::init(Package &package, Z_GDU *gdu) BackendPtr b = *bit; Z_APDU *init_apdu = zget_APDU(odr, Z_APDU_initRequest); - yaz_oi_set_string_oidval(&init_apdu->u.initRequest->otherInfo, odr, - VAL_PROXY, 1, b->m_vhost.c_str()); - + std::listvhost_one; + vhost_one.push_back(b->m_vhost); + yp2::util::set_vhost_otherinfo(&init_apdu->u.initRequest->otherInfo, + odr, vhost_one); + Z_InitRequest *req = init_apdu->u.initRequest; ODR_MASK_SET(req->options, Z_Options_search); @@ -772,7 +775,14 @@ void yp2::filter::Multi::configure(const xmlNode * ptr) { if (ptr->type != XML_ELEMENT_NODE) continue; - if (!strcmp((const char *) ptr->name, "virtual")) + if (!strcmp((const char *) ptr->name, "target")) + { + std::string route = yp2::xml::get_route(ptr); + std::string target = yp2::xml::get_text(ptr); + std::cout << "route=" << route << " target=" << target << "\n"; + m_p->m_target_route[target] = route; + } + else if (!strcmp((const char *) ptr->name, "virtual")) { std::list targets; std::string vhost;