metaproxy  1.13.0
Classes | Public Member Functions | Private Attributes | List of all members
metaproxy_1::filter::HTTPClient Class Reference

#include <filter_http_client.hpp>

Inheritance diagram for metaproxy_1::filter::HTTPClient:
Inheritance graph
Collaboration diagram for metaproxy_1::filter::HTTPClient:
Collaboration graph

Classes

class  Rep
 

Public Member Functions

 ~HTTPClient ()
 
 HTTPClient ()
 
void process (metaproxy_1::Package &package) const
 
void configure (const xmlNode *ptr, bool test_only, const char *path)
 

Private Attributes

boost::scoped_ptr< Repm_p
 

Detailed Description

Definition at line 28 of file filter_http_client.hpp.

Constructor & Destructor Documentation

metaproxy_1::filter::HTTPClient::~HTTPClient ( )
metaproxy_1::filter::HTTPClient::HTTPClient ( )

Member Function Documentation

void metaproxy_1::filter::HTTPClient::configure ( const xmlNode *  ptr,
bool  test_only,
const char *  path 
)

Definition at line 168 of file filter_http_client.cpp.

References m_p.

170 {
171  for (ptr = ptr->children; ptr; ptr = ptr->next)
172  {
173  if (ptr->type != XML_ELEMENT_NODE)
174  continue;
175  else if (!strcmp((const char *) ptr->name, "proxy"))
176  {
177  m_p->proxy_host = mp::xml::get_text(ptr);
178  }
179  else if (!strcmp((const char *) ptr->name, "max-redirects"))
180  {
181  m_p->max_redirects = mp::xml::get_int(ptr, 0);
182  }
183  else if (!strcmp((const char *) ptr->name, "default-host"))
184  {
185  m_p->default_host = mp::xml::get_text(ptr);
186  if (m_p->default_host.find("://") == std::string::npos)
187  {
188  throw mp::filter::FilterException
189  ("default-host is missing method (such as http://)"
190  " in http_client filter");
191  }
192  }
193  else if (!strcmp((const char *) ptr->name, "x-forwarded-for"))
194  {
195  m_p->x_forwarded_for = mp::xml::get_bool(ptr, 0);
196  }
197  else if (!strcmp((const char *) ptr->name, "bind_host"))
198  {
199  m_p->bind_host = mp::xml::get_bool(ptr, 0);
200  }
201  else
202  {
203  throw mp::filter::FilterException
204  ("Bad element "
205  + std::string((const char *) ptr->name)
206  + " in http_client filter");
207  }
208  }
209 }
void metaproxy_1::filter::HTTPClient::process ( metaproxy_1::Package &  package) const

Member Data Documentation

boost::scoped_ptr<Rep> metaproxy_1::filter::HTTPClient::m_p
private

Definition at line 38 of file filter_http_client.hpp.

Referenced by configure().


The documentation for this class was generated from the following files: