summaryrefslogtreecommitdiff
path: root/ACE/tests/SSL
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 13:56:48 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 13:56:48 +0000
commitc4078c377d74290ebe4e66da0b4975da91732376 (patch)
tree1816ef391e42a07929304908ac0e21f4c2f6cb7b /ACE/tests/SSL
parent700d1c1a6be348c6c70a2085e559baeb8f4a62ea (diff)
downloadATCD-c4078c377d74290ebe4e66da0b4975da91732376.tar.gz
swap in externals for ACE and TAO
Diffstat (limited to 'ACE/tests/SSL')
-rw-r--r--ACE/tests/SSL/Bug_2912_Regression_Test.cpp1279
-rw-r--r--ACE/tests/SSL/Main.cpp30
-rw-r--r--ACE/tests/SSL/Makefile.am79
-rw-r--r--ACE/tests/SSL/SSL_Asynch_Stream_Test.cpp486
-rw-r--r--ACE/tests/SSL/Thread_Pool_Reactor_SSL_Test.cpp354
-rw-r--r--ACE/tests/SSL/Thread_Pool_Reactor_SSL_Test.h50
-rw-r--r--ACE/tests/SSL/acetest.mpb21
-rw-r--r--ACE/tests/SSL/dummy.pem15
-rw-r--r--ACE/tests/SSL/key.pem15
-rw-r--r--ACE/tests/SSL/tests.mpc26
10 files changed, 0 insertions, 2355 deletions
diff --git a/ACE/tests/SSL/Bug_2912_Regression_Test.cpp b/ACE/tests/SSL/Bug_2912_Regression_Test.cpp
deleted file mode 100644
index bdc1bde3af4..00000000000
--- a/ACE/tests/SSL/Bug_2912_Regression_Test.cpp
+++ /dev/null
@@ -1,1279 +0,0 @@
-/**
- * @file Bug_2912_Regression_Test.cpp
- *
- * $Id$
- *
- * Reproduces the problems reported in bug 2912:
- * http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=2912
- *
- * This test reproduces the following interactions:
- *
- * ACE_TMAIN Client proactor Server proactor
- * thread dispatcher thread dispatcher thread
- * ---------------- ------------------- --------------------
- *
- * init_ssl
- * connect
- * SH::open SH::open
- * SH::read SH::read
- * SH::write
- * SH::handle_read_stream
- * SH::write
- * SH::read
- * SH::handle_read_stream
- * SH::read
- * SH::write (causes do_SSL_read to fail)
- *
- * @author Paul Daugherty <paul@nxicom.com>
- */
-
-#include "ace/ACE.h"
-#include "tests/test_config.h"
-#include "ace/SSL/SSL_Asynch_Stream.h"
-#include "ace/Proactor.h"
-#include "ace/Task.h"
-#include "ace/OS.h"
-#include "ace/Asynch_Acceptor.h"
-#include "ace/Asynch_Connector.h"
-#include "ace/Manual_Event.h"
-
-ACE_RCSID (tests,
- Bug_2912_Regression_Test,
- "$Id$")
-
-/* Linux kernels can't hack multiple outstanding I/O, which this
- test requires */
-#if defined (ACE_HAS_THREADS) && \
- (defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)) && \
- !defined (linux)
-
-/**
- * Data payload sent between client and server. Test is not dependent
- * on payload characteristics.
- */
-#define DATA "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-#define DATA_SIZE ACE_OS::strlen(DATA)
-
-
-/**
- * Client's proactor
- *
- * The client and server must use different proactors since this bug is
- * dependent on threads.
- */
-class Client_Proactor : public ACE_Proactor {};
-typedef ACE_Singleton<Client_Proactor, ACE_SYNCH_RECURSIVE_MUTEX>
- Client_Proactor_Singleton;
-#define CLIENT_PROACTOR Client_Proactor_Singleton::instance()
-
-class Client_Proactor_Task : public ACE_Task_Base
-{
-public:
- virtual int svc (void);
-};
-
-typedef ACE_Singleton<Client_Proactor_Task, ACE_SYNCH_RECURSIVE_MUTEX>
- Client_Proactor_Task_Singleton;
-#define CLIENT_PROACTOR_TASK Client_Proactor_Task_Singleton::instance()
-
-int
-Client_Proactor_Task::svc (void)
-{
- CLIENT_PROACTOR->proactor_reset_event_loop ();
- CLIENT_PROACTOR->proactor_run_event_loop ();
- return 0;
-}
-
-
-/**
- * Server's proactor
- */
-class Server_Proactor : public ACE_Proactor {};
-typedef ACE_Singleton<Server_Proactor, ACE_SYNCH_RECURSIVE_MUTEX>
- Server_Proactor_Singleton;
-#define SERVER_PROACTOR Server_Proactor_Singleton::instance ()
-
-class Server_Proactor_Task : public ACE_Task_Base
-{
-public:
- virtual int svc (void);
-};
-
-typedef ACE_Singleton<Server_Proactor_Task, ACE_SYNCH_RECURSIVE_MUTEX>
- Server_Proactor_Task_Singleton;
-#define SERVER_PROACTOR_TASK Server_Proactor_Task_Singleton::instance ()
-
-int
-Server_Proactor_Task::svc (void)
-{
- SERVER_PROACTOR->proactor_reset_event_loop ();
- SERVER_PROACTOR->proactor_run_event_loop ();
- return 0;
-}
-
-/**
- * This test depends on ADH since the error is related to a missing cert.pem
- */
-static DH* dh1024 = 0;
-
-DH*
-get_dh1024 ()
-{
- static unsigned char dh1024_p[]={
- 0xD7,0xFE,0xEC,0x06,0x28,0x03,0x34,0x96,0xB8,0x08,0x86,0x62,
- 0xF1,0xA2,0xBA,0x84,0x7C,0xAF,0xA3,0x1F,0x6A,0x3D,0x03,0x20,
- 0x81,0x8D,0x0E,0x43,0x3A,0x54,0x74,0x9F,0x83,0xD2,0xB7,0xE9,
- 0x57,0xC1,0x67,0xE9,0x11,0x38,0x2B,0x8E,0x9B,0x1C,0x5D,0x14,
- 0x18,0x7D,0x4F,0xEB,0xB1,0x4D,0xFA,0x6F,0x06,0xDD,0xDD,0x6D,
- 0x9A,0xD0,0x9E,0x4F,0xE4,0x04,0x3E,0x86,0x6F,0x15,0x60,0x35,
- 0x9B,0xA1,0xBA,0x53,0xBA,0x84,0xB5,0x06,0xB1,0xAD,0x94,0x25,
- 0xD1,0xED,0xD2,0xF4,0xD7,0x02,0x2F,0x35,0x25,0xE7,0x2D,0x60,
- 0xEE,0x7A,0x61,0xAD,0x98,0xA8,0x3D,0xAD,0xB1,0x8A,0x5E,0xCE,
- 0xF0,0x09,0xD4,0x67,0x28,0x3D,0x52,0x64,0x78,0xBB,0xC3,0x9D,
- 0x40,0xF4,0x72,0xDC,0xC9,0x31,0x0D,0xA3,
- };
- static unsigned char dh1024_g[]={
- 0x02,
- };
- DH *dh;
-
- if ((dh=DH_new()) == 0) return(0);
- dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),0);
- dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),0);
- if ((dh->p == 0) || (dh->g == 0))
- { DH_free(dh); return(0); }
- return(dh);
-}
-
-DH*
-tmp_dh_callback (SSL *s, int is_export, int keylength)
-{
- ACE_UNUSED_ARG(s);
- ACE_UNUSED_ARG(is_export);
-
- switch (keylength) {
- case 1024:
- if (dh1024 == 0)
- {
- dh1024 = get_dh1024();
- }
- return dh1024;
- default:
- /* Generating a key on the fly is very costly, so use what is there */
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("tmp_dh_callback, unsupported key length, %d\n"),
- keylength));
- }
- return(0);
-}
-
-bool
-init_ssl (void)
-{
- SSL_CTX_set_quiet_shutdown (ACE_SSL_Context::instance ()->context(), 1);
- SSL_CTX_set_options (ACE_SSL_Context::instance ()->context(),
- SSL_OP_SINGLE_DH_USE);
- SSL_CTX_set_tmp_dh_callback (ACE_SSL_Context::instance ()->context (),
- tmp_dh_callback);
-
- if (SSL_CTX_set_cipher_list (ACE_SSL_Context::instance ()->context (), "ADH"))
- {
- return true;
- }
- else
- {
- ACE_DEBUG ((LM_ERROR,
- ACE_TEXT ("SSL_CTX_set_cipher_list failed\n")));
- return false;
- }
-}
-
-
-// Function to remove signals from the signal mask.
-static int
-disable_signal (int sigmin, int sigmax)
-{
-#ifndef ACE_WIN32
-
- sigset_t signal_set;
- if (ACE_OS::sigemptyset (&signal_set) == - 1)
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("Error: (%P|%t):%p\n"),
- ACE_TEXT ("sigemptyset failed")));
-
- for (int i = sigmin; i <= sigmax; i++)
- ACE_OS::sigaddset (&signal_set, i);
-
- // Put the <signal_set>.
- if (ACE_OS::pthread_sigmask (SIG_BLOCK, &signal_set, 0) != 0)
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("Error: (%P|%t):%p\n"),
- ACE_TEXT ("pthread_sigmask failed")));
-#else
- ACE_UNUSED_ARG (sigmin);
- ACE_UNUSED_ARG (sigmax);
-#endif /* ACE_WIN32 */
-
- return 1;
-}
-
-
-/**
- * Server's ACE_Service_Handler
- */
-class Server_Service_Handler : public ACE_Service_Handler
-{
-public:
- Server_Service_Handler (void);
-
- virtual ~Server_Service_Handler (void);
-
- //FUZZ: disable check_for_lack_ACE_OS
- virtual void open (ACE_HANDLE h, ACE_Message_Block&);
- //FUZZ: enable check_for_lack_ACE_OS
-
- virtual void handle_read_stream (
- const ACE_Asynch_Read_Stream::Result &result);
-
- virtual void handle_write_stream (
- const ACE_Asynch_Write_Stream::Result &result);
-
- virtual void handle_wakeup (void);
-
- void cancel_and_close (void);
-
- int read_data (void);
-
- int write_data (void);
-
- //FUZZ: disable check_for_lack_ACE_OS
- int read (ACE_Message_Block &mb, size_t bytes_to_read);
-
- int write (ACE_Message_Block &mb, size_t bytes_to_write);
- //FUZZ: enable check_for_lack_ACE_OS
-
- int safe_to_delete (void) const;
-
-private:
- mutable ACE_SYNCH_RECURSIVE_MUTEX mtx_;
- ACE_SSL_Asynch_Stream ssl_stream_;
- int pending_writes_;
- int pending_reads_;
- int handle_wakeup_expected_;
- int handle_wakeup_received_;
- int closing_;
-};
-
-Server_Service_Handler::Server_Service_Handler (void) :
- ssl_stream_ (ACE_SSL_Asynch_Stream::ST_SERVER),
- pending_writes_ (0),
- pending_reads_ (0),
- handle_wakeup_expected_ (0),
- handle_wakeup_received_ (0),
- closing_ (0)
-{
-}
-
-Server_Service_Handler::~Server_Service_Handler (void)
-{
- if (ACE_INVALID_HANDLE != this->handle ())
- {
- ACE_OS::closesocket (this->handle ());
- this->handle (ACE_INVALID_HANDLE);
- }
-}
-
-void
-Server_Service_Handler::open (ACE_HANDLE h, ACE_Message_Block&)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- if (this->ssl_stream_.open (*this, h, 0, this->proactor ()) != 0)
- {
- //FUZZ: disable check_for_lack_ACE_OS
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT("Server_Service_Handler::open: ")
- ACE_TEXT("ACE_SSL_Asynch_Stream::open failed, %d\n"),
- (int)errno));
- //FUZZ: enable check_for_lack_ACE_OS
-
- this->cancel_and_close ();
- }
- else
- {
- if (this->read_data () < 0)
- {
- this->cancel_and_close ();
- }
- }
-}
-
-void
-Server_Service_Handler::handle_read_stream(
- const ACE_Asynch_Read_Stream::Result &result)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->pending_reads_--;
-
- if (!result.success () || 0 == result.bytes_transferred ())
- {
- // Error or remote disconnect
-
- result.message_block ().release ();
-
- if (!this->closing_)
- {
- // No error message when shutting down
-
- if (!result.success ())
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Server_Service_Handler::handle_read_stream: error: %d\n"),
- result.error ()));
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("Server_Service_Handler::handle_read_stream: remote disconnect\n")));
- }
- }
-
- this->cancel_and_close ();
- }
- else if (result.bytes_transferred () < result.bytes_to_read ())
- {
- // More to read...
-
- if (this->read (result.message_block (),
- result.bytes_to_read () - result.bytes_transferred ()) < 0)
- {
- result.message_block ().release ();
-
- this->cancel_and_close ();
- }
- }
- else
- {
- // Read it all
-
- result.message_block ().release ();
-
- // Send data back
-
- if (this->write_data () < 0)
- {
- this->cancel_and_close ();
- }
-
- // Next read
-
- else if (this->read_data () < 0)
- {
- this->cancel_and_close ();
- }
- }
-}
-
-void
-Server_Service_Handler::handle_write_stream (
- const ACE_Asynch_Write_Stream::Result &result)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->pending_writes_--;
-
- if (!result.success () || 0 == result.bytes_transferred ())
- {
- // Error
-
- result.message_block ().release ();
-
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Server_Service_Handler::handle_write_stream: error: %d\n"),
- result.error ()));
-
- this->cancel_and_close ();
- }
- else if (result.bytes_transferred () < result.bytes_to_write ())
- {
- // More to write...
-
- if (this->write(result.message_block (),
- result.bytes_to_write () - result.bytes_transferred ()) < 0)
- {
- result.message_block ().release ();
-
- this->cancel_and_close ();
- }
- }
- else
- {
- // Wrote it all
-
- result.message_block().release ();
- }
-}
-
-void
-Server_Service_Handler::handle_wakeup (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->handle_wakeup_received_ = 1;
-}
-
-void
-Server_Service_Handler::cancel_and_close (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->closing_ = 1;
- this->ssl_stream_.cancel ();
- this->handle_wakeup_expected_ = -1 == this->ssl_stream_.close ();
-}
-
-int
-Server_Service_Handler::read_data (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- ACE_Message_Block *mb;
- ACE_NEW_NORETURN(mb, ACE_Message_Block (DATA_SIZE));
-
- int ret = this->read (*mb, DATA_SIZE);
- if (ret < 0)
- {
- mb->release ();
- return -1;
- }
- else
- {
- return 0;
- }
-}
-
-int
-Server_Service_Handler::write_data (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- ACE_Message_Block *mb;
- ACE_NEW_NORETURN(mb, ACE_Message_Block (DATA_SIZE));
- ACE_OS::memcpy (mb->wr_ptr (), DATA, DATA_SIZE);
- mb->wr_ptr (DATA_SIZE);
-
- int ret = this->write (*mb, DATA_SIZE);
- if (ret < 0)
- {
- mb->release ();
- return -1;
- }
- else
- {
- return 0;
- }
-}
-
-int
-Server_Service_Handler::read (ACE_Message_Block &mb, size_t bytes_to_read)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- int ret;
- if ((ret = this->ssl_stream_.read (mb, bytes_to_read)) < 0)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Server_Service_Handler::read: read failed: %d\n"), (int)errno));
- }
- else
- {
- this->pending_reads_++;
- }
- return ret;
-}
-
-int
-Server_Service_Handler::write (ACE_Message_Block &mb, size_t bytes_to_write)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- int ret;
- if ((ret = this->ssl_stream_.write (mb, bytes_to_write)) < 0)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Server_Service_Handler::write: write failed: %d\n"), (int)errno));
- }
- else
- {
- this->pending_writes_++;
- }
- return ret;
-}
-
-int
-Server_Service_Handler::safe_to_delete (void) const
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- return 0 == this->pending_writes_ &&
- 0 == this->pending_reads_ &&
- (!this->handle_wakeup_expected_ || this->handle_wakeup_received_);
-}
-
-/**
- * Server's acceptor
- */
-class Acceptor : public ACE_Asynch_Acceptor<Server_Service_Handler>
-{
-public:
- Acceptor (void);
-
- virtual ~Acceptor (void);
-
- virtual int cancel (void);
-
- virtual int validate_connection (const ACE_Asynch_Accept::Result& result,
- const ACE_INET_Addr &remote, const ACE_INET_Addr& local);
-
- virtual Server_Service_Handler *make_handler (void);
-
- //FUZZ: disable check_for_lack_ACE_OS
- virtual int accept (size_t bytes_to_read = 0, const void *act = 0);
- //FUZZ: enable check_for_lack_ACE_OS
-
- virtual void handle_accept (const ACE_Asynch_Accept::Result &result);
-
- int safe_to_delete (void) const;
-
- void prepare_for_connection (Server_Service_Handler *service_handler);
-
- mutable ACE_SYNCH_RECURSIVE_MUTEX mtx_;
- int accept_cnt_;
- int cancel_flag_;
- Server_Service_Handler *service_handler_;
-};
-
-typedef ACE_Singleton<Acceptor, ACE_SYNCH_RECURSIVE_MUTEX> Acceptor_Singleton;
-#define ACCEPTOR Acceptor_Singleton::instance ()
-
-Acceptor::Acceptor (void) :
- accept_cnt_ (0),
- cancel_flag_ (0),
- service_handler_ (0)
-{
-}
-
-Acceptor::~Acceptor (void)
-{
-}
-
-int
-Acceptor::cancel (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->cancel_flag_ = 1;
- this->reissue_accept (0);
-
- ACE_HANDLE h = this->get_handle ();
- if (h != ACE_INVALID_HANDLE)
- {
- this->ACE_Asynch_Acceptor<Server_Service_Handler>::cancel ();
-
- ACE_OS::closesocket (h);
- this->handle (ACE_INVALID_HANDLE);
- }
-
- return 0;
-}
-
-int
-Acceptor::safe_to_delete (void) const
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
- return (this->cancel_flag_ != 0 && this->accept_cnt_ == 0) ? 1 : 0;
-}
-
-void
-Acceptor::prepare_for_connection (Server_Service_Handler *service_handler)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
- this->service_handler_ = service_handler;
-}
-
-int
-Acceptor::validate_connection (const ACE_Asynch_Accept::Result& result,
- const ACE_INET_Addr & /*remote*/, const ACE_INET_Addr& /*local*/)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- if (0 != this->service_handler_ && result.success ())
- {
- return 0;
- }
- else
- {
- return -1;
- }
-}
-
-Server_Service_Handler*
-Acceptor::make_handler (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- ACE_ASSERT (0 != this->service_handler_);
- Server_Service_Handler *service_handler = this->service_handler_;
- this->service_handler_ = 0;
- return service_handler;
-}
-
-int
-Acceptor::accept (size_t bytes_to_read, const void *act)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- if (this->cancel_flag_!= 0)
- return -1;
-
- this->accept_cnt_++;
- int rc = this->ACE_Asynch_Acceptor<Server_Service_Handler>::accept (
- bytes_to_read, act);
- if (rc != 0)
- this->accept_cnt_--;
-
- return rc;
-}
-
-void
-Acceptor::handle_accept (const ACE_Asynch_Accept::Result &result)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->ACE_Asynch_Acceptor<Server_Service_Handler>::handle_accept (result);
-
- --this->accept_cnt_;
-}
-
-
-/**
- * Client's ACE_Service_Handler
- */
-class Client_Service_Handler : public ACE_Service_Handler
-{
-public:
- Client_Service_Handler (void);
-
- virtual ~Client_Service_Handler (void);
-
- //FUZZ: disable check_for_lack_ACE_OS
- virtual void open (ACE_HANDLE h, ACE_Message_Block&);
- //FUZZ: enable check_for_lack_ACE_OS
-
- virtual void handle_read_stream (
- const ACE_Asynch_Read_Stream::Result &result);
-
- virtual void handle_write_stream (
- const ACE_Asynch_Write_Stream::Result &result);
-
- virtual void handle_wakeup (void);
-
- void cancel_and_close (void);
-
- int read_data (void);
-
- int write_data (void);
-
- //FUZZ: disable check_for_lack_ACE_OS
- int read (ACE_Message_Block &mb, size_t bytes_to_read);
-
- int write (ACE_Message_Block &mb, size_t bytes_to_write);
- //FUZZ: enable check_for_lack_ACE_OS
-
- int safe_to_delete (void) const;
-
- int wait_for_external_write_queue (ACE_Time_Value *wait_time);
-
- int wait_for_read_completed (ACE_Time_Value *wait_time);
-
- int read_successful (void) const;
-
-private:
- mutable ACE_SYNCH_RECURSIVE_MUTEX mtx_;
- ACE_SSL_Asynch_Stream ssl_stream_;
- ACE_Manual_Event ready_for_external_write_;
- ACE_Manual_Event read_completed_;
- int read_successful_;
- int pending_writes_;
- int pending_reads_;
- int handle_wakeup_expected_;
- int handle_wakeup_received_;
- int completed_reads_;
- int closing_;
-};
-
-Client_Service_Handler::Client_Service_Handler (void) :
- ssl_stream_ (ACE_SSL_Asynch_Stream::ST_CLIENT),
- read_successful_ (0),
- pending_writes_ (0),
- pending_reads_ (0),
- handle_wakeup_expected_ (0),
- handle_wakeup_received_ (0),
- completed_reads_ (0),
- closing_ (0)
-{
-}
-
-Client_Service_Handler::~Client_Service_Handler (void)
-{
- if (ACE_INVALID_HANDLE != this->handle ())
- {
- ACE_OS::closesocket (this->handle ());
- this->handle (ACE_INVALID_HANDLE);
- }
-}
-
-void
-Client_Service_Handler::open (ACE_HANDLE h, ACE_Message_Block&)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- if (this->ssl_stream_.open (*this, h, 0, this->proactor ()) != 0)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Client_Service_Handler::open: ACE_SSL_Asynch_Stream::open failed, %d\n"),
- (int)errno));
- this->cancel_and_close ();
- }
- else
- {
- ACE_Message_Block *mb;
- ACE_NEW_NORETURN(mb, ACE_Message_Block (DATA_SIZE));
-
- if (this->read_data () < 0 || this->write_data () < 0)
- {
- this->cancel_and_close ();
- }
- }
-}
-
-void
-Client_Service_Handler::handle_read_stream (
- const ACE_Asynch_Read_Stream::Result &result)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->pending_reads_--;
-
- if (!result.success () || 0 == result.bytes_transferred ())
- {
- // Error or remote disconnect
-
- result.message_block ().release ();
-
- if (!this->closing_)
- {
- // No error message when shutting down
-
- if (!result.success ())
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Client_Service_Handler::handle_read_stream: error: %d\n"),
- result.error ()));
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Client_Service_Handler::handle_read_stream: remote disconnect\n")));
- }
- }
-
- this->read_completed_.signal ();
-
- this->cancel_and_close ();
- }
- else if (result.bytes_transferred () < result.bytes_to_read ())
- {
- // More to read...
-
- if (this->read (result.message_block(),
- result.bytes_to_read () - result.bytes_transferred ()) < 0)
- {
- result.message_block ().release ();
-
- this->cancel_and_close ();
- }
- }
- else
- {
- // Read it all
-
- this->completed_reads_++;
-
- result.message_block ().release ();
-
- // We now have sent and received data in the proactor thread. Signal the
- // main thread to try sending data in the main thread.
- if (this->completed_reads_ == 1)
- {
- this->ready_for_external_write_.signal ();
- }
- else
- {
- // The main thread wrote data that was echoed back to us on our
- // second read. If we get here, the test was successful in that
- // the main thread successfully sent data to the server.
- this->read_successful_ = 1;
- this->read_completed_.signal ();
- }
-
- // Next read
- if (this->read_data () < 0)
- {
- this->cancel_and_close ();
- }
- }
-}
-
-void
-Client_Service_Handler::handle_write_stream (
- const ACE_Asynch_Write_Stream::Result &result)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->pending_writes_--;
-
- if (!result.success () || 0 == result.bytes_transferred ())
- {
- // Error
-
- result.message_block ().release ();
-
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Client_Service_Handler::handle_write_stream: error: %d\n"),
- result.error ()));
-
- this->cancel_and_close ();
- }
- else if (result.bytes_transferred () < result.bytes_to_write ())
- {
- // More to write...
-
- if (this->write (result.message_block(),
- result.bytes_to_write () - result.bytes_transferred ()) < 0)
- {
- result.message_block ().release ();
-
- this->cancel_and_close ();
- }
- }
- else
- {
- // Wrote it all
-
- result.message_block ().release ();
- }
-}
-
-void
-Client_Service_Handler::handle_wakeup (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->handle_wakeup_received_ = 1;
-}
-
-void
-Client_Service_Handler::cancel_and_close (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->closing_ = 1;
- this->ssl_stream_.cancel ();
- this->handle_wakeup_expected_ = -1 == this->ssl_stream_.close ();
-}
-
-int
-Client_Service_Handler::read_data (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- ACE_Message_Block *mb;
- ACE_NEW_NORETURN(mb, ACE_Message_Block (DATA_SIZE));
-
- int ret = this->read (*mb, DATA_SIZE);
- if (ret < 0)
- {
- mb->release ();
- return -1;
- }
- else
- {
- return 0;
- }
-}
-
-int
-Client_Service_Handler::write_data (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- ACE_Message_Block *mb;
- ACE_NEW_NORETURN (mb, ACE_Message_Block (DATA_SIZE));
- ACE_OS::memcpy (mb->wr_ptr (), DATA, DATA_SIZE);
- mb->wr_ptr (DATA_SIZE);
-
- int ret = this->write (*mb, DATA_SIZE);
- if (ret < 0)
- {
- mb->release ();
- return -1;
- }
- else
- {
- return 0;
- }
-}
-
-int
-Client_Service_Handler::read (ACE_Message_Block &mb, size_t bytes_to_read)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- int ret;
- if ((ret = this->ssl_stream_.read (mb, bytes_to_read)) < 0)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Client_Service_Handler::read: read failed: %d\n"), (int)errno));
- }
- else
- {
- this->pending_reads_++;
- }
- return ret;
-}
-
-int
-Client_Service_Handler::write (ACE_Message_Block &mb, size_t bytes_to_write)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- int ret;
- if ((ret = this->ssl_stream_.write (mb, bytes_to_write)) < 0)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Client_Service_Handler::write: write failed: %d\n"), (int)errno));
- }
- else
- {
- this->pending_writes_++;
- }
- return ret;
-}
-
-int
-Client_Service_Handler::safe_to_delete (void) const
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- return 0 == this->pending_writes_ &&
- 0 == this->pending_reads_ &&
- (!this->handle_wakeup_expected_ || this->handle_wakeup_received_);
-}
-
-int
-Client_Service_Handler::wait_for_external_write_queue (ACE_Time_Value *wait_time)
-{
- return this->ready_for_external_write_.wait (wait_time, 0);
-}
-
-int
-Client_Service_Handler::wait_for_read_completed (ACE_Time_Value *wait_time)
-{
- return this->read_completed_.wait (wait_time, 0);
-}
-
-int
-Client_Service_Handler::read_successful (void) const
-{
- return this->read_successful_;
-}
-
-/**
- * Client's connector
- */
-class Connector : public ACE_Asynch_Connector<Client_Service_Handler>
-{
-public:
- Connector (void);
-
- virtual ~Connector (void);
-
- //FUZZ: disable check_for_lack_ACE_OS
- virtual int connect (
- const ACE_INET_Addr &remote_sap,
- const ACE_INET_Addr &local_sap =
- (const ACE_INET_Addr &)ACE_Addr::sap_any,
- int reuse_addr = 1,
- const void *act = 0);
- //FUZZ: enable check_for_lack_ACE_OS
-
- virtual int validate_connection (
- const ACE_Asynch_Connect::Result& result,
- const ACE_INET_Addr &remote,
- const ACE_INET_Addr& local);
-
- int safe_to_delete (void) const;
-
- void prepare_for_connection (Client_Service_Handler *service_handler);
-
-protected:
- virtual void handle_connect (const ACE_Asynch_Connect::Result &result);
-
- virtual Client_Service_Handler* make_handler (void);
-
- mutable ACE_SYNCH_RECURSIVE_MUTEX mtx_;
- Client_Service_Handler *service_handler_;
- int connecting_;
-};
-
-typedef ACE_Singleton<Connector, ACE_SYNCH_RECURSIVE_MUTEX> Connector_Singleton;
-#define CONNECTOR Connector_Singleton::instance ()
-
-Connector::Connector (void) :
- service_handler_ (0)
-{
-}
-
-Connector::~Connector (void)
-{
-}
-
-int
-Connector::connect (const ACE_INET_Addr &remote_sap,
- const ACE_INET_Addr &local_sap, int reuse_addr, const void *act)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->connecting_ = 1;
-
- return this->ACE_Asynch_Connector<Client_Service_Handler>::connect (
- remote_sap, local_sap, reuse_addr, act);
-}
-
-int
-Connector::validate_connection (const ACE_Asynch_Connect::Result& result,
- const ACE_INET_Addr &remote, const ACE_INET_Addr& local)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- ACE_UNUSED_ARG (result);
- ACE_UNUSED_ARG (remote);
- ACE_UNUSED_ARG (local);
-
- if (!result.success ())
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Connector::validate_connection failed: %d\n"), result.error ()));
- return -1;
- }
- else
- {
- return 0;
- }
-}
-
-void
-Connector::handle_connect (const ACE_Asynch_Connect::Result &result)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- this->ACE_Asynch_Connector<Client_Service_Handler>::handle_connect (result);
-
- this->connecting_ = 0;
-}
-
-Client_Service_Handler*
-Connector::make_handler (void)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- ACE_ASSERT(0 != this->service_handler_);
- Client_Service_Handler *service_handler = this->service_handler_;
- this->service_handler_ = 0;
- return service_handler;
-}
-
-int
-Connector::safe_to_delete (void) const
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
-
- return 0 == this->connecting_;
-}
-
-void
-Connector::prepare_for_connection (Client_Service_Handler *service_handler)
-{
- ACE_Guard<ACE_SYNCH_RECURSIVE_MUTEX> guard (this->mtx_);
- this->service_handler_ = service_handler;
-}
-
-int
-run_main (int, ACE_TCHAR *[])
-{
- ACE_START_TEST (ACE_TEXT ("Bug_2912_Regression_Test"));
-
- // SSL_CTX_set_cipher_list, etc.
- init_ssl ();
-
- // Keep RT signals on POSIX from killing us.
- disable_signal (ACE_SIGRTMIN, ACE_SIGRTMAX);
-
- int ret = 0;
- Client_Service_Handler client_handler;
- Server_Service_Handler server_handler;
- ACE_Time_Value wait_time (10, 0);
-
- // Client and Server will utilize different proactors since this test
- // depends on SSL thread error state behavior.
-
- CLIENT_PROACTOR_TASK->activate ();
- SERVER_PROACTOR_TASK->activate ();
-
- // Open server acceptor and client connector
-
- if (0 == ret)
- {
- ret = ACCEPTOR->open (
- ACE_INET_Addr (ACE_DEFAULT_SERVER_PORT),
- 0,
- 0,
- ACE_DEFAULT_ASYNCH_BACKLOG,
- 1,
- SERVER_PROACTOR,
- 1);
-
- if (-1 == ret)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "ACE_Asynch_Acceptor::open failed, %d\n"), (int)errno));
- }
- }
-
- if (0 == ret)
- {
- ret = CONNECTOR->open (0, CLIENT_PROACTOR, 1);
-
- if (-1 == ret)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "ACE_Asynch_Connector::open failed, %d\n"), (int)errno));
- }
- }
-
- // Supply server_handler and client_handler to acceptor and connector and
- // connect client to the server.
-
- if (0 == ret)
- {
- ACCEPTOR->prepare_for_connection (&server_handler);
- CONNECTOR->prepare_for_connection (&client_handler);
-
- ret = CONNECTOR->connect (
- ACE_INET_Addr (ACE_DEFAULT_SERVER_PORT, ACE_LOCALHOST));
-
- if (-1 == ret)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "ACE_Asynch_Connector::connect failed, %d\n"), (int)errno));
- }
- }
-
- if (0 == ret)
- {
- ret = client_handler.wait_for_external_write_queue (&wait_time);
- if (-1 == ret)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Timed out waiting for client's write readiness\n")));
- }
- }
-
- // Client sends data to server
-
- if (0 == ret)
- {
- ret = client_handler.write_data ();
- }
-
- // Client waits for echo reply from server
-
- if (0 == ret)
- {
- ret = client_handler.wait_for_read_completed (&wait_time);
-
- if (-1 == ret)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (
- "Timed out waiting for client's read to complete\n")));
- }
- }
-
- if (0 == ret)
- {
- if (client_handler.read_successful () == 1)
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Success\n")));
- ret = 0;
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Client's read failed\n")));
- ret = -1;
- }
- }
-
- // Cleanup and shutdown
-
- ACCEPTOR->cancel ();
- while (!ACCEPTOR->safe_to_delete ())
- ACE_OS::sleep (ACE_Time_Value (0, 500000));
-
- CONNECTOR->cancel ();
- while (!CONNECTOR->safe_to_delete ())
- ACE_OS::sleep (ACE_Time_Value (0, 500000));
-
- client_handler.cancel_and_close ();
- while (!client_handler.safe_to_delete ())
- ACE_OS::sleep (ACE_Time_Value (0, 500000));
-
- server_handler.cancel_and_close ();
- while (!server_handler.safe_to_delete ())
- ACE_OS::sleep (ACE_Time_Value (0, 500000));
-
- CLIENT_PROACTOR->proactor_end_event_loop ();
- CLIENT_PROACTOR_TASK->wait ();
-
- SERVER_PROACTOR->proactor_end_event_loop ();
- SERVER_PROACTOR_TASK->wait ();
-
- ACE_END_TEST;
-
- return 0;
-}
-
-#else
-int
-run_main (int, ACE_TCHAR *[])
-{
- ACE_START_TEST (ACE_TEXT ("Bug_2912_Regression_Test"));
-
- ACE_DEBUG ((LM_INFO,
- ACE_TEXT ("threads or proactor not supported on this platform\n")));
-
- ACE_END_TEST;
- return 0;
-}
-#endif /* ACE_HAS_THREADS && (ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS) && !linux */
diff --git a/ACE/tests/SSL/Main.cpp b/ACE/tests/SSL/Main.cpp
deleted file mode 100644
index 44b92128394..00000000000
--- a/ACE/tests/SSL/Main.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// tests
-//
-// = FILENAME
-// Main.cpp
-//
-// = DESCRIPTION
-// This is a wrapper for the test programs. It obviates the test cpp's
-// from having to always include OS.h.
-//
-// = AUTHOR
-// Don Hinton <dhinton@dresystems.com>
-//
-// ============================================================================
-
-#include "ace/OS_main.h"
-#if defined (ACE_HAS_WINCE)
-# include "ace/ACE.h"
-#endif /* ACE_HAS_WINCE */
-int run_main (int argc, ACE_TCHAR *argv[]);
-
-int
-ACE_TMAIN (int argc, ACE_TCHAR *argv[])
-{
- return run_main (argc, argv);
-}
diff --git a/ACE/tests/SSL/Makefile.am b/ACE/tests/SSL/Makefile.am
deleted file mode 100644
index ee10293e8ca..00000000000
--- a/ACE/tests/SSL/Makefile.am
+++ /dev/null
@@ -1,79 +0,0 @@
-## Process this file with automake to create Makefile.in
-##
-## $Id$
-##
-## This file was generated by MPC. Any changes made directly to
-## this file will be lost the next time it is generated.
-##
-## MPC Command:
-## ./bin/mwc.pl -type automake -noreldefs ACE.mwc
-
-ACE_BUILDDIR = $(top_builddir)
-ACE_ROOT = $(top_srcdir)
-
-noinst_PROGRAMS =
-
-## Makefile.SSL_Asynch_Stream_Test.am
-
-if BUILD_SSL
-if !BUILD_ACE_FOR_TAO
-
-noinst_PROGRAMS += SSL_Asynch_Stream_Test
-
-SSL_Asynch_Stream_Test_CPPFLAGS = \
- -I$(ACE_ROOT) \
- -I$(ACE_BUILDDIR) \
- -DACE_HAS_SSL=1 \
- @ACE_TLS_CPPFLAGS@
-
-SSL_Asynch_Stream_Test_SOURCES = \
- $(ACE_ROOT)/tests/Main.cpp \
- SSL_Asynch_Stream_Test.cpp
-
-SSL_Asynch_Stream_Test_LDFLAGS = \
- @ACE_TLS_LDFLAGS@
-
-SSL_Asynch_Stream_Test_LDADD = \
- $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
- $(top_builddir)/tests/libTest_Output.la \
- $(ACE_BUILDDIR)/ace/libACE.la \
- @ACE_TLS_LIBS@
-
-endif !BUILD_ACE_FOR_TAO
-endif BUILD_SSL
-
-## Makefile.Thread_Pool_Reactor_SSL_Test.am
-
-if BUILD_SSL
-
-noinst_PROGRAMS += Thread_Pool_Reactor_SSL_Test
-
-Thread_Pool_Reactor_SSL_Test_CPPFLAGS = \
- -I$(ACE_ROOT) \
- -I$(ACE_BUILDDIR) \
- -DACE_HAS_SSL=1 \
- @ACE_TLS_CPPFLAGS@
-
-Thread_Pool_Reactor_SSL_Test_SOURCES = \
- $(ACE_ROOT)/tests/Main.cpp \
- Thread_Pool_Reactor_SSL_Test.cpp \
- Thread_Pool_Reactor_SSL_Test.h
-
-Thread_Pool_Reactor_SSL_Test_LDFLAGS = \
- @ACE_TLS_LDFLAGS@
-
-Thread_Pool_Reactor_SSL_Test_LDADD = \
- $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
- $(top_builddir)/tests/libTest_Output.la \
- $(ACE_BUILDDIR)/ace/libACE.la \
- @ACE_TLS_LIBS@
-
-endif BUILD_SSL
-
-## Clean up template repositories, etc.
-clean-local:
- -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
- -rm -f gcctemp.c gcctemp so_locations *.ics
- -rm -rf cxx_repository ptrepository ti_files
- -rm -rf templateregistry ir.out
- -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/ACE/tests/SSL/SSL_Asynch_Stream_Test.cpp b/ACE/tests/SSL/SSL_Asynch_Stream_Test.cpp
deleted file mode 100644
index dc07b703530..00000000000
--- a/ACE/tests/SSL/SSL_Asynch_Stream_Test.cpp
+++ /dev/null
@@ -1,486 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// tests/SSL
-//
-// = FILENAME
-// SSL_Asynch_Stream_Test.cpp
-//
-// = DESCRIPTION
-// This program is a functionality test of ACE_SSL_Asynch_Stream.
-// It demonstrates one proper use case of ACE_SSL_Asynch_Stream in the
-// Proactor framework and validates its basic functionality.
-//
-// Usage: SSL_Asynch_Stream_Test [-r <hostname:port#>]
-// [-t <num threads>] [-d <delay>]
-// [-i <client conn attempt#>] [-n <client request# per conn>]
-//
-// Default value:
-// <hostname:port#>: ACE_DEFAULT_SERVER_HOST:ACE_DEFAULT_PORT
-// <num threads>: ACE_MAX_THREADS
-// <client conn attempt#>: ACE_MAX_ITERATIONS
-// <client req# per conn>: 20
-// <delay>: 0 usec
-//
-// = AUTHOR
-// Steve Huston <shuston@riverace.com>
-//
-// ============================================================================
-
-#include "tests/test_config.h"
-#include "ace/Default_Constants.h"
-#include "ace/OS_NS_string.h"
-#include "ace/Event_Handler.h"
-#include "ace/Get_Opt.h"
-#include "ace/Proactor.h"
-#include "ace/Reactor.h"
-#include "ace/Thread_Manager.h"
-#include "ace/INET_Addr.h"
-#include "ace/SSL/SSL_Asynch_Stream.h"
-#include "ace/SSL/SSL_SOCK_Connector.h"
-#include "ace/SSL/SSL_SOCK_Acceptor.h"
-#include "ace/SSL/SSL_SOCK_Stream.h"
-
-ACE_RCSID(tests, SSL_Asynch_Stream_Test, "$Id$")
-
-#if defined (ACE_HAS_THREADS) && ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS)))
- // This only works on Win32 platforms and on Unix platforms
- // supporting POSIX aio calls.
-
-class Client_Handler : public ACE_Handler
-{
-public:
- Client_Handler ()
- : msgs_sent_ (0),
- stream_ (ACE_SSL_Asynch_Stream::ST_CLIENT),
- block_ (1024) {}
- ~Client_Handler ();
-
- //FUZZ: disable check_for_lack_ACE_OS
- int open (ACE_HANDLE);
- //FUZZ: enable check_for_lack_ACE_OS
-
-private:
- virtual void handle_write_stream (const ACE_SSL_Asynch_Write_Stream_Result &result);
-
-private:
- size_t msgs_sent_;
- ACE_SSL_Asynch_Stream stream_;
- ACE_Message_Block block_;
-};
-
-class Server_Handler : public ACE_Handler
-{
-public:
- Server_Handler ()
- : msgs_rcvd_ (0),
- stream_ (ACE_SSL_Asynch_Stream::ST_SERVER),
- block_ (1024) {}
- ~Server_Handler ();
-
- //FUZZ: disable check_for_lack_ACE_OS
- int open (ACE_HANDLE);
- //FUZZ: enable check_for_lack_ACE_OS
-
-private:
- virtual void handle_read_stream (const ACE_SSL_Asynch_Read_Stream_Result &result);
-
-private:
- size_t msgs_rcvd_;
- ACE_SSL_Asynch_Stream stream_;
- ACE_Message_Block block_;
-};
-
-class Server_Acceptor : public ACE_Event_Handler
-{
-public:
- //FUZZ: disable check_for_lack_ACE_OS
- int open (const ACE_INET_Addr &listen_addr);
- //FUZZ: enable check_for_lack_ACE_OS
-
- // Called when a new connection is ready to accept.
- virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE);
-
- virtual int handle_close (ACE_HANDLE handle,
- ACE_Reactor_Mask close_mask);
-
-private:
- ACE_SSL_SOCK_Acceptor acceptor_;
-};
-
-// Accepting end point. This is actually "localhost:10010", but some
-// platform couldn't resolve the name so we use the IP address
-// directly here.
-static const ACE_TCHAR *rendezvous = \
- ACE_DEFAULT_SERVER_HOST ACE_TEXT (":") ACE_DEFAULT_SERVER_PORT_STR;
-
-// Total number of proactor threads.
-static size_t num_threads = ACE_MAX_THREADS;
-
-#if defined (CHORUS) // Add platforms that can't handle too many
- // connection simultaneously here.
-#define ACE_LOAD_FACTOR /2
-#else
-#define ACE_LOAD_FACTOR
-#endif
-
-// Number of client connections to attempt.
-static size_t cli_conn_no = ACE_MAX_ITERATIONS ACE_LOAD_FACTOR;
-
-// Number of requests each client connection sends.
-static size_t cli_req_no = ACE_MAX_THREADS ACE_LOAD_FACTOR;
-
-// Delay before a thread sending the next request (in msec.)
-static int req_delay = 0;
-
-// This is the string sent from client to server.
-static const char *test_string = "SSL_Asynch_Stream_Test!";
-
-static void
-parse_args (int argc, ACE_TCHAR *argv[])
-{
- //FUZZ: disable check_for_lack_ACE_OS
- ACE_Get_Opt getopt (argc, argv, ACE_TEXT ("r:t:d:i:n:"));
-
- int c;
-
- while ((c = getopt ()) != -1)
- {
- //FUZZ: enable check_for_lack_ACE_OS
- switch (c)
- {
- case 'r': // hostname:port
- rendezvous = getopt.opt_arg ();
- break;
- case 't':
- num_threads = ACE_OS::atoi (getopt.opt_arg ());
- break;
- case 'd':
- req_delay = ACE_OS::atoi (getopt.opt_arg ());
- break;
- case 'i':
- cli_conn_no = ACE_OS::atoi (getopt.opt_arg ());
- break;
- case 'n':
- cli_req_no = ACE_OS::atoi (getopt.opt_arg ());
- break;
- default:
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("Usage: %s [-r <hostname:port#>]")
- ACE_TEXT ("\t[-t <nr threads>] [-d <delay>]")
- ACE_TEXT ("\t[-i <client conn attempt#>]")
- ACE_TEXT ("\t[-n <client request# per conn>]\n"),
- argv[0]));
- break;
- }
- }
-}
-
-Client_Handler::~Client_Handler ()
-{
- if (this->stream_.handle () != ACE_INVALID_HANDLE)
- {
- if (this->msgs_sent_ != cli_req_no)
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("(%t) Client handle %d sent %d messages; ")
- ACE_TEXT ("expected %d\n"),
- this->stream_.handle (),
- this->msgs_sent_,
- cli_req_no));
- else
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%t) Client handle %d sent %d messages; ")
- ACE_TEXT ("closing connection\n"),
- this->stream_.handle (),
- cli_req_no));
- }
- this->stream_.close ();
-}
-
-int
-Client_Handler::open (ACE_HANDLE handle)
-{
- if (this->stream_.open (*this, handle) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%t) Client_Handler: %p\n"),
- ACE_TEXT ("open")),
- -1);
- this->block_.copy (test_string);
- if (this->stream_.write (this->block_, this->block_.length ()) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%t) Client_Handler: %p\n"),
- ACE_TEXT ("initiate write")),
- -1);
- return 0;
-}
-
-void
-Client_Handler::handle_write_stream
- (const ACE_SSL_Asynch_Write_Stream_Result &result)
-{
- if (!result.success ())
- {
- errno = result.error ();
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("(%t) Client handle %d: %p\n"),
- this->stream_.handle (),
- ACE_TEXT ("write")));
- delete this;
- return;
- }
- ACE_Message_Block &b = result.message_block ();
- bool send_again = true;
- if (b.length () == 0)
- {
- // All block's data sent; rewind the read pointer and send it again
- // until we've sent the configured number of times.
- ++this->msgs_sent_;
- if (this->msgs_sent_ == cli_req_no)
- send_again = false; // All done
- else
- b.rd_ptr (b.base ());
- }
-
- if (send_again)
- {
- if (this->stream_.write (this->block_, this->block_.length ()) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("(%t) Client_Handler: %p\n"),
- ACE_TEXT ("initiate write")));
- delete this;
- }
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%t) Client handle %d done sending\n"),
- this->stream_.handle ()));
- delete this;
- }
- return;
-}
-
-Server_Handler::~Server_Handler ()
-{
- if (this->stream_.handle () != ACE_INVALID_HANDLE)
- {
- if (this->msgs_rcvd_ != cli_req_no)
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("(%t) Server handle %d received %d messages; ")
- ACE_TEXT ("expected %d\n"),
- this->stream_.handle (),
- this->msgs_rcvd_,
- cli_req_no));
- else
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%t) Server handle %d received %d messages; ")
- ACE_TEXT ("closing connection\n"),
- this->stream_.handle (),
- cli_req_no));
- }
- this->stream_.close ();
-}
-
-int
-Server_Handler::open (ACE_HANDLE handle)
-{
- if (this->stream_.open (*this, handle) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%t) Server_Handler: %p\n"),
- ACE_TEXT ("open")),
- -1);
- if (this->stream_.read (this->block_, this->block_.space () - 1) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%t) Server_Handler: %p\n"),
- ACE_TEXT ("read")),
- -1);
- return 0;
-}
-
-void
-Server_Handler::handle_read_stream
- (const ACE_SSL_Asynch_Read_Stream_Result &result)
-{
- if (!result.success ())
- {
- errno = result.error ();
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("(%t) Server handle %d: %p\n"),
- this->stream_.handle (),
- ACE_TEXT ("read")));
- delete this;
- return;
- }
- if (result.bytes_transferred () == 0)
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%t) Server handle %d closed by peer\n"),
- this->stream_.handle ()));
- delete this;
- return;
- }
-
- // Scan through the received data for the expected string. There may be
- // multiples and/or partials. Count up how many arrive before the connection
- // is closed.
- // The read operation left one byte space at the end so we can insert a
- // nul terminator to ease scanning.
- ACE_Message_Block &b = result.message_block ();
- *(b.wr_ptr ()) = '\0';
- size_t test_string_len = ACE_OS::strlen (test_string);
- while (b.length () >= test_string_len)
- {
- if (0 != ACE_OS::strncmp (b.rd_ptr (), test_string, test_string_len))
- ACE_ERROR_BREAK ((LM_ERROR,
- ACE_TEXT ("(%t) Read string: %C; expected: %C\n"),
- b.rd_ptr (),
- test_string));
- b.rd_ptr (test_string_len);
- }
- b.crunch ();
- if (this->stream_.read (b, b.space () - 1) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("(%t) Server_Handler: %p\n"),
- ACE_TEXT ("read")));
- delete this;
- }
- return;
-}
-
-
-int
-Server_Acceptor::open (const ACE_INET_Addr &listen_addr)
-{
- if (this->acceptor_.open (listen_addr) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("%p\n"),
- ACE_TEXT ("listen")),
- -1);
- return 0;
-}
-
-int
-Server_Acceptor::handle_input (ACE_HANDLE)
-{
- ACE_SSL_SOCK_Stream new_stream;
- if (this->acceptor_.accept (new_stream) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%t) %p\n"),
- ACE_TEXT ("accept")),
- -1);
- Server_Handler *new_handler = 0;
- ACE_NEW_RETURN (new_handler, Server_Handler, -1);
- if (new_handler->open (new_stream.get_handle ()) != 0)
- delete new_handler;
-
- return 0;
-}
-
-int
-Server_Acceptor::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
-{
- this->acceptor_.close ();
- return 0;
-}
-
-
-static ACE_THR_FUNC_RETURN
-proactor_loop (void *)
-{
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) Start handling events.\n")));
-
- int result =
- ACE_Proactor::instance ()->proactor_run_event_loop ();
- if (result == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%t) %p\n"),
- ACE_TEXT ("Error handling events")),
- 0);
-
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) Done handling events.\n")));
-
- return 0;
-}
-
-static ACE_THR_FUNC_RETURN
-start_clients (void *)
-{
- // Client thread function.
- ACE_INET_Addr addr (rendezvous);
- ACE_SSL_SOCK_Stream stream;
- ACE_SSL_SOCK_Connector connect;
-
- for (size_t i = 0 ; i < cli_conn_no; i++)
- {
- if (connect.connect (stream, addr) < 0)
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("(%t) %p\n"),
- ACE_TEXT ("connect")));
- continue;
- }
-
- Client_Handler *new_handler = 0;
- ACE_NEW_RETURN (new_handler, Client_Handler, (ACE_THR_FUNC_RETURN)-1);
- if (new_handler->open (stream.get_handle ()) != 0)
- delete new_handler;
- stream.set_handle (ACE_INVALID_HANDLE);
- }
-
- return 0;
-}
-
-int
-run_main (int argc, ACE_TCHAR *argv[])
-{
- ACE_START_TEST (ACE_TEXT ("SSL_Asynch_Stream_Test"));
-
- ACE_SSL_Context *context = ACE_SSL_Context::instance ();
- // Note - the next two strings are naked on purpose... the arguments to
- // the ACE_SSL_Context methods are const char *, not ACE_TCHAR *.
- context->certificate ("dummy.pem", SSL_FILETYPE_PEM);
- context->private_key ("key.pem", SSL_FILETYPE_PEM);
-
- parse_args (argc, argv);
-
- Server_Acceptor acceptor;
- ACE_INET_Addr accept_addr (rendezvous);
-
- if (acceptor.open (accept_addr) == -1)
- return 1;
-
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) Listening at %s\n"), rendezvous));
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%t) Spawning %d proactor threads\n"),
- num_threads));
- ACE_Thread_Manager::instance ()->spawn_n (num_threads, proactor_loop);
- ACE_Thread_Manager::instance ()->spawn (start_clients);
-
- ACE_Time_Value loop_limit (20);
- ACE_Reactor::instance ()->run_reactor_event_loop (loop_limit);
- ACE_Thread_Manager::instance ()->wait ();
-
- // Check for num connections up/down.
-
- ACE_END_TEST;
- return 0;
-}
-
-#else
-int
-run_main (int, ACE_TCHAR *[])
-{
- ACE_START_TEST (ACE_TEXT ("SSL_Asynch_Stream_Test"));
-
- ACE_ERROR ((LM_INFO,
- ACE_TEXT ("This test requires threads and AIO which are not ")
- ACE_TEXT ("supported on this platform\n")));
-
- ACE_END_TEST;
- return 0;
-}
-#endif /* ACE_HAS_THREADS && (WIN32 || AIO) */
diff --git a/ACE/tests/SSL/Thread_Pool_Reactor_SSL_Test.cpp b/ACE/tests/SSL/Thread_Pool_Reactor_SSL_Test.cpp
deleted file mode 100644
index 7f9bbd6c168..00000000000
--- a/ACE/tests/SSL/Thread_Pool_Reactor_SSL_Test.cpp
+++ /dev/null
@@ -1,354 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// tests/SSL
-//
-// = FILENAME
-// Thread_Pool_Reactor_Test.cpp
-//
-// = DESCRIPTION
-// This program is a torture test of threaded SSL usage. It
-// is based on the tests/Thread_Pool_Reactor_Test and adds
-// SSL stuff submitted by Robert Handl <robert.handl@ehpt.com>.
-// It starts by spawning several server threads waiting to handle
-// events. Several other client threads are spawned right after
-// to initiate connections to server threads. Each connection
-// adds a new Svc_Handler into the TP_Reactor and sends out
-// several "requests" to the server thread. After the connection
-// is closed, the Svc_Handler is removed from the TP_Reactor.
-// Each message is treated as a separate request by the server so
-// two consecutive requests might be serviced by two different
-// threads.
-//
-// Usage: Thread_Pool_Reactor_Test_SSL [-r <hostname:port#>]
-// [-s <server thr#>] [-c <client thr#>] [-d <delay>]
-// [-i <client conn attempt#>] [-n <client request# per conn>]
-//
-// Default value:
-// <hostname:port#>: ACE_DEFAULT_RENDEZVOUS
-// <server thr#>: ACE_MAX_THREADS
-// <client thr#>: ACE_MAX_ITERATIONS
-// <client conn attempt#>: ACE_MAX_ITERATIONS
-// <client req# per conn>: ACE_MAX_THREADS
-// <delay>: 50 usec
-//
-// = AUTHOR
-// Irfan Pyarali <irfan@cs.wustl.edu> and
-// Nanbor Wang <nanbor@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "tests/test_config.h"
-#include "ace/OS_NS_string.h"
-#include "ace/OS_NS_unistd.h"
-#include "ace/Get_Opt.h"
-#include "ace/Acceptor.h"
-#include "ace/Thread_Manager.h"
-#include "ace/TP_Reactor.h"
-#include "ace/SSL/SSL_SOCK_Connector.h"
-#include "ace/SSL/SSL_SOCK_Acceptor.h"
-
-ACE_RCSID(tests, Atomic_Op_Test, "$Id$")
-
-#if defined (ACE_HAS_THREADS)
-
-#include "Thread_Pool_Reactor_SSL_Test.h"
-typedef ACE_Strategy_Acceptor <Request_Handler, ACE_SSL_SOCK_ACCEPTOR>
- ACCEPTOR;
-
-// Accepting end point. This is actually "localhost:10010", but some
-// platform couldn't resolve the name so we use the IP address
-// directly here.
-static const ACE_TCHAR *rendezvous = ACE_TEXT ("127.0.0.1:10010");
-
-// Total number of server threads.
-static size_t svr_thrno = ACE_MAX_THREADS;
-
-#if defined (CHORUS) // Add platforms that can't handle too many
- // connection simultaneously here.
-#define ACE_LOAD_FACTOR /2
-#else
-#define ACE_LOAD_FACTOR
-#endif
-
-// Total number of client threads.
-static size_t cli_thrno = ACE_MAX_THREADS ACE_LOAD_FACTOR;
-
-// Total connection attemps of a client thread.
-static size_t cli_conn_no = ACE_MAX_ITERATIONS ACE_LOAD_FACTOR;
-
-// Total requests a client thread sends.
-static size_t cli_req_no = ACE_MAX_THREADS ACE_LOAD_FACTOR;
-
-// Delay before a thread sending the next request (in msec.)
-static int req_delay = 50;
-
-static void
-parse_arg (int argc, ACE_TCHAR *argv[])
-{
- //FUZZ: disable check_for_lack_ACE_OS
- ACE_Get_Opt getopt (argc, argv, ACE_TEXT ("r:s:c:d:i:n:"));
-
- int c;
-
- while ((c = getopt ()) != -1)
- {
- //FUZZ: enable check_for_lack_ACE_OS
- switch (c)
- {
- case 'r': // hostname:port
- rendezvous = getopt.opt_arg ();
- break;
- case 's':
- svr_thrno = ACE_OS::atoi (getopt.opt_arg ());
- break;
- case 'c':
- cli_thrno = ACE_OS::atoi (getopt.opt_arg ());
- break;
- case 'd':
- req_delay = ACE_OS::atoi (getopt.opt_arg ());
- break;
- case 'i':
- cli_conn_no = ACE_OS::atoi (getopt.opt_arg ());
- break;
- case 'n':
- cli_req_no = ACE_OS::atoi (getopt.opt_arg ());
- break;
- default:
- ACE_ERROR ((LM_ERROR,
- "Usage: Thread_Pool_Reactor_Test [-r <hostname:port#>]"
- "\t[-s <server thr#>] [-c <client thr#>] [-d <delay>]"
- "\t[-i <client conn attempt#>]"
- "[-n <client request# per conn>]\n"));
- break;
- }
- }
-}
-
-Request_Handler::Request_Handler (ACE_Thread_Manager *thr_mgr)
- : ACE_Svc_Handler<ACE_SSL_SOCK_STREAM, ACE_MT_SYNCH> (thr_mgr),
- nr_msgs_rcvd_(0)
-{
- // Make sure we use TP_Reactor with this class (that's the whole
- // point, right?)
- this->reactor (ACE_Reactor::instance ());
-}
-
-int
-Request_Handler::handle_input (ACE_HANDLE fd)
-{
- ACE_TCHAR buffer[BUFSIZ];
- ACE_TCHAR len = 0;
- ssize_t result = this->peer ().recv (&len, sizeof (ACE_TCHAR));
-
- if (result > 0
- && this->peer ().recv_n (buffer, len * sizeof (ACE_TCHAR))
- == static_cast<ssize_t> (len * sizeof (ACE_TCHAR)))
- {
- ++this->nr_msgs_rcvd_;
-
- ACE_DEBUG ((LM_DEBUG,
- "(%t) svr input; fd: 0x%x; input: %s\n",
- fd,
- buffer));
- if (ACE_OS::strcmp (buffer, ACE_TEXT ("shutdown")) == 0)
- ACE_Reactor::end_event_loop ();
- return 0;
- }
- else
- ACE_DEBUG ((LM_DEBUG,
- "(%t) Request_Handler: 0x%x peer closed (0x%x)\n",
- this, fd));
- return -1;
-}
-
-int
-Request_Handler::handle_close (ACE_HANDLE fd, ACE_Reactor_Mask)
-{
- ACE_DEBUG ((LM_DEBUG,
- "(%t) svr close; fd: 0x%x, rcvd %d msgs\n",
- fd,
- this->nr_msgs_rcvd_));
- if (this->nr_msgs_rcvd_ != cli_req_no)
- ACE_ERROR((LM_ERROR,
- "(%t) Handler 0x%x: Expected %d messages; got %d\n",
- this,
- cli_req_no,
- this->nr_msgs_rcvd_));
- this->destroy ();
- return 0;
-}
-
-static int
-reactor_event_hook (ACE_Reactor *)
-{
- ACE_DEBUG ((LM_DEBUG,
- "(%t) handling events ....\n"));
-
- return 0;
-}
-
-static ACE_THR_FUNC_RETURN
-svr_worker (void *)
-{
- // Server thread function.
- int result =
- ACE_Reactor::instance ()->run_reactor_event_loop (&reactor_event_hook);
-
- if (result == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%t) %p\n",
- "Error handling events"),
- 0);
-
- ACE_DEBUG ((LM_DEBUG,
- "(%t) I am done handling events. Bye, bye\n"));
-
- return 0;
-}
-
-static ACE_THR_FUNC_RETURN
-cli_worker (void *arg)
-{
- // Client thread function.
- ACE_INET_Addr addr (rendezvous);
- ACE_SSL_SOCK_Stream stream;
- ACE_SSL_SOCK_Connector connect;
- ACE_Time_Value delay (0, req_delay);
- size_t len = * reinterpret_cast<ACE_TCHAR *> (arg);
-
- for (size_t i = 0 ; i < cli_conn_no; i++)
- {
- if (connect.connect (stream, addr) < 0)
- {
- ACE_ERROR ((LM_ERROR,
- "(%t) %p\n",
- "connect"));
- continue;
- }
-
- for (size_t j = 0; j < cli_req_no; j++)
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%t) conn_worker handle 0x%x, req %d\n",
- stream.get_handle (),
- j+1));
- if (stream.send_n (arg,
- (len + 1) * sizeof (ACE_TCHAR)) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%t) %p\n",
- "send_n"));
- continue;
- }
- ACE_OS::sleep (delay);
- }
-
- stream.close ();
- }
-
- return 0;
-}
-
-static ACE_THR_FUNC_RETURN
-worker (void *)
-{
- ACE_OS::sleep (3);
- const ACE_TCHAR *msg = ACE_TEXT ("Message from Connection worker");
- ACE_TCHAR buf [BUFSIZ];
- buf[0] = ACE_OS::strlen (msg) + 1;
- ACE_OS::strcpy (&buf[1], msg);
-
- ACE_INET_Addr addr (rendezvous);
-
- ACE_DEBUG((LM_DEBUG,
- "(%t) Spawning %d client threads...\n",
- cli_thrno));
- int grp = ACE_Thread_Manager::instance ()->spawn_n (cli_thrno,
- &cli_worker,
- buf);
- ACE_ASSERT (grp != -1);
-
- ACE_Thread_Manager::instance ()->wait_grp (grp);
-
- ACE_DEBUG ((LM_DEBUG,
- "(%t) Client threads done; shutting down...\n"));
- ACE_SSL_SOCK_Stream stream;
- ACE_SSL_SOCK_Connector connect;
-
- if (connect.connect (stream, addr) == -1)
- ACE_ERROR ((LM_ERROR,
- "(%t) %p Error while connecting\n",
- "connect"));
-
- const ACE_TCHAR *sbuf = ACE_TEXT ("\011shutdown");
-
- ACE_DEBUG ((LM_DEBUG,
- "shutdown stream handle = %x\n",
- stream.get_handle ()));
-
- if (stream.send_n (sbuf, (ACE_OS::strlen (sbuf) + 1) * sizeof (ACE_TCHAR)) == -1)
- ACE_ERROR ((LM_ERROR,
- "(%t) %p\n",
- "send_n"));
-
- stream.close ();
-
- return 0;
-}
-
-int
-run_main (int argc, ACE_TCHAR *argv[])
-{
- ACE_START_TEST (ACE_TEXT ("Thread_Pool_Reactor_SSL_Test"));
-
- ACE_SSL_Context *context = ACE_SSL_Context::instance ();
- // Note - the next two strings are naked on purpose... the arguments to
- // the ACE_SSL_Context methods are const char *, not ACE_TCHAR *.
- context->certificate ("dummy.pem", SSL_FILETYPE_PEM);
- context->private_key ("key.pem", SSL_FILETYPE_PEM);
-
- parse_arg (argc, argv);
-
- // Changed the default
- ACE_TP_Reactor sr;
- ACE_Reactor new_reactor (&sr);
- ACE_Reactor::instance (&new_reactor);
-
- ACCEPTOR acceptor;
- ACE_INET_Addr accept_addr (rendezvous);
-
- if (acceptor.open (accept_addr) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("%p\n"),
- ACE_TEXT ("open")),
- 1);
-
- ACE_DEBUG((LM_DEBUG,
- ACE_TEXT ("(%t) Spawning %d server threads...\n"),
- svr_thrno));
- ACE_Thread_Manager::instance ()->spawn_n (svr_thrno,
- svr_worker);
- ACE_Thread_Manager::instance ()->spawn (worker);
-
- ACE_Thread_Manager::instance ()->wait ();
-
- ACE_END_TEST;
- return 0;
-}
-
-#else
-int
-ACE_TMAIN (int, ACE_TCHAR *[])
-{
- ACE_START_TEST (ACE_TEXT ("Thread_Pool_Reactor_SSL_Test"));
-
- ACE_ERROR ((LM_INFO,
- "threads not supported on this platform\n"));
-
- ACE_END_TEST;
- return 0;
-}
-#endif /* ACE_HAS_THREADS */
diff --git a/ACE/tests/SSL/Thread_Pool_Reactor_SSL_Test.h b/ACE/tests/SSL/Thread_Pool_Reactor_SSL_Test.h
deleted file mode 100644
index fca5a7f8432..00000000000
--- a/ACE/tests/SSL/Thread_Pool_Reactor_SSL_Test.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// tests/SSL
-//
-// = FILENAME
-// Thread_Pool_Reactor_Test_SSL.h
-//
-// = DESCRIPTION
-// This class gets its own header file to work around AIX C++
-// compiler "features" related to template instantiation... It is
-// only used by Thread_Pool_Reactor_Test_SSL.cpp.
-//
-// = AUTHOR
-// Irfan Pyarali <irfan@cs.wustl.edu>
-// Nanbor Wang <nanbor@cs.wustl.edu>
-//
-// ============================================================================
-
-#ifndef ACE_TESTS_THREAD_POOL_REACTOR_TEST_SSL_H
-#define ACE_TESTS_THREAD_POOL_REACTOR_TEST_SSL_H
-
-#include "ace/SSL/SSL_SOCK_Stream.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "ace/Svc_Handler.h"
-
-class Request_Handler : public ACE_Svc_Handler<ACE_SSL_SOCK_STREAM,
- ACE_MT_SYNCH>
-{
- // = TITLE
- // This class is the Svc_Handler used by <Acceptor>.
-public:
- Request_Handler (ACE_Thread_Manager *tm = 0);
- // The default constructor makes sure the right reactor is used.
-
-protected:
- virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE);
- virtual int handle_close (ACE_HANDLE fd, ACE_Reactor_Mask = 0);
-
-private:
- size_t nr_msgs_rcvd_;
-};
-
-#endif /* ACE_TESTS_THREAD_POOL_REACTOR_TEST_SSL_H */
diff --git a/ACE/tests/SSL/acetest.mpb b/ACE/tests/SSL/acetest.mpb
deleted file mode 100644
index d7ef35a7061..00000000000
--- a/ACE/tests/SSL/acetest.mpb
+++ /dev/null
@@ -1,21 +0,0 @@
-// -*- MPC -*-
-// $Id$
-
-project : aceexe {
-
- after += Test_Output
- libs += Test_Output
- libpaths += ..
-
- Source_Files {
- ../Main.cpp
- }
- Header_Files {
- }
- Resource_Files {
- }
- Documentation_Files {
- }
- Inline_Files {
- }
-}
diff --git a/ACE/tests/SSL/dummy.pem b/ACE/tests/SSL/dummy.pem
deleted file mode 100644
index d631a33b956..00000000000
--- a/ACE/tests/SSL/dummy.pem
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICaTCCAdICAQAwDQYJKoZIhvcNAQEEBQAwcjELMAkGA1UEBhMCVVMxCzAJBgNV
-BAgTAkNBMQ8wDQYDVQQHEwZJcnZpbmUxDDAKBgNVBAoTA09DSTEMMAoGA1UECxMD
-VEFPMREwDwYDVQQDEwhwcml5YW5rYTEWMBQGCSqGSIb3DQEJARYHcGdvbnRsYTAe
-Fw0wMTAzMjkwNDM4NDZaFw0wMTA0MjgwNDM4NDZaMIGHMQswCQYDVQQGEwJVUzEL
-MAkGA1UECBMCQ0ExDzANBgNVBAcTBklydmluZTEdMBsGA1UEChMUT2JqZWN0IENv
-bXB1dGluZyBJbmMxEDAOBgNVBAsTB09DSStUQU8xETAPBgNVBAMTCHByaXlhbmth
-MRYwFAYJKoZIhvcNAQkBFgdwZ29udGxhMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
-iQKBgQClC6z/bX1JHF1Hg06NCnBmsikEjViEdJFuqLOH3rXSGbm+2Eo+IO4dHlFS
-u6+Ntk4olBZTuf0DqzyEgrOiN7cnKXpxJzb1cwCmVkvDQISMygf4o66+CHtF8o8Z
-Sbi9F5u9W+MILaoCexEIVZqfHffcGxvm5O2MorBSQNka3NcC3wIDAQABMA0GCSqG
-SIb3DQEBBAUAA4GBADuKX6kllE2sNdQYMbSzt5C/lcpgcsK0BR6L01cQA95b5TvL
-HsKMeeeRj2npR4EPXY2gqgWTrKHZvf01aoKE5LuyzSQ+qfFMuEfo7+p9SYIuIrLD
-5+J0wOwN0R0YZAEY5gCAqRGw26dwWDai+PASPsx0YXV1y9jBB1FFtUFgrpR8
------END CERTIFICATE-----
diff --git a/ACE/tests/SSL/key.pem b/ACE/tests/SSL/key.pem
deleted file mode 100644
index 54ff8f0f488..00000000000
--- a/ACE/tests/SSL/key.pem
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQClC6z/bX1JHF1Hg06NCnBmsikEjViEdJFuqLOH3rXSGbm+2Eo+
-IO4dHlFSu6+Ntk4olBZTuf0DqzyEgrOiN7cnKXpxJzb1cwCmVkvDQISMygf4o66+
-CHtF8o8ZSbi9F5u9W+MILaoCexEIVZqfHffcGxvm5O2MorBSQNka3NcC3wIDAQAB
-AoGALYq/PexUeewdwTH2ZuzOf0gCEYN/PW19A/ABOii2OzdmDcdZFTO5AMfw4Mdx
-dcUsY/4Y+xmDO5Pwqw/1yXleTDqvEKCgIEHN4NWnYYSiZOy3LBzQ8XaMZ7/2PCqc
-s4EtesuRB2kZ7PH2R1vJfyGIxZPaO5MOFbs3QFnpBUjqOmECQQDQCYgnBcshCEro
-gsrTjxtZiVHjmXEo0Uo2m4CBQW1PLJmmUXBzivGkVFfhjKULjwvso3BePfmzy9wP
-7YFjVXN9AkEAyxjBXi2kYCcXfGQiNuIrLkyVXeGR2YWnhzS2nL1TjNngmCBbnj48
-qvoqOUQgFK0AeTe/x7lb4Cf24ejWF5vmiwJALensorAkpKWv4qD7IrXy00/7QsAa
-uWd3eZXYRq6p8U9mmc5fgyCnNB1pR95CjsqDVza7FhGXipbzepBwffveAQJBAMKc
-mxYyqDMW4nNoxDxRJs17xxkpwAdvAiQWB/JTnQ737DX5s7EDtECl7PXo6NDHIhAF
-srigToCR6wl4gkYnNpcCQHmlfa9Duf3VJI/XeHE9ZU8vS4qgx0Ikfh01xCqWlsaq
-nPRmtfktt4P8gxlryZCEPpRs9l/XwQY6tnpHr5EmV2Y=
------END RSA PRIVATE KEY-----
diff --git a/ACE/tests/SSL/tests.mpc b/ACE/tests/SSL/tests.mpc
deleted file mode 100644
index 5b881ce28b7..00000000000
--- a/ACE/tests/SSL/tests.mpc
+++ /dev/null
@@ -1,26 +0,0 @@
-// -*- MPC -*-
-// $Id$
-
-project(Bug_2912_Regression_Test) : acetest, ssl {
- avoids += ace_for_tao
- exename = Bug_2912_Regression_Test
- Source_Files {
- Bug_2912_Regression_Test.cpp
- }
-}
-
-project(SSL Asynch_Stream Test) : acetest, ssl {
- avoids += ace_for_tao
- exename = SSL_Asynch_Stream_Test
- Source_Files {
- SSL_Asynch_Stream_Test.cpp
- }
-}
-
-project(Thread Pool Reactor SSL Test) : acetest, ssl {
- exename = Thread_Pool_Reactor_SSL_Test
- Source_Files {
- Thread_Pool_Reactor_SSL_Test.cpp
- }
-}
-