-/* $Id: ex_filter_frontend_net.cpp,v 1.9 2005-10-25 15:19:58 adam Exp $
+/* $Id: ex_filter_frontend_net.cpp,v 1.20 2006-01-04 11:19:04 adam Exp $
Copyright (c) 2005, Index Data.
%LICENSE%
#include "config.hpp"
+#include "util.hpp"
#include "filter_frontend_net.hpp"
#include "filter_z3950_client.hpp"
#include "filter_virt_db.hpp"
+#include "filter_session_shared.hpp"
#include "filter_log.hpp"
-#include "router.hpp"
+#include "router_chain.hpp"
#include "session.hpp"
#include "package.hpp"
Z_GDU *gdu = package.request().get();
if (gdu && gdu->which == Z_GDU_HTTP_Request)
{
- ODR odr = odr_createmem(ODR_ENCODE);
+ yp2::odr odr;
Z_GDU *gdu = z_get_HTTP_Response(odr, 200);
Z_HTTP_Response *http_res = gdu->u.HTTP_Response;
http_res->content_len = strlen(http_res->content_buf);
package.response() = gdu;
- odr_destroy(odr);
}
return package.move();
};
if (vm.count("duration")) {
filter_front.listen_duration() = vm["duration"].as<int>();
}
- router.rule(filter_front);
+ router.append(filter_front);
// put log filter in router
- yp2::filter::Log filter_log;
- router.rule(filter_log);
+ yp2::filter::Log filter_log_front("FRONT");
+ router.append(filter_log_front);
// put Virt db filter in router
yp2::filter::Virt_db filter_virt_db;
- filter_virt_db.add_map_db2vhost("Default", "indexdata.dk/gils");
+ filter_virt_db.add_map_db2vhost("gils", "indexdata.dk/gils");
+ filter_virt_db.add_map_db2vhost("Default", "localhost:9999/Default");
+ filter_virt_db.add_map_db2vhost("2", "localhost:9999/2");
+ // router.append(filter_virt_db);
- router.rule(filter_virt_db);
+ yp2::filter::SessionShared filter_session_shared;
+ //router.append(filter_session_shared);
+
+ yp2::filter::Log filter_log_back("BACK");
+ router.append(filter_log_back);
// put HTTP backend filter in router
HTTPFilter filter_init;
- router.rule(filter_init);
+ router.append(filter_init);
// put Z39.50 backend filter in router
yp2::filter::Z3950Client z3950_client;
- router.rule(z3950_client);
+ router.append(z3950_client);
yp2::Session session;
yp2::Origin origin;