summaryrefslogtreecommitdiff
path: root/ACE/tests/Process_Strategy_Test.cpp
diff options
context:
space:
mode:
authorvzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-03-17 12:21:14 +0000
committervzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-03-17 12:21:14 +0000
commit3a7b3e4e0a4739c1326e04498fcc0c91faa885bf (patch)
tree008ce4e7b7ac719e57dce5f90c151c784b974155 /ACE/tests/Process_Strategy_Test.cpp
parent3f8b10924ec2dd86b94a260a6031723263471d13 (diff)
downloadATCD-3a7b3e4e0a4739c1326e04498fcc0c91faa885bf.tar.gz
Wed Mar 17 11:58:10 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com>
Committed the changes that I had to revert before x.7.7. * ace/Strategies_T.cpp: Changed the code so that close() is called in case of failure instead of destroy(). * ace/Connector.cpp: * ace/Connector.h: Changed the fix for bug#3731. Now NBCH adds a reference in constructor and removes it in destructor if the SVC_HANDLER that it owns is reference counted. This is a cleaner solution than the one used before. * tests/NonBlocking_Conn_Test.h: * tests/Process_Strategy_Test.cpp: * tests/NonBlocking_Conn_Test.cpp: Extended NonBlocking_Conn_Test and changed Process_Strategy_Test because of the change in Strategies_T.cpp. * tests/MT_NonBlocking_Connect_Test.cpp: * tests/tests.mpc: * tests/run_test.lst: Added a new test. This can be a reproducer for the bug#3731 which currently doesn't have its own test.
Diffstat (limited to 'ACE/tests/Process_Strategy_Test.cpp')
-rw-r--r--ACE/tests/Process_Strategy_Test.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/ACE/tests/Process_Strategy_Test.cpp b/ACE/tests/Process_Strategy_Test.cpp
index a4f0d3123ba..74cbf0bfe12 100644
--- a/ACE/tests/Process_Strategy_Test.cpp
+++ b/ACE/tests/Process_Strategy_Test.cpp
@@ -441,8 +441,18 @@ int
Counting_Service::handle_close (ACE_HANDLE,
ACE_Reactor_Mask)
{
- // Done with another connection.
- connection_completed ();
+ // Count completed connections here only when the test is not in
+ // "process-per-connection" mode. In general, this should not be
+ // done here. Proper place for this is activate_svc_handler() but
+ // since only "process-per-connection" hooks into that function in
+ // other modes it's done here. The later creates a problem in
+ // "process-per-connection" mode since it calculates the same
+ // connection twice and as a result it cannot finalize gracefully.
+ if (OPTIONS::instance ()->concurrency_type () != Options::PROCESS)
+ {
+ // Done with another connection.
+ connection_completed ();
+ }
// Call down to base class
return ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>::handle_close ();