summaryrefslogtreecommitdiff
path: root/ACE
diff options
context:
space:
mode:
authorvzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-05-17 11:47:31 +0000
committervzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-05-17 11:47:31 +0000
commit29e07bfc200af7d3a606492bbde46893fd446e6a (patch)
tree9def067de827550a7a433857742ffc1fde75ffe8 /ACE
parent4eb5ef389a2148cab3968e30ed2f4573de0556b5 (diff)
downloadATCD-29e07bfc200af7d3a606492bbde46893fd446e6a.tar.gz
Mon May 17 11:32:52 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
* tests/Dev_Poll_Reactor_Test.cpp: Fixed 2 memory leaks in this test. Previously both client and server svc handlers were leaked. After fixing that it turned out that client is not able to finish properly as its reactor is not shutdown. The later was happening because server was reaching desired exit condition faster and once it get closed client could never get a chance to reach its own exit condition. So, in short, there is no point in this test to run client side reactor if the client's svc handler got closed.
Diffstat (limited to 'ACE')
-rw-r--r--ACE/ChangeLog12
-rw-r--r--ACE/tests/Dev_Poll_Reactor_Test.cpp15
2 files changed, 23 insertions, 4 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 6926c3cb59c..57c4828ab93 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,15 @@
+Mon May 17 11:32:52 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
+
+ * tests/Dev_Poll_Reactor_Test.cpp:
+ Fixed 2 memory leaks in this test. Previously both client and
+ server svc handlers were leaked. After fixing that it turned out
+ that client is not able to finish properly as its reactor is not
+ shutdown. The later was happening because server was reaching
+ desired exit condition faster and once it get closed client could
+ never get a chance to reach its own exit condition. So, in short,
+ there is no point in this test to run client side reactor if the
+ client's svc handler got closed.
+
Fri May 14 22:22:33 UTC 2010 Adam Mitz <mitza@ociweb.com>
* ace/OS_NS_Thread.cpp:
diff --git a/ACE/tests/Dev_Poll_Reactor_Test.cpp b/ACE/tests/Dev_Poll_Reactor_Test.cpp
index 062c4ccd04b..106d2eac55e 100644
--- a/ACE/tests/Dev_Poll_Reactor_Test.cpp
+++ b/ACE/tests/Dev_Poll_Reactor_Test.cpp
@@ -191,7 +191,16 @@ Client::handle_close (ACE_HANDLE handle,
handle,
mask));
- return 0;
+ // There is no point in running reactor after this client is closed.
+ if (this->reactor ()->end_reactor_event_loop () == 0)
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("(%t) Successful client reactor shutdown.\n")));
+ else
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%t) %p\n"),
+ ACE_TEXT ("Failed client reactor shutdown")));
+
+ return SVC_HANDLER::handle_close (handle, mask);
}
// ----------------------------------------------------
@@ -301,11 +310,9 @@ Server::handle_close (ACE_HANDLE handle,
handle,
this->get_handle (),
mask));
-
- return this->peer ().close ();
}
- return 0;
+ return SVC_HANDLER::handle_close (handle, mask);
}
// ----------------------------------------------------