You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2009/06/23 22:02:19 UTC

svn commit: r787810 - /qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp

Author: astitcher
Date: Tue Jun 23 20:02:18 2009
New Revision: 787810

URL: http://svn.apache.org/viewvc?rev=787810&view=rev
Log:
Don't schedule eof() in response to traffic timeout if already
disconnecting and make sure that this is true for all close
down paths

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp?rev=787810&r1=787809&r2=787810&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp Tue Jun 23 20:02:18 2009
@@ -78,7 +78,10 @@
 }
 
 void AsynchIOHandler::abort() {
-    aio->requestCallback(boost::bind(&AsynchIOHandler::eof, this, _1));
+    // Don't disconnect if we're already disconnecting
+    if (!readError) {
+        aio->requestCallback(boost::bind(&AsynchIOHandler::eof, this, _1));
+    }
 }
 
 void AsynchIOHandler::activateOutput() {
@@ -204,10 +207,13 @@
             buff->dataCount = encoded;
             aio->queueWrite(buff);
         }
-        if (codec->isClosed())
+        if (codec->isClosed()) {
+            readError = true;
             aio->queueWriteClose();
+        }
     } catch (const std::exception& e) {
         QPID_LOG(error, e.what());
+        readError = true;
         aio->queueWriteClose();
     }
 }



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