qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cliffjan...@apache.org
Subject svn commit: r1583901 - in /qpid/trunk/qpid/cpp/src/qpid: messaging/amqp/ConnectionContext.cpp sys/urlAdd.h
Date Wed, 02 Apr 2014 07:03:58 GMT
Author: cliffjansen
Date: Wed Apr  2 07:03:57 2014
New Revision: 1583901

URL: http://svn.apache.org/r1583901
Log:
QPID-5648: restore processing the ConnectionSettings protocol, lost inadvertently in QPID-5568

Modified:
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/urlAdd.h

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=1583901&r1=1583900&r2=1583901&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp Wed Apr  2 07:03:57
2014
@@ -78,7 +78,7 @@ void ConnectionContext::trace(const char
 
 ConnectionContext::ConnectionContext(const std::string& url, const qpid::types::Variant::Map&
o)
     : qpid::messaging::ConnectionOptions(o),
-      fullUrl(url),
+      fullUrl(url, protocol.empty() ? qpid::Address::TCP : protocol),
       engine(pn_transport()),
       connection(pn_connection()),
       //note: disabled read/write of header as now handled by engine
@@ -89,7 +89,8 @@ ConnectionContext::ConnectionContext(con
       codecAdapter(*this)
 {
     // Concatenate all known URLs into a single URL, get rid of duplicate addresses.
-    sys::urlAddStrings(fullUrl, urls.begin(), urls.end());
+    sys::urlAddStrings(fullUrl, urls.begin(), urls.end(), protocol.empty() ?
+                       qpid::Address::TCP : protocol);
     if (pn_transport_bind(engine, connection)) {
         //error
     }

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/urlAdd.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/urlAdd.h?rev=1583901&r1=1583900&r2=1583901&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/urlAdd.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/urlAdd.h Wed Apr  2 07:03:57 2014
@@ -40,7 +40,9 @@ inline void urlAddUrl(Url& url, const Ur
 }
 
 /** Convert str to a Url and do urlAddUrl. */
-inline void urlAddString(Url& url, const std::string& str) { urlAddUrl(url, Url(str));
}
+inline void urlAddString(Url& url, const std::string& str, const std::string&
defaultProtocol) {
+    urlAddUrl(url, Url(str, defaultProtocol));
+}
 
 /** For each URL in a range, do urlAddUrl */
 template <class UrlIterator>
@@ -50,8 +52,9 @@ void urlAddUrls(Url& url, UrlIterator i,
 
 /** For each string in a range, do urlAddUrl(Url(string)) */
 template <class StringIterator>
-void urlAddStrings(Url& url, StringIterator i, StringIterator j) {
-    for_each(i, j, boost::bind(&urlAddString, boost::ref(url), _1));
+void urlAddStrings(Url& url, StringIterator i, StringIterator j,
+                   const std::string& defaultProtocol) {
+    for_each(i, j, boost::bind(&urlAddString, boost::ref(url), _1, defaultProtocol));
 }
 
 }} // namespace qpid::sys



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


Mime
View raw message