class Origin {
public:
- Origin(std::string listen_host = "", unsigned int listen_port = 0);
+ Origin();
- /// get function - right val in assignment
- std::string listen_host() const;
-
- /// set function - left val in assignment
- std::string & listen_host();
-
- /// get function - right val in assignment
- unsigned int listen_port() const;
-
- /// set function - left val in assignment
- unsigned int & listen_port();
-
/// set client IP info - left val in assignment
void set_tcpip_address(std::string addr, unsigned long id);
friend std::ostream&
std::operator<<(std::ostream& os, const metaproxy_1::Origin& o);
- enum origin_t {
- API,
- UNIX,
- TCPIP
- } m_type;
- std::string m_address; // UNIX+TCPIP
+ std::string m_address;
unsigned int m_origin_id;
- std::string m_listen_host;
- unsigned int m_listen_port;
int m_max_sockets;
std::string m_custom_session;
};
-
}
-
-
#endif
/*
* Local variables:
namespace mp = metaproxy_1;
-mp::Origin::Origin(std::string listen_host,
- unsigned int listen_port)
- : m_type(API), m_address(""), m_origin_id(0),
- m_listen_host(listen_host), m_listen_port(listen_port), m_max_sockets(0)
+mp::Origin::Origin() : m_address(""), m_origin_id(0), m_max_sockets(0)
{
}
-std::string mp::Origin::listen_host() const
-{
- return m_listen_host;
-};
-
-std::string & mp::Origin::listen_host()
-{
- return m_listen_host;
-};
-
-unsigned int mp::Origin::listen_port() const
-{
- return m_listen_port;
-};
-
-unsigned int & mp::Origin::listen_port()
-{
- return m_listen_port;
-};
-
void mp::Origin::set_max_sockets(int max_sockets)
{
m_max_sockets = max_sockets;
void mp::Origin::set_tcpip_address(std::string addr, unsigned long s)
{
- m_type = TCPIP;
m_address = addr;
m_origin_id = s;
}
mp_util::SRUServerInfo sruinfo;
// getting host and port info
- sruinfo.host = package.origin().listen_host();
- sruinfo.port = mp_util::to_string(package.origin().listen_port());
+ sruinfo.host = "localhost";
+ sruinfo.port = "80";
// overwriting host and port info if set from HTTP Host header
Z_GDU *zgdu_req = package.request().get();