I am having a very strange problem which I do not understand at all.

I am writing a forking server using OpenSSL.  If I set up an SSL_CTX in
the parent process and then allow the fork to copy the context into the
process space of the children which it spawns, the size of the children
will grow as they service more requests.

Here's the basic structure:

SSL_CTX* sslContext;
...
...
main()
{
...
...
   sslContext = SSL_CTX_new(SSLv23_server_method());
...
...
   while(number of pre-forks < number of pre-forks to create)
   {
      ...
   }
}


However, if I copy the contents of the SSL_CTX created by the parent
into an SSL_CTX created by the child, the children remain constant size.

Here's the basic structure of version 2:

SSL_CTX* sslContext;
...
...
main()
{
   SSL_CTX* holdContext;
...
...
   holdContext = SSL_CTX_new(SSLv23_server_method());
...
...
   while(number of pre-forks)
   {
      sslContext = new SSL_CTX;
      memcpy(sslContext, holdContext, sizeof(SSL_CTX));
      ...
   }
}

I cannot begin to understand why this happens.  Does anyone have any
ideas?

Thanks,
Brett Polivka

---------------------                                                       
 ______       ______  B R E T T   P O L I V K A              
|____  |     |  _|__| Virtual Media, Inc., 18-3 Dundee Rd. Suite 300
  | |\ \    / / | |   Barrington, IL 60010-5278
  | | \ \  / /  | |   Phone: (847) 842-9008, Fax: (847) 842-1731
 _| |_ \ \/ /  _| |_  http://www.virtual-media.com
|_____| \__/  |_____| [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to