summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Connection.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-02-12 19:01:51 +0000
committerAlan Conway <aconway@apache.org>2009-02-12 19:01:51 +0000
commitbffd507d565f4030407dc3d998f0e7ead2b39aa7 (patch)
tree2b2ee44392365ad6253d8d4cabbe6eaf2d80ab0b /cpp/src/qpid/client/Connection.cpp
parentd066e62f23cf2019ca608116e5d2a61a8b36c281 (diff)
downloadqpid-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/client/Connection.cpp')
-rw-r--r--cpp/src/qpid/client/Connection.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/cpp/src/qpid/client/Connection.cpp b/cpp/src/qpid/client/Connection.cpp
index 3562df4a74..cc62d724cb 100644
--- a/cpp/src/qpid/client/Connection.cpp
+++ b/cpp/src/qpid/client/Connection.cpp
@@ -54,6 +54,15 @@ void Connection::open(
const std::string& vhost,
uint16_t maxFrameSize)
{
+ ConnectionSettings settings;
+ settings.username = uid;
+ settings.password = pwd;
+ settings.virtualhost = vhost;
+ settings.maxFrameSize = maxFrameSize;
+ open(url, settings);
+}
+
+void Connection::open(const Url& url, const ConnectionSettings& settings) {
if (url.empty())
throw Exception(QPID_MSG("Attempt to open URL with no addresses."));
Url::const_iterator i = url.begin();
@@ -62,14 +71,10 @@ void Connection::open(
i++;
if (tcp) {
try {
- ConnectionSettings settings;
- settings.host = tcp->host;
- settings.port = tcp->port;
- settings.username = uid;
- settings.password = pwd;
- settings.virtualhost = vhost;
- settings.maxFrameSize = maxFrameSize;
- open(settings);
+ ConnectionSettings cs(settings);
+ cs.host = tcp->host;
+ cs.port = tcp->port;
+ open(cs);
break;
}
catch (const Exception& /*e*/) {