diff options
author | Ted Ross <tross@apache.org> | 2009-09-22 20:11:30 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2009-09-22 20:11:30 +0000 |
commit | 642183fb8a6eb1a8adc71acfd2117bfcbdba3546 (patch) | |
tree | 20defcf1758c4e8673cd1c9d49cac9eac480a4b1 /cpp/src/qmf/ResilientConnection.cpp | |
parent | df826cf6ab76c434904811eb38c2258c278d7872 (diff) | |
download | qpid-python-642183fb8a6eb1a8adc71acfd2117bfcbdba3546.tar.gz |
QMF updates:
- Added "sendUserId" option (defaults to true) to QMF connection settings
- Implemented the user-id function using "negotiatedSettings" from qpid::client::Connection
- Fixed a sign-extension bug in Value
- Added tests for all of the above
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@817813 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/ResilientConnection.cpp')
-rw-r--r-- | cpp/src/qmf/ResilientConnection.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/cpp/src/qmf/ResilientConnection.cpp b/cpp/src/qmf/ResilientConnection.cpp index be7837b829..b3735657af 100644 --- a/cpp/src/qmf/ResilientConnection.cpp +++ b/cpp/src/qmf/ResilientConnection.cpp @@ -65,13 +65,12 @@ namespace qmf { client::Connection& connection; client::Session session; client::SubscriptionManager* subscriptions; + string userId; void* userContext; vector<string> dests; qpid::sys::Thread thread; - RCSession(ResilientConnectionImpl& ci, const string& n, client::Connection& c, void* uc) : - connImpl(ci), name(n), connection(c), session(connection.newSession(name)), - subscriptions(new client::SubscriptionManager(session)), userContext(uc), thread(*this) {} + RCSession(ResilientConnectionImpl& ci, const string& n, client::Connection& c, void* uc); ~RCSession(); void received(client::Message& msg); void run(); @@ -135,6 +134,14 @@ ResilientConnectionEvent ResilientConnectionEventImpl::copy() return item; } +RCSession::RCSession(ResilientConnectionImpl& ci, const string& n, client::Connection& c, void* uc) : + connImpl(ci), name(n), connection(c), session(connection.newSession(name)), + subscriptions(new client::SubscriptionManager(session)), userContext(uc), thread(*this) +{ + const qpid::client::ConnectionSettings& operSettings = connection.getNegotiatedSettings(); + userId = operSettings.username; +} + RCSession::~RCSession() { subscriptions->stop(); @@ -254,6 +261,8 @@ void ResilientConnectionImpl::sendMessage(SessionHandle handle, qmf::Message& me string data(message.body, message.length); msg.getDeliveryProperties().setRoutingKey(message.routingKey); msg.getMessageProperties().setReplyTo(qpid::framing::ReplyTo(message.replyExchange, message.replyKey)); + if (settings.impl->getSendUserId()) + msg.getMessageProperties().setUserId(sess->userId); msg.setData(data); try { |