qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r740872 - in /qpid/trunk/qpid/cpp/src/qpid/cluster: Connection.cpp OutputInterceptor.cpp OutputInterceptor.h
Date Wed, 04 Feb 2009 20:47:14 GMT
Author: aconway
Date: Wed Feb  4 20:47:14 2009
New Revision: 740872

URL: http://svn.apache.org/viewvc?rev=740872&view=rev
Log:
Fix assertion due to doOutput control being sent after local connection closed.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.h

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp?rev=740872&r1=740871&r2=740872&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp Wed Feb  4 20:47:14 2009
@@ -112,7 +112,7 @@
                 cluster.addShadowConnection(this);
             AMQFrame ok((ConnectionCloseOkBody()));
             connection.getOutput().send(ok);
-            output.setOutputHandler(discardHandler);
+            output.closeOutput(discardHandler);
             catchUp = false;
         }
         else
@@ -165,7 +165,7 @@
             // This was a local replicated connection. Multicast a deliver
             // closed and process any outstanding frames from the cluster
             // until self-delivery of deliver-close.
-            output.setOutputHandler(discardHandler);
+            output.closeOutput(discardHandler);
             cluster.getMulticast().mcastControl(ClusterConnectionDeliverCloseBody(), self);
         }
     }

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp?rev=740872&r1=740871&r2=740872&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp Wed Feb  4 20:47:14 2009
@@ -34,7 +34,8 @@
 
 OutputInterceptor::OutputInterceptor(
     cluster::Connection& p, sys::ConnectionOutputHandler& h)
-    : parent(p), next(&h), sent(), writeEstimate(p.getCluster().getWriteEstimate()),
+    : parent(p), closing(false), next(&h), sent(),
+      writeEstimate(p.getCluster().getWriteEstimate()),
       moreOutput(), doingOutput()
 {}
 
@@ -54,7 +55,7 @@
         sys::Mutex::ScopedLock l(lock);
         next->activateOutput();
     }
-    else {
+    else if (!closing) {        // Don't send do ouput after output stopped.
         QPID_LOG(trace,  parent << " activateOutput - sending doOutput");
         moreOutput = true;
         sendDoOutput();
@@ -117,8 +118,9 @@
     QPID_LOG(trace, parent << "Send doOutput request for " << request);
 }
 
-void OutputInterceptor::setOutputHandler(sys::ConnectionOutputHandler& h) {
+void OutputInterceptor::closeOutput(sys::ConnectionOutputHandler& h) {
     sys::Mutex::ScopedLock l(lock);
+    closing = true;
     next = &h;
 }
 

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.h?rev=740872&r1=740871&r2=740872&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.h Wed Feb  4 20:47:14 2009
@@ -53,7 +53,7 @@
     // Intercept doOutput requests on Connection.
     bool doOutput();
 
-    void setOutputHandler(sys::ConnectionOutputHandler& h);
+    void closeOutput(sys::ConnectionOutputHandler& h);
 
     cluster::Connection& parent;
     
@@ -63,6 +63,7 @@
     void sendDoOutput();
 
     mutable sys::Mutex lock;
+    bool closing;
     sys::ConnectionOutputHandler* next;
     size_t sent;
     size_t lastDoOutput;



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


Mime
View raw message