The ID is specified by using x-session-id argument for the SRU URL.
It is attached to the origin instance and passed down the chain.
/// get tcpip address
std::string get_address();
+
+ void set_custom_session(const std::string &s);
private:
friend std::ostream&
std::operator<<(std::ostream& os, metaproxy_1::Origin& o);
std::string m_listen_host;
unsigned int m_listen_port;
int m_max_sockets;
+ std::string m_custom_session;
};
}
{
package.origin().set_max_sockets(atoi(arg->value));
}
+ else if (!strcmp(arg->name, "x-session-id"))
+ {
+ package.origin().set_custom_session(arg->value);
+ }
assert(sru_pdu_req);
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::ostream& std::operator<<(std::ostream& os, mp::Origin& o)
{
- if (o.m_address != "")
+ if (o.m_address.length())
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;
}