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...
>
> Perhaps we have to actually shutdown SSLeay in some way (at the restart)
> before we can re-init it (at the new startup)? Perhaps Tim Hudson has some
> hints for us. Tim?
>
> >From the Apache side it's easy: We can do this inside Apache with a callback
> function configured via ap_register_cleanup(). Or inside the new remove_module
> hook of the Extended API. We just have to know what SSLeay functions we have
> to call on server restart time.
No, it's something else. I've solved it. From src/main/http_main.c
--8<--
5568: do { /* restart-pending */
[cut]
ap_init_modules(pconf, server_conf);
[cut]
++generation;
5693: } while (restart_pending);
--8<--
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.
-trung
P.S. I'm going to print Apache source to have some reading over the
weekend :-(
Here is the diff
*** ssl_engine_init.c~ Wed Nov 04 13:03:10 1998
--- ssl_engine_init.c Fri Nov 06 17:21:53 1998
***************
*** 137,152 ****
* Ok, now try to solve this totally ugly situation...
*/
if (ssl_ModConfig->nInitCount == 1) {
ssl_init_SSLeay(s);
ssl_pphrase_Handle(s, p);
- #ifndef WIN32
return;
- #endif
}
if (ssl_ModConfig->nInitCount == 2) {
ssl_init_SSLeay(s);
}
/*
* Warn the user that he should use the session cache.
--- 137,155 ----
* Ok, now try to solve this totally ugly 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 */
/*
* Warn the user that he should use the session cache.
______________________________________________________________________
Apache Interface to SSLeay (mod_ssl) www.engelschall.com/sw/mod_ssl/
Official Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]