qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1485467 - in /qpid/trunk/qpid/cpp/src: qpid/broker/amqp/Domain.cpp qpid/broker/amqp/Interconnect.cpp qpid/broker/amqp/SaslClient.cpp tests/qpidt
Date Wed, 22 May 2013 22:23:48 GMT
Author: gsim
Date: Wed May 22 22:23:48 2013
New Revision: 1485467

URL: http://svn.apache.org/r1485467
Log:
QPID-4878: fix SASL for connections established by the broker

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Domain.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Interconnect.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/amqp/SaslClient.cpp
    qpid/trunk/qpid/cpp/src/tests/qpidt   (contents, props changed)

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Domain.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Domain.cpp?rev=1485467&r1=1485466&r2=1485467&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Domain.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Domain.cpp Wed May 22 22:23:48 2013
@@ -168,7 +168,7 @@ qpid::sys::ConnectionCodec* Interconnect
 qpid::sys::ConnectionCodec* InterconnectFactory::create(qpid::sys::OutputControl& out,
const std::string& id, const qpid::sys::SecuritySettings& t)
 {
     bool useSasl = domain.getMechanisms() != NONE;
-    boost::shared_ptr<Interconnect> connection(new Interconnect(out, id, broker, true,
incoming, name, source, target, domain, registry));
+    boost::shared_ptr<Interconnect> connection(new Interconnect(out, id, broker, useSasl,
incoming, name, source, target, domain, registry));
     if (!relay) registry.add(name, connection);
     else connection->setRelay(relay);
 

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Interconnect.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Interconnect.cpp?rev=1485467&r1=1485466&r2=1485467&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Interconnect.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Interconnect.cpp Wed May 22 22:23:48 2013
@@ -41,7 +41,7 @@ namespace amqp {
 
 Interconnect::Interconnect(qpid::sys::OutputControl& out, const std::string& id,
qpid::broker::Broker& broker, bool saslInUse,
                            bool i, const std::string& n, const std::string& s, const
std::string& t, Domain& d, Interconnects& r)
-    : Connection(out, id, broker, r, saslInUse, std::string()), incoming(i), name(n), source(s),
target(t), domain(d), registry(r), headerDiscarded(false),
+    : Connection(out, id, broker, r, true, std::string()), incoming(i), name(n), source(s),
target(t), domain(d), registry(r), headerDiscarded(saslInUse),
       closeRequested(false), isTransportDeleted(false)
 {}
 
@@ -62,7 +62,7 @@ size_t Interconnect::encode(char* buffer
     } else {
         //The IO 'layer' will write in a protocol header when an
         //'outgoing' connection is established. However the proton
-        //potocol engine will also emit one. One needs to be
+        //protocol engine will also emit one. One needs to be
         //discarded, here we discard the one the engine emits for
         //interconnects.
         headerDiscarded = true;

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/SaslClient.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/SaslClient.cpp?rev=1485467&r1=1485466&r2=1485467&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/SaslClient.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/SaslClient.cpp Wed May 22 22:23:48 2013
@@ -36,7 +36,7 @@ namespace amqp {
 SaslClient::SaslClient(qpid::sys::OutputControl& out_, const std::string& id, boost::shared_ptr<Interconnect>
c, std::auto_ptr<qpid::Sasl> s,
                        const std::string& hostname_, const std::string& mechs, const
qpid::sys::SecuritySettings& t)
     : qpid::amqp::SaslClient(id), out(out_), connection(c), sasl(s),
-      hostname(hostname_), allowedMechanisms(mechs), transport(t), readHeader(true), writeHeader(true),
haveOutput(false), state(NONE) {}
+      hostname(hostname_), allowedMechanisms(mechs), transport(t), readHeader(true), writeHeader(false),
haveOutput(false), state(NONE) {}
 
 SaslClient::~SaslClient()
 {
@@ -103,7 +103,8 @@ void SaslClient::mechanisms(const std::s
         std::stringstream intersection;
         for (std::vector<std::string>::const_iterator i = allowed.begin(); i != allowed.end();
++i) {
             if (std::find(supported.begin(), supported.end(), *i) != supported.end()) {
-                intersection << *i << " ";
+                if (!intersection.str().empty()) intersection << " ";
+                intersection << *i;
             }
         }
         mechanisms = intersection.str();
@@ -172,7 +173,7 @@ bool SaslClient::isClosed() const
 }
 qpid::framing::ProtocolVersion SaslClient::getVersion() const
 {
-    return connection->getVersion();
+    return qpid::framing::ProtocolVersion(1,0,qpid::framing::ProtocolVersion::SASL);
 }
 
 }}} // namespace qpid::broker::amqp

Modified: qpid/trunk/qpid/cpp/src/tests/qpidt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/qpidt?rev=1485467&r1=1485466&r2=1485467&view=diff
==============================================================================
    (empty)

Propchange: qpid/trunk/qpid/cpp/src/tests/qpidt
------------------------------------------------------------------------------
    svn:executable = *



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


Mime
View raw message