diff options
author | Alan Conway <aconway@apache.org> | 2009-02-12 19:01:51 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2009-02-12 19:01:51 +0000 |
commit | bffd507d565f4030407dc3d998f0e7ead2b39aa7 (patch) | |
tree | 2b2ee44392365ad6253d8d4cabbe6eaf2d80ab0b /cpp/src/qpid/cluster/UpdateClient.cpp | |
parent | d066e62f23cf2019ca608116e5d2a61a8b36c281 (diff) | |
download | qpid-python-bffd507d565f4030407dc3d998f0e7ead2b39aa7.tar.gz |
Cluster security support:
- Set correct user ID on update connections.
- Allow configuration of user, pass and mechanism used for update connections.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@743839 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/UpdateClient.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/UpdateClient.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cpp/src/qpid/cluster/UpdateClient.cpp b/cpp/src/qpid/cluster/UpdateClient.cpp index e50c936b50..18746ccb7e 100644 --- a/cpp/src/qpid/cluster/UpdateClient.cpp +++ b/cpp/src/qpid/cluster/UpdateClient.cpp @@ -89,21 +89,22 @@ UpdateClient::UpdateClient(const MemberId& updater, const MemberId& updatee, con broker::Broker& broker, const ClusterMap& m, uint64_t frameId_, const Cluster::Connections& cons, const boost::function<void()>& ok, - const boost::function<void(const std::exception&)>& fail) + const boost::function<void(const std::exception&)>& fail, + const client::ConnectionSettings& cs +) : updaterId(updater), updateeId(updatee), updateeUrl(url), updaterBroker(broker), map(m), frameId(frameId_), connections(cons), connection(catchUpConnection()), shadowConnection(catchUpConnection()), - done(ok), failed(fail) + done(ok), failed(fail) { - connection.open(url); + connection.open(url, cs); session = connection.newSession("update_shared"); } UpdateClient::~UpdateClient() {} // Reserved exchange/queue name for catch-up, avoid clashes with user queues/exchanges. -static const char UPDATE_CHARS[] = "qpid.qpid-update"; -const std::string UpdateClient::UPDATE(UPDATE_CHARS, sizeof(UPDATE_CHARS)); +const std::string UpdateClient::UPDATE("qpid.qpid-update"); void UpdateClient::update() { QPID_LOG(debug, updaterId << " updating state to " << updateeId << " at " << updateeUrl); @@ -232,7 +233,9 @@ void UpdateClient::updateConnection(const boost::intrusive_ptr<Connection>& upda bc.eachSessionHandler(boost::bind(&UpdateClient::updateSession, this, _1)); ClusterConnectionProxy(shadowConnection).shadowReady( updateConnection->getId().getMember(), - reinterpret_cast<uint64_t>(updateConnection->getId().getPointer())); + reinterpret_cast<uint64_t>(updateConnection->getId().getPointer()), + updateConnection->getBrokerConnection().getUserId() + ); shadowConnection.close(); QPID_LOG(debug, updaterId << " updated connection " << *updateConnection); } |