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
Fix systemd: reload stops metaproxy MP-620
[metaproxy-moved-to-github.git]
/
example-module
/
filter_myfilter.cpp
diff --git
a/example-module/filter_myfilter.cpp
b/example-module/filter_myfilter.cpp
index
b6979ea
..
c1310c4
100644
(file)
--- a/
example-module/filter_myfilter.cpp
+++ b/
example-module/filter_myfilter.cpp
@@
-1,5
+1,5
@@
/* This file is part of Metaproxy.
/* This file is part of Metaproxy.
- Copyright (C) 2008 Index Data
+ Copyright (C) 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
@@
-19,10
+19,9
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <yaz/log.h>
#include <yaz/diagbib1.h>
#include <yaz/log.h>
#include <yaz/diagbib1.h>
-#include "config.hpp"
-#include "filter.hpp"
-#include "package.hpp"
-#include "util.hpp"
+#include <metaproxy/filter.hpp>
+#include <metaproxy/package.hpp>
+#include <metaproxy/util.hpp>
namespace mp = metaproxy_1;
namespace mp = metaproxy_1;
@@
-31,13
+30,13
@@
namespace metaproxy_1 {
class Filter_myfilter: public mp::filter::Base {
public:
void process(mp::Package & package) const;
class Filter_myfilter: public mp::filter::Base {
public:
void process(mp::Package & package) const;
- void configure(const xmlNode *ptr, bool test_only);
+ void configure(const xmlNode *ptr, bool test_only, const char *path);
};
}
}
void mp::filter::Filter_myfilter::process(mp::Package & package) const
};
}
}
void mp::filter::Filter_myfilter::process(mp::Package & package) const
-{ // See src/filter_backend_test.cpp for a more comprehensive
+{ // See src/filter_backend_test.cpp for a more comprehensive
// example of a dummy Z-server
Z_GDU *gdu = package.request().get();
Z_APDU *apdu_res = 0;
// example of a dummy Z-server
Z_GDU *gdu = package.request().get();
Z_APDU *apdu_res = 0;
@@
-50,24
+49,24
@@
void mp::filter::Filter_myfilter::process(mp::Package & package) const
return;
}
Z_APDU *apdu_req = gdu->u.z3950;
return;
}
Z_APDU *apdu_req = gdu->u.z3950;
- if (apdu_req->which == Z_APDU_initRequest)
+ if (apdu_req->which == Z_APDU_initRequest)
{
yaz_log(YLOG_LOG, "myfilter::process: Init request");
{
yaz_log(YLOG_LOG, "myfilter::process: Init request");
- apdu_res= odr.create_initResponse( apdu_req,
+ apdu_res= odr.create_initResponse( apdu_req,
YAZ_BIB1_PERMANENT_SYSTEM_ERROR, "Not implemented!");
package.response() = apdu_res;
}
YAZ_BIB1_PERMANENT_SYSTEM_ERROR, "Not implemented!");
package.response() = apdu_res;
}
- else
+ else
{
yaz_log(YLOG_LOG, "myfilter::process: Unknown request type");
package.move(); // Send on to other filters
}
}
{
yaz_log(YLOG_LOG, "myfilter::process: Unknown request type");
package.move(); // Send on to other filters
}
}
-void mp::filter::Filter_myfilter::configure(const xmlNode *ptr, bool test_only)
+void mp::filter::Filter_myfilter::configure(const xmlNode *ptr, bool test_only, const char *path)
{
{
- yaz_log(YLOG_LOG, "myfilter::configure");
- for (ptr = ptr->children; ptr; ptr = ptr->next)
+ yaz_log(YLOG_LOG, "myfilter::configure called with test_only %d and %s", test_only, path);
+ for (ptr = ptr->children; ptr; ptr = ptr->next)
{
if (ptr->type != XML_ELEMENT_NODE)
continue;
{
if (ptr->type != XML_ELEMENT_NODE)
continue;
@@
-77,7
+76,7
@@
void mp::filter::Filter_myfilter::configure(const xmlNode *ptr, bool test_only)
yaz_log(YLOG_LOG, "myfilter::configure: %s", msg.c_str() );
}
yaz_log(YLOG_LOG, "myfilter::configure: %s", msg.c_str() );
}
- else
+ else
{
throw mp::filter::FilterException("Bad element "
+ std::string((const char *) ptr->name));
{
throw mp::filter::FilterException("Bad element "
+ std::string((const char *) ptr->name));