projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid boost::is_any_off to avoid warning
[metaproxy-moved-to-github.git]
/
src
/
origin.cpp
diff --git
a/src/origin.cpp
b/src/origin.cpp
index
500a446
..
88d362b
100644
(file)
--- a/
src/origin.cpp
+++ b/
src/origin.cpp
@@
-1,5
+1,5
@@
/* This file is part of Metaproxy.
/* This file is part of Metaproxy.
- Copyright (C) 2005-2011 Index Data
+ Copyright (C) 2005-2012 Index Data
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
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
@@
-23,33
+23,10
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
namespace mp = metaproxy_1;
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_max_sockets(int max_sockets)
{
m_max_sockets = max_sockets;
@@
-62,26
+39,32
@@
int mp::Origin::get_max_sockets()
void mp::Origin::set_tcpip_address(std::string addr, unsigned long s)
{
void mp::Origin::set_tcpip_address(std::string addr, unsigned long s)
{
- m_type = TCPIP;
m_address = addr;
m_origin_id = s;
}
m_address = addr;
m_origin_id = s;
}
+void mp::Origin::set_custom_session(const std::string &s)
+{
+ m_custom_session = s;
+}
+
std::string mp::Origin::get_address()
{
return m_address;
}
std::string mp::Origin::get_address()
{
return m_address;
}
-std::ostream& std::operator<<(std::ostream& os, mp::Origin& o)
+std::ostream& std::operator<<(std::ostream& os, const mp::Origin& o)
{
{
- if (o.m_address != "")
+ if (o.m_address.length())
os << o.m_address;
else
os << "0";
os << ":" << o.m_origin_id;
os << o.m_address;
else
os << "0";
os << ":" << o.m_origin_id;
+ if (o.m_custom_session.length())
+ os << ":" << o.m_custom_session;
return os;
}
return os;
}
-
+
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4