summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2009-03-17 23:19:12 +0000
committerStephen D. Huston <shuston@apache.org>2009-03-17 23:19:12 +0000
commit18ba1a802504f4bdccc97bba966b228a52e53782 (patch)
tree32ff867e084562285bf056bac56f5171ce6ada79 /qpid/cpp/src
parentcc4412ec46f2513a26f4211d2b2596cc13f49705 (diff)
downloadqpid-python-18ba1a802504f4bdccc97bba966b228a52e53782.tar.gz
Correct the handling of end-of-connection cases; fixes QPID-1550
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@755441 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-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