From 12bebb1ea87921a08ad70edee2be21cd251bd82f Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 10 Aug 2011 17:01:55 +0000 Subject: NO-JIRA: Remove redundant code (qpid::Url now does everything required) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1156262 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp') diff --git a/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp b/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp index 3492938156..491d05a5dc 100644 --- a/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp @@ -20,7 +20,6 @@ */ #include "ConnectionImpl.h" #include "SessionImpl.h" -#include "SimpleUrlParser.h" #include "qpid/messaging/exceptions.h" #include "qpid/messaging/Session.h" #include "qpid/messaging/PrivateImplRef.h" @@ -273,14 +272,10 @@ bool ConnectionImpl::tryConnect() for (std::vector::const_iterator i = urls.begin(); i != urls.end(); ++i) { try { QPID_LOG(info, "Trying to connect to " << *i << "..."); - //TODO: when url support is more complete can avoid this test here - if (i->find("amqp:") == 0) { - Url url(*i); - connection.open(url, settings); - } else { - SimpleUrlParser::parse(*i, settings); - connection.open(settings); - } + Url url(*i); + if (url.getUser().size()) settings.username = url.getUser(); + if (url.getPass().size()) settings.password = url.getPass(); + connection.open(url, settings); QPID_LOG(info, "Connected to " << *i); mergeUrls(connection.getInitialBrokers(), l); return resetSessions(l); -- cgit v1.2.1