activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r543795 - /activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp
Date Sat, 02 Jun 2007 22:20:51 GMT
Author: tabish
Date: Sat Jun  2 15:20:49 2007
New Revision: 543795

URL: http://svn.apache.org/viewvc?view=rev&rev=543795
Log:
https://issues.apache.org/activemq/browse/AMQCPP-119

return "" on class to getClientId after connection is closed

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp

Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp?view=diff&rev=543795&r1=543794&r2=543795
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp Sat Jun  2 15:20:49
2007
@@ -94,7 +94,6 @@
 {
     try
     {
-
         // Create the session instance.
         ActiveMQSession* session = new ActiveMQSession(
             connectionData->getConnector()->createSession( ackMode ),
@@ -120,7 +119,11 @@
 ////////////////////////////////////////////////////////////////////////////////
 std::string ActiveMQConnection::getClientID() const
 {
-   return connectionData->getConnector()->getClientId();
+    if( closed ) {
+        return "";
+    }
+
+    return connectionData->getConnector()->getClientId();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -210,20 +213,20 @@
             fire( ex );
 
             return;
-        }        
+        }
 
         // Look up the dispatcher.
         Dispatcher* dispatcher = NULL;
         synchronized( &dispatchers )
         {
             dispatcher = dispatchers.getValue(consumer->getConsumerId());
-        
+
             // If we have no registered dispatcher, the consumer was probably
             // just closed.  Just delete the message.
-            if( dispatcher == NULL ) {                
-                delete message;                
+            if( dispatcher == NULL ) {
+                delete message;
             } else {
-    
+
                 // Dispatch the message.
                 DispatchData data( consumer, message );
                 dispatcher->dispatch( data );



Mime
View raw message