You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by sh...@apache.org on 2009/03/18 00:18:41 UTC

svn commit: r755440 - /qpid/branches/0.5-release/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp

Author: shuston
Date: Tue Mar 17 23:18:40 2009
New Revision: 755440

URL: http://svn.apache.org/viewvc?rev=755440&view=rev
Log:
Correct the handling of end-of-connection cases; fixes QPID-1550

Modified:
    qpid/branches/0.5-release/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp

Modified: qpid/branches/0.5-release/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-release/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp?rev=755440&r1=755439&r2=755440&view=diff
==============================================================================
--- qpid/branches/0.5-release/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp (original)
+++ qpid/branches/0.5-release/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp Tue Mar 17 23:18:40 2009
@@ -690,10 +690,9 @@
         }
     }
 
-    // If there are no writes outstanding, the priority is to write any
-    // remaining buffers first (either queued or via idle), then close the
-    // socket if that's queued.
-    // opsInProgress handled in completion()
+    // If there are no writes outstanding, check for more writes to initiate
+    // (either queued or via idle). The opsInProgress count is handled in
+    // completion()
     if (!writeInProgress) {
         bool writing = false;
         {
@@ -706,11 +705,8 @@
                 writing = true;
             }
         }
-        if (!writing) {
-            if (queuedClose)
-                close();
-            else
-                notifyIdle();
+        if (!writing && !queuedClose) {
+            notifyIdle();
         }
     }
     return;
@@ -757,9 +753,11 @@
         }
         working = false;
     }
-    // Lock released; ok to delete if all is done.
-    if (opsInProgress == 0 && queuedDelete)
-        delete this;
+    // Lock released; ok to close if ops are done and close requested.
+    // Layer above will call back to queueForDeletion()
+    if (opsInProgress == 0 && queuedClose) {
+        close();
+    }
 }
 
 } // namespace windows



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