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
Add RouterXML in public API MP-450
[metaproxy-moved-to-github.git]
/
src
/
origin.cpp
diff --git
a/src/origin.cpp
b/src/origin.cpp
index
b408372
..
fbc1553
100644
(file)
--- a/
src/origin.cpp
+++ b/
src/origin.cpp
@@
-1,7
+1,5
@@
-/* $Id: origin.cpp,v 1.6 2007-05-09 21:23:09 adam Exp $
- Copyright (c) 2005-2007, Index Data.
-
-This file is part of Metaproxy.
+/* This file is part of Metaproxy.
+ Copyright (C) 2005-2013 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
@@
-14,69
+12,65
@@
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
-along with Metaproxy; see the file LICENSE. If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
- */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
-//#include "config.hpp"
-#include "origin.hpp"
+#include "config.hpp"
+#include <metaproxy/origin.hpp>
#include <iostream>
namespace mp = metaproxy_1;
#include <iostream>
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)
+mp::Origin::Origin() : m_address(""), m_origin_id(0), m_max_sockets(0)
{
}
{
}
-std::string mp::Origin::listen_host() const
+void mp::Origin::set_max_sockets(int max_sockets)
{
{
- return m_listen_host;
-};
+ m_max_sockets = max_sockets;
+}
-std::string & mp::Origin::listen_host()
+int mp::Origin::get_max_sockets()
{
{
- return m_listen_host;
-};
+ return m_max_sockets;
+}
-unsigned int mp::Origin::listen_port() const
+void mp::Origin::set_tcpip_address(std::string addr, unsigned long s)
{
{
- return m_listen_port;
-};
+ m_address = addr;
+ m_origin_id = s;
+}
-unsigned int & mp::Origin::listen_port()
+void mp::Origin::set_custom_session(const std::string &s)
{
{
- return m_listen_port;
-};
-
-
+ m_custom_session = s;
+}
-void mp::Origin::set_tcpip_address(std::string addr, unsigned long s)
+std::string mp::Origin::get_address()
{
{
- m_type = TCPIP;
- m_address = addr;
- m_origin_id = s;
+ 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
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* indent-tabs-mode: nil
- * c-file-style: "stroustrup"
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
+