X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffilter_bounce.cpp;h=4a6e099ea100fadc9e489d5886986c2c24f6303b;hb=ec7e55c86b12403bf0b6e869339c24cbbd4fcdff;hp=7937205aab51e37d79def1f6d0c4c46eb50a458d;hpb=c7e00e3a6f696afd9f7b78fc27194f954e34b570;p=metaproxy-moved-to-github.git diff --git a/src/filter_bounce.cpp b/src/filter_bounce.cpp index 7937205..4a6e099 100644 --- a/src/filter_bounce.cpp +++ b/src/filter_bounce.cpp @@ -1,27 +1,30 @@ -/* $Id: filter_bounce.cpp,v 1.3 2007-03-20 07:17:40 adam Exp $ - Copyright (c) 2005-2007, Index Data. +/* This file is part of Metaproxy. + Copyright (C) 2005-2013 Index Data - See the LICENSE file for details - */ +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 +Software Foundation; either version 2, or (at your option) any later +version. + +Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #include "filter_bounce.hpp" -#include "package.hpp" -#include "util.hpp" +#include +#include #include "gduutil.hpp" #include #include -//#include "config.hpp" -//#include "filter.hpp" - -//#include - - - - - namespace mp = metaproxy_1; namespace yf = mp::filter; @@ -51,18 +54,18 @@ void yf::Bounce::process(mp::Package &package) const return; } package.session().close(); - + Z_GDU *zgdu = package.request().get(); - + if (!zgdu) return; - + //std::string message("BOUNCE "); - std::ostringstream message; + std::ostringstream message; message << "BOUNCE " << *zgdu; - - metaproxy_1::odr odr; - + + metaproxy_1::odr odr; + if (zgdu->which == Z_GDU_Z3950) { Z_APDU *apdu_res = 0; @@ -74,20 +77,26 @@ void yf::Bounce::process(mp::Package &package) const 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); - + package.response() = zgdu_res; } else if (zgdu->which == Z_GDU_HTTP_Response) { } - + 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; @@ -105,8 +114,9 @@ extern "C" { /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil - * c-file-style: "stroustrup" * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +