- std::list<std::string> targets;
- std::string vhost;
- xmlNode *v_node = ptr->children;
- for (; v_node; v_node = v_node->next)
- {
- if (v_node->type != XML_ELEMENT_NODE)
- continue;
-
- if (mp::xml::is_element_yp2(v_node, "vhost"))
- vhost = mp::xml::get_text(v_node);
- else if (mp::xml::is_element_yp2(v_node, "target"))
- targets.push_back(mp::xml::get_text(v_node));
- else
- throw mp::filter::FilterException
- ("Bad element "
- + std::string((const char *) v_node->name)
- + " in virtual section"
- );
- }
- std::string route = mp::xml::get_route(ptr);
- add_map_host2hosts(vhost, targets, route);
- std::list<std::string>::const_iterator it;
- for (it = targets.begin(); it != targets.end(); it++)
- {
- std::cout << "Add " << vhost << "->" << *it
- << "," << route << "\n";
- }