summaryrefslogtreecommitdiffstats
path: root/src/stateless/cp
diff options
context:
space:
mode:
Diffstat (limited to 'src/stateless/cp')
-rw-r--r--src/stateless/cp/trex_stateless_port.cpp12
-rw-r--r--src/stateless/cp/trex_stateless_port.h11
2 files changed, 6 insertions, 17 deletions
diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp
index 96194321..9770c735 100644
--- a/src/stateless/cp/trex_stateless_port.cpp
+++ b/src/stateless/cp/trex_stateless_port.cpp
@@ -84,22 +84,16 @@ TrexStatelessPort::TrexStatelessPort(uint8_t port_id, const TrexPlatformApi *api
* @param force
*/
void
-TrexStatelessPort::acquire(const std::string &user, uint32_t session_id, bool force) {
+TrexStatelessPort::acquire(const std::string &user, bool force) {
/* if port is free - just take it */
if (get_owner().is_free()) {
- get_owner().own(user, session_id);
+ get_owner().own(user);
return;
}
- /* not free - but it might be the same user that owns the port */
- if ( (get_owner().get_name() == user) && (get_owner().get_session_id() == session_id) ) {
- return;
- }
-
- /* so different session id or different user */
if (force) {
- get_owner().own(user, session_id);
+ get_owner().own(user);
/* inform the other client of the steal... */
Json::Value data;
diff --git a/src/stateless/cp/trex_stateless_port.h b/src/stateless/cp/trex_stateless_port.h
index 1310fdb2..4988b46a 100644
--- a/src/stateless/cp/trex_stateless_port.h
+++ b/src/stateless/cp/trex_stateless_port.h
@@ -58,11 +58,10 @@ public:
return ( !m_is_free && (m_owner_name == user) );
}
- void own(const std::string &owner_name, uint32_t session_id) {
+ void own(const std::string &owner_name) {
/* save user data */
m_owner_name = owner_name;
- m_session_id = session_id;
/* internal data */
m_handler = generate_handler();
@@ -81,9 +80,6 @@ public:
return (!m_is_free ? m_handler : g_unowned_handler);
}
- uint32_t get_session_id() {
- return m_session_id;
- }
private:
std::string generate_handler();
@@ -91,9 +87,8 @@ private:
/* is this port owned by someone ? */
bool m_is_free;
- /* user provided info - name and session id */
+ /* user provided info */
std::string m_owner_name;
- uint32_t m_session_id;
/* handler genereated internally */
std::string m_handler;
@@ -143,7 +138,7 @@ public:
* acquire port
* throws TrexException in case of an error
*/
- void acquire(const std::string &user, uint32_t session_id, bool force = false);
+ void acquire(const std::string &user, bool force = false);
/**
* release the port from the current user