metaproxy  1.13.0
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

 metaproxy_1
 
 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

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

Definition at line 148 of file filter_bounce.cpp.

149 {
150  return new mp::filter::Bounce;
151 }
static void http_echo ( mp::odr &  odr,
Z_GDU *  zgdu,
Z_GDU *  zgdu_res 
)
static

Definition at line 58 of file filter_bounce.cpp.

References metaproxy_1::filter::Bounce::m_p.

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 }

Variable Documentation

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.

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