summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2009-03-17 23:18:40 +0000
committerStephen D. Huston <shuston@apache.org>2009-03-17 23:18:40 +0000
commitffa3d123fa3d8e327f98fe5554b7637b77894d9c (patch)
tree3131d1fb1cc8f999a29985c5b40a23aef388b94f /qpid/cpp
parent166006bae0f3aa9c0c03e0d3079f727ad893e67a (diff)
downloadqpid-python-ffa3d123fa3d8e327f98fe5554b7637b77894d9c.tar.gz
Correct the handling of end-of-connection cases; fixes QPID-1550
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.5-release@755440 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp b/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp
index 37d87947a2..0a3c36452c 100644
--- a/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp
+++ b/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp
@@ -690,10 +690,9 @@ void AsynchIO::writeComplete(AsynchWriteResult *result) {
}
}
- // 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 @@ void AsynchIO::writeComplete(AsynchWriteResult *result) {
writing = true;
}
}
- if (!writing) {
- if (queuedClose)
- close();
- else
- notifyIdle();
+ if (!writing && !queuedClose) {
+ notifyIdle();
}
}
return;
@@ -757,9 +753,11 @@ void AsynchIO::completion(AsynchIoResult *result) {
}
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