activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r775938 - in /activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core: ActiveMQConnection.cpp ActiveMQConnection.h
Date Mon, 18 May 2009 13:20:41 GMT
Author: tabish
Date: Mon May 18 13:20:40 2009
New Revision: 775938

URL: http://svn.apache.org/viewvc?rev=775938&view=rev
Log:
Fix for a socket read exception that can get propagated to exception listeners on close of
the connection.  

Modified:
    activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core/ActiveMQConnection.cpp
    activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core/ActiveMQConnection.h

Modified: activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core/ActiveMQConnection.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core/ActiveMQConnection.cpp?rev=775938&r1=775937&r2=775938&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core/ActiveMQConnection.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core/ActiveMQConnection.cpp
Mon May 18 13:20:40 2009
@@ -38,6 +38,7 @@
     this->connectionData = connectionData;
     this->started = false;
     this->closed = false;
+    this->closing = false;
     this->exceptionListener = NULL;
 
     // Register for messages and exceptions from the connector.
@@ -132,6 +133,8 @@
             return;
         }
 
+        this->closing = true;
+
         // Get the complete list of active sessions.
         std::vector<ActiveMQSession*> allSessions;
         synchronized( &activeSessions ) {
@@ -257,7 +260,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQConnection::onException( const CMSException& ex ){
 
-    if( exceptionListener != NULL ){
+    if( exceptionListener != NULL && !closing ){
         exceptionListener->onException( ex );
     }
 }

Modified: activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core/ActiveMQConnection.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core/ActiveMQConnection.h?rev=775938&r1=775937&r2=775938&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core/ActiveMQConnection.h
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/activemq/core/ActiveMQConnection.h
Mon May 18 13:20:40 2009
@@ -79,6 +79,11 @@
         bool closed;
 
         /**
+         * Indicates that a close is in progress.
+         */
+        bool closing;
+
+        /**
          * Map of message dispatchers indexed by consumer id.
          */
         decaf::util::Map< long long, Dispatcher* > dispatchers;



Mime
View raw message