qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1486657 - /qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
Date Mon, 27 May 2013 16:31:33 GMT
Author: gsim
Date: Mon May 27 16:31:33 2013
New Revision: 1486657

URL: http://svn.apache.org/r1486657
Log:
QPID-4887: retrieve username and password from url if specified

Modified:
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp?rev=1486657&r1=1486656&r2=1486657&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp Mon May 27 16:31:33
2013
@@ -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);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message