You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2008/11/13 14:27:02 UTC

svn commit: r713720 - /incubator/qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp

Author: gsim
Date: Thu Nov 13 05:27:01 2008
New Revision: 713720

URL: http://svn.apache.org/viewvc?rev=713720&view=rev
Log:
QPID-1459: don't call Broker::getPort() with empty string as transport


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

Modified: incubator/qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp?rev=713720&r1=713719&r2=713720&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/posix/QpiddBroker.cpp Thu Nov 13 05:27:01 2008
@@ -46,6 +46,10 @@
     add(log);
 }
 
+namespace {
+const std::string TCP = "tcp";
+}
+
 struct DaemonOptions : public qpid::Options {
     bool daemon;
     bool quit;
@@ -54,7 +58,7 @@
     std::string piddir;
     std::string transport;
 
-    DaemonOptions() : qpid::Options("Daemon options"), daemon(false), quit(false), check(false), wait(10)
+    DaemonOptions() : qpid::Options("Daemon options"), daemon(false), quit(false), check(false), wait(10), transport(TCP)
     {
         char *home = ::getenv("HOME");
 
@@ -111,7 +115,7 @@
     /** Code for parent process */
     void parent() {
         uint16_t port = wait(options->daemon.wait);
-        if (options->parent->broker.port == 0 || !options->daemon.transport.empty())
+        if (options->parent->broker.port == 0 || options->daemon.transport != TCP)
             cout << port << endl; 
     }
 
@@ -156,7 +160,7 @@
     else {                  // Non-daemon broker.
         boost::intrusive_ptr<Broker> brokerPtr(new Broker(options->broker));
         broker::SignalHandler::setBroker(brokerPtr);
-        if (options->broker.port == 0 || !myOptions->daemon.transport.empty())
+        if (options->broker.port == 0 || myOptions->daemon.transport != TCP)
             cout << uint16_t(brokerPtr->getPort(myOptions->daemon.transport)) << endl;
         brokerPtr->run();
     }