qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kp...@apache.org
Subject svn commit: r1143078 - /qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp
Date Tue, 05 Jul 2011 14:35:42 GMT
Author: kpvdr
Date: Tue Jul  5 14:35:41 2011
New Revision: 1143078

URL: http://svn.apache.org/viewvc?rev=1143078&view=rev
Log:
QPID-3309: This fix sets the value of the port number in management if the broker is started
with a port value of 0.

Modified:
    qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp

Modified: qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp?rev=1143078&r1=1143077&r2=1143078&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp (original)
+++ qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp Tue Jul  5 14:35:41 2011
@@ -138,6 +138,9 @@ struct QpiddDaemon : public Daemon {
         brokerPtr->accept();
         uint16_t port=brokerPtr->getPort(options->daemon.transport);
         ready(port);            // Notify parent.
+        if (options->parent->broker.enableMgmt && (options->parent->broker.port
== 0 || options->daemon.transport != TCP)) {
+            dynamic_cast<qmf::org::apache::qpid::broker::Broker*>(brokerPtr->GetManagementObject())->set_port(port);
+        }
         brokerPtr->run();
     }
 };
@@ -182,8 +185,13 @@ int QpiddBroker::execute (QpiddOptions *
         boost::intrusive_ptr<Broker> brokerPtr(new Broker(options->broker));
         ScopedSetBroker ssb(brokerPtr);
         brokerPtr->accept();
-        if (options->broker.port == 0 || myOptions->daemon.transport != TCP)
-            cout << uint16_t(brokerPtr->getPort(myOptions->daemon.transport))
<< endl;
+        if (options->broker.port == 0 || myOptions->daemon.transport != TCP) {
+            uint16_t port = brokerPtr->getPort(myOptions->daemon.transport);
+            cout << port << endl;
+            if (options->broker.enableMgmt) {
+                dynamic_cast<qmf::org::apache::qpid::broker::Broker*>(brokerPtr->GetManagementObject())->set_port(port);
+            }
+        }
         brokerPtr->run();
     }
     return 0;



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message