projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update for new PDF rules.
[metaproxy-moved-to-github.git]
/
src
/
ex_filter_frontend_net.cpp
diff --git
a/src/ex_filter_frontend_net.cpp
b/src/ex_filter_frontend_net.cpp
index
2abf158
..
4e41894
100644
(file)
--- a/
src/ex_filter_frontend_net.cpp
+++ b/
src/ex_filter_frontend_net.cpp
@@
-1,7
+1,7
@@
-/* $Id: ex_filter_frontend_net.cpp,v 1.22 2006-01-11 11:51:49 adam Exp $
- Copyright (c) 2005, Index Data.
+/* $Id: ex_filter_frontend_net.cpp,v 1.29 2007-01-25 14:05:54 adam Exp $
+ Copyright (c) 2005-2007, Index Data.
-%LICENSE%
+ See the LICENSE file for details
*/
#include "config.hpp"
*/
#include "config.hpp"
@@
-25,9
+25,11
@@
namespace po = boost::program_options;
#include "session.hpp"
#include "package.hpp"
#include "session.hpp"
#include "package.hpp"
-class HTTPFilter: public yp2::filter::Base {
+namespace mp = metaproxy_1;
+
+class HTTPFilter: public mp::filter::Base {
public:
public:
- void process(yp2::Package & package) const {
+ void process(mp::Package & package) const {
if (package.session().is_closed())
{
// std::cout << "Got Close.\n";
if (package.session().is_closed())
{
// std::cout << "Got Close.\n";
@@
-36,7
+38,7
@@
public:
Z_GDU *gdu = package.request().get();
if (gdu && gdu->which == Z_GDU_HTTP_Request)
{
Z_GDU *gdu = package.request().get();
if (gdu && gdu->which == Z_GDU_HTTP_Request)
{
- yp2::odr odr;
+ mp::odr odr;
Z_GDU *gdu = z_get_HTTP_Response(odr, 200);
Z_HTTP_Response *http_res = gdu->u.HTTP_Response;
Z_GDU *gdu = z_get_HTTP_Response(odr, 200);
Z_HTTP_Response *http_res = gdu->u.HTTP_Response;
@@
-86,10
+88,10
@@
int main(int argc, char **argv)
for (size_t i = 0; i<ports.size(); i++)
std::cout << "port " << i << " " << ports[i] << "\n";
for (size_t i = 0; i<ports.size(); i++)
std::cout << "port " << i << " " << ports[i] << "\n";
- yp2::RouterChain router;
+ mp::RouterChain router;
// put frontend filter in router
// put frontend filter in router
- yp2::filter::FrontendNet filter_front;
+ mp::filter::FrontendNet filter_front;
filter_front.ports() = ports;
// 0=no time, >0 timeout in seconds
filter_front.ports() = ports;
// 0=no time, >0 timeout in seconds
@@
-99,22
+101,22
@@
int main(int argc, char **argv)
router.append(filter_front);
// put log filter in router
router.append(filter_front);
// put log filter in router
- yp2::filter::Log filter_log_front("FRONT");
+ mp::filter::Log filter_log_front("FRONT");
router.append(filter_log_front);
// put Virt db filter in router
router.append(filter_log_front);
// put Virt db filter in router
- yp2::filter::Virt_db filter_virt_db;
- filter_virt_db.add_map_db2vhost("gils", "indexdata.dk/gils",
+ mp::filter::VirtualDB filter_virt_db;
+ filter_virt_db.add_map_db2target("gils", "indexdata.dk/gils",
"");
"");
- filter_virt_db.add_map_db2vhost("Default", "localhost:9999/Default",
+ filter_virt_db.add_map_db2target("Default", "localhost:9999/Default",
"");
"");
- filter_virt_db.add_map_db2vhost("2", "localhost:9999/2", "");
- // router.append(filter_virt_db);
+ filter_virt_db.add_map_db2target("2", "localhost:9999/Slow", "");
+ router.append(filter_virt_db);
- yp2::filter::SessionShared filter_session_shared;
+ mp::filter::SessionShared filter_session_shared;
//router.append(filter_session_shared);
//router.append(filter_session_shared);
- yp2::filter::Log filter_log_back("BACK");
+ mp::filter::Log filter_log_back("BACK");
router.append(filter_log_back);
// put HTTP backend filter in router
router.append(filter_log_back);
// put HTTP backend filter in router
@@
-122,12
+124,12
@@
int main(int argc, char **argv)
router.append(filter_init);
// put Z39.50 backend filter in router
router.append(filter_init);
// put Z39.50 backend filter in router
- yp2::filter::Z3950Client z3950_client;
+ mp::filter::Z3950Client z3950_client;
router.append(z3950_client);
router.append(z3950_client);
- yp2::Session session;
- yp2::Origin origin;
- yp2::Package pack(session, origin);
+ mp::Session session;
+ mp::Origin origin;
+ mp::Package pack(session, origin);
pack.router(router).move();
}
pack.router(router).move();
}