diff options
author | Stephen D. Huston <shuston@apache.org> | 2009-03-17 23:19:12 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2009-03-17 23:19:12 +0000 |
commit | 136d48c6eec33708153162f00bb35a65a31e5800 (patch) | |
tree | 6a9bd961a735d9ecd07a4e7a2381656e703bcd85 /cpp | |
parent | 18660ec7737192475cf981d278de26f0efa7e12e (diff) | |
download | qpid-python-136d48c6eec33708153162f00bb35a65a31e5800.tar.gz |
Correct the handling of end-of-connection cases; fixes QPID-1550
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@755441 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/sys/windows/AsynchIO.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/cpp/src/qpid/sys/windows/AsynchIO.cpp b/cpp/src/qpid/sys/windows/AsynchIO.cpp index 37d87947a2..0a3c36452c 100644 --- a/cpp/src/qpid/sys/windows/AsynchIO.cpp +++ b/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 |