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
Deciding rules for within
[metaproxy-moved-to-github.git]
/
src
/
filter_bounce.cpp
diff --git
a/src/filter_bounce.cpp
b/src/filter_bounce.cpp
index
56cdb6d
..
4a6e099
100644
(file)
--- a/
src/filter_bounce.cpp
+++ b/
src/filter_bounce.cpp
@@
-1,5
+1,5
@@
/* This file is part of Metaproxy.
/* This file is part of Metaproxy.
- Copyright (C) 2005-2010 Index Data
+ Copyright (C) 2005-2013 Index Data
Metaproxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Metaproxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-17,23
+17,14
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "filter_bounce.hpp"
*/
#include "filter_bounce.hpp"
-#include "package.hpp"
-#include "util.hpp"
+#include <metaproxy/package.hpp>
+#include <metaproxy/util.hpp>
#include "gduutil.hpp"
#include <yaz/zgdu.h>
#include <sstream>
#include "gduutil.hpp"
#include <yaz/zgdu.h>
#include <sstream>
-//#include "config.hpp"
-//#include "filter.hpp"
-
-//#include <boost/thread/mutex.hpp>
-
-
-
-
-
namespace mp = metaproxy_1;
namespace yf = mp::filter;
namespace mp = metaproxy_1;
namespace yf = mp::filter;
@@
-63,18
+54,18
@@
void yf::Bounce::process(mp::Package &package) const
return;
}
package.session().close();
return;
}
package.session().close();
-
+
Z_GDU *zgdu = package.request().get();
Z_GDU *zgdu = package.request().get();
-
+
if (!zgdu)
return;
if (!zgdu)
return;
-
+
//std::string message("BOUNCE ");
//std::string message("BOUNCE ");
- std::ostringstream message;
+ std::ostringstream message;
message << "BOUNCE " << *zgdu;
message << "BOUNCE " << *zgdu;
-
- metaproxy_1::odr odr;
-
+
+ metaproxy_1::odr odr;
+
if (zgdu->which == Z_GDU_Z3950)
{
Z_APDU *apdu_res = 0;
if (zgdu->which == Z_GDU_Z3950)
{
Z_APDU *apdu_res = 0;
@@
-86,20
+77,26
@@
void yf::Bounce::process(mp::Package &package) const
else if (zgdu->which == Z_GDU_HTTP_Request)
{
Z_GDU *zgdu_res = 0;
else if (zgdu->which == Z_GDU_HTTP_Request)
{
Z_GDU *zgdu_res = 0;
- zgdu_res
- = odr.create_HTTP_Response(package.session(),
+ zgdu_res
+ = odr.create_HTTP_Response(package.session(),
zgdu->u.HTTP_Request, 400);
zgdu->u.HTTP_Request, 400);
-
+
package.response() = zgdu_res;
}
else if (zgdu->which == Z_GDU_HTTP_Response)
{
}
package.response() = zgdu_res;
}
else if (zgdu->which == Z_GDU_HTTP_Response)
{
}
-
+
return;
}
return;
}
+void mp::filter::Bounce::configure(const xmlNode * ptr, bool test_only,
+ const char *path)
+{
+ mp::xml::check_empty(ptr);
+}
+
static mp::filter::Base* filter_creator()
{
return new mp::filter::Bounce;
static mp::filter::Base* filter_creator()
{
return new mp::filter::Bounce;