diff options
| author | Gordon Sim <gsim@apache.org> | 2013-05-27 16:31:33 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-05-27 16:31:33 +0000 |
| commit | 39e542f1dacc880d6aa4901d7269ff365c8d76b3 (patch) | |
| tree | 0403d1494ad71645856efbfd1838c109c2f5e6e2 /cpp | |
| parent | 7d7262cbc130c58d0393d0418f3992fe0e5b5c17 (diff) | |
| download | qpid-python-39e542f1dacc880d6aa4901d7269ff365c8d76b3.tar.gz | |
QPID-4887: retrieve username and password from url if specified
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1486657 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp index c9623f568c..869d0caebc 100644 --- a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp +++ b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp @@ -44,10 +44,9 @@ namespace qpid { namespace messaging { namespace amqp { - ConnectionContext::ConnectionContext(const std::string& u, const qpid::types::Variant::Map& o) : qpid::messaging::ConnectionOptions(o), - url(u), + url(u, protocol.empty() ? qpid::Address::TCP : protocol), engine(pn_transport()), connection(pn_connection()), //note: disabled read/write of header as now handled by engine @@ -85,6 +84,8 @@ void ConnectionContext::open() qpid::sys::ScopedLock<qpid::sys::Monitor> l(lock); if (state != DISCONNECTED) throw qpid::messaging::ConnectionError("Connection was already opened!"); if (!driver) driver = DriverImpl::getDefault(); + if (url.getUser().size()) username = url.getUser(); + if (url.getPass().size()) password = url.getPass(); for (Url::const_iterator i = url.begin(); state != CONNECTED && i != url.end(); ++i) { transport = driver->getTransport(i->protocol, *this); |
