metaproxy 1.22.1
Classes | Namespaces | Functions | Variables
filter_bounce.cpp File Reference
#include "filter_bounce.hpp"
#include <metaproxy/package.hpp>
#include <metaproxy/util.hpp>
#include "gduutil.hpp"
#include <yaz/zgdu.h>
#include <sstream>
Include dependency graph for filter_bounce.cpp:

Go to the source code of this file.

Classes

class  metaproxy_1::filter::Bounce::Rep
 

Namespaces

namespace  metaproxy_1
 
namespace  metaproxy_1::filter
 

Functions

static void http_echo (mp::odr &odr, Z_GDU *zgdu, Z_GDU *zgdu_res)
 
static mp::filter::Base * filter_creator ()
 

Variables

struct metaproxy_1_filter_struct metaproxy_1_filter_bounce
 

Function Documentation

◆ filter_creator()

static mp::filter::Base * filter_creator ( )
static

Definition at line 148 of file filter_bounce.cpp.

149{
150 return new mp::filter::Bounce;
151}

◆ http_echo()

static void http_echo ( mp::odr &  odr,
Z_GDU *  zgdu,
Z_GDU *  zgdu_res 
)
static

Definition at line 58 of file filter_bounce.cpp.

59{
60 int len;
61 ODR enc = odr_createmem(ODR_ENCODE);
62 //int r =
63 (void) z_GDU(enc, &zgdu, 0, 0);
64 char *buf = odr_getbuf(enc, &len, 0);
65 //h.db( "\n" + msg + "\n" + std::string(buf,len) );
66 Z_HTTP_Response *hres = zgdu_res->u.HTTP_Response;
67 if (hres)
68 {
69 z_HTTP_header_set(odr, &hres->headers,
70 "Content-Type", "text/plain");
71
72 hres->content_buf = (char*) odr_malloc(odr, len);
73 memcpy(hres->content_buf, buf, len);
74 hres->content_len = len;
75 }
76 odr_destroy(enc);
77
78}

Referenced by metaproxy_1::filter::Bounce::process().

Variable Documentation

◆ metaproxy_1_filter_bounce

struct metaproxy_1_filter_struct metaproxy_1_filter_bounce
Initial value:
= {
0,
"bounce",
}
static mp::filter::Base * filter_creator()

Definition at line 154 of file filter_bounce.cpp.

154 {
155 0,
156 "bounce",
158 };

Referenced by metaproxy_1::FactoryStatic::FactoryStatic().