diff options
| author | Gordon Sim <gsim@apache.org> | 2008-10-17 09:41:26 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-10-17 09:41:26 +0000 |
| commit | ed27e866fb3927257791591e00b9d9e90477e845 (patch) | |
| tree | 6550b389be9612f69337d449f315759679077843 /cpp/src/qpid/broker | |
| parent | 5644e4fbfd777921b33874aed13c45d544c8a383 (diff) | |
| download | qpid-python-ed27e866fb3927257791591e00b9d9e90477e845.tar.gz | |
QPID-106: SSL support for c++ (broker and client), can be enabled/disabled explictly via --with-ssl/--without-ssl args to configure; by default will build the modules if dependencies are found. See SSL readme file for more details.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@705534 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker')
| -rw-r--r-- | cpp/src/qpid/broker/Broker.cpp | 15 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/Broker.h | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/cpp/src/qpid/broker/Broker.cpp b/cpp/src/qpid/broker/Broker.cpp index 6a308ab64d..94c4449178 100644 --- a/cpp/src/qpid/broker/Broker.cpp +++ b/cpp/src/qpid/broker/Broker.cpp @@ -113,7 +113,7 @@ Broker::Options::Options(const std::string& name) : "Interval between attempts to purge any expired messages from queues") ("auth", optValue(auth, "yes|no"), "Enable authentication, if disabled all incoming connections will be trusted") ("realm", optValue(realm, "REALM"), "Use the given realm when performing authentication") - ("default-queue-limit", optValue(queueLimit, "BYTES"), "Default maximum size for queues (in bytes)") + ("default-queue-limit", optValue(queueLimit, "BYTES"), "Default maximum size for queues (in bytes)") ("tcp-nodelay", optValue(tcpNoDelay), "Set TCP_NODELAY on TCP connections"); } @@ -339,8 +339,6 @@ Manageable::status_t Broker::ManagementMethod (uint32_t methodId, QPID_LOG(error, "Transport '" << transport << "' not supported"); return Manageable::STATUS_NOT_IMPLEMENTED; } - QPID_LOG(info, "Connecting to " << hp.i_host << ":" << hp.i_port << " using '" << transport << "' as " << "'" << hp.i_username << "'"); - std::pair<Link::shared_ptr, bool> response = links.declare (hp.i_host, hp.i_port, transport, hp.i_durable, hp.i_authMechanism, hp.i_username, hp.i_password); @@ -372,9 +370,14 @@ boost::shared_ptr<ProtocolFactory> Broker::getProtocolFactory(const std::string& else return i->second; } -//TODO: should this allow choosing the port by transport name? -uint16_t Broker::getPort() const { - return getProtocolFactory()->getPort(); +uint16_t Broker::getPort(const std::string& name) const { + boost::shared_ptr<ProtocolFactory> factory + = getProtocolFactory(name.empty() ? TCP_TRANSPORT : name); + if (factory) { + return factory->getPort(); + } else { + throw Exception(QPID_MSG("No such transport: " << name)); + } } void Broker::registerProtocolFactory(const std::string& name, ProtocolFactory::shared_ptr protocolFactory) { diff --git a/cpp/src/qpid/broker/Broker.h b/cpp/src/qpid/broker/Broker.h index 089db69c6b..213bf63837 100644 --- a/cpp/src/qpid/broker/Broker.h +++ b/cpp/src/qpid/broker/Broker.h @@ -149,7 +149,7 @@ class Broker : public sys::Runnable, public Plugin::Target, * port, which will be different if the configured port is * 0. */ - virtual uint16_t getPort() const; + virtual uint16_t getPort(const std::string& name = TCP_TRANSPORT) const; /** * Run the broker. Implements Runnable::run() so the broker |
