From a9a65a522caf3161208023338c1350ff215f38c2 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 18 Jan 2006 09:20:30 +0000 Subject: [PATCH] Allow multi filter to do re-routing based on virtual target, i.e. vtarget --- src/filter_multi.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/filter_multi.cpp b/src/filter_multi.cpp index a91fc7a..7e847d4 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.7 2006-01-18 09:20:30 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())); @@ -772,7 +773,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; -- 1.7.10.4