On Fri, Nov 06, 1998, Trung Tran-Duc wrote:

> On Fri, 06 Nov 1998 15:59:30 GMT,
>   Ralf S. Engelschall <[EMAIL PROTECTED]> wrote:
> 
> > [...]
> > Also apache crashes on NT
> > > when I try to restart it (apache.exe -k restart). It's inside ssleay.
> > > I'm going to debug it...
>[...]
> It's run in the master process. I don't know how restart is done on
> UNIX, init_module is run in each restart. The master process is the
> same. We must be very careful to init everything, especially we cannot
> rely on global vars are init'ed to zero and such. On Windoze there is
> no fork(), no detach, etc. (We've run into this before, do you
> remember?) ssl_ModConfig->nInitCount can be million. We must init
> ssleay each time.

Correct, because the DDL is _reloaded_. I've now recogmized that
we have exactly the same problem under Unix/DSO situation.

> + #ifndef WIN32
>       if (ssl_ModConfig->nInitCount == 1) {
>           ssl_init_SSLeay(s);
>           ssl_pphrase_Handle(s, p);
>           return;
>       }
>       if (ssl_ModConfig->nInitCount == 2) {
>           ssl_init_SSLeay(s);
>       }
> + #else /* WIN32 */
> +     ssl_init_SSLeay(s);
> +     ssl_pphrase_Handle(s, p);
> + #endif /* !WIN32 */

Ok, but here the Pass Phrase handling is done on every restart on Win32.
That's not intended this way.  Because we have the same problem under Unix/DSO
I've now replaced this piece of code with the following:

| #ifdef SHARED_MODULE
|     ssl_init_SSLeay(s);
| #else
|     if (mc->nInitCount <= 2) {
|         ssl_init_SSLeay(s);
|     }
| #endif
|     if (mc->nInitCount == 1) {
|         ssl_pphrase_Handle(s, p);
| #ifndef WIN32
|         return;
| #endif
|     }

This way we init SSLeay on every init under DSO/DLL situation but not under
Unix/non-DSO. And the pass phrase handling is done only on the first init.

Can you verify that this code variant works under Win32, too?

                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com
______________________________________________________________________
Apache Interface to SSLeay (mod_ssl)   www.engelschall.com/sw/mod_ssl/
Official Support Mailing List               [EMAIL PROTECTED]
Automated List Manager                       [EMAIL PROTECTED]

Reply via email to