Subject: [BugDB] Resource on win2000 (PR#657)

From: [email-masked]
Date: Wed, 9 Jan 2002 13:00:10 +0100 (MET)

Full_Name: Zheng XiangYang
Version: 2.8.5
OS: win2000
Submission from: (NULL) (211.155.22.200)

the mutex  handles "lock_cs[i]" "in ssl_util_thread_setup" are not closed when
the module is unloaded. Each time the child dies, more handles are opened (can
see from task manager)
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]

---

From: [email-masked]
Date: Fri, 1 Feb 2002 15:43:09 +0100 (MET)

Hi Ralf,
the call is CloseHandle(HANDLE toBeClosed);
Regards,
Patrick

[email-masked] wrote:

> On Wed, Jan 09, 2002, [email-masked] wrote:
>
> Ok, but can anybody of the Win32 folks give me the prototype of the
> DestroyMutex (or whatever it is called) function we had to call? I've no
> Win32 development environment available to figure this out myself...
>
>                                        Ralf S. Engelschall
>                                        [email-masked]
>                                        www.engelschall.com

---

From: [email-masked]
Date: Fri, 1 Feb 2002 17:14:05 +0100 (MET)

On Fri, Feb 01, 2002, Patrick Mayweg wrote:

> [...]

Ok, then can someone check whether the following patch solves the
problem?

Index: mod_ssl.h
===================================================================
RCS file: /e/modssl/cvs/mod_ssl/pkg.apache/src/modules/ssl/mod_ssl.h,v
retrieving revision 1.139
diff -u -d -r1.139 mod_ssl.h
--- mod_ssl.h	2001/05/20 09:22:49	1.139
+++ mod_ssl.h	2002/02/01 16:06:14
@@ -839,6 +839,7 @@
 char        *ssl_util_algotypestr(ssl_algo_t);
 char        *ssl_util_ptxtsub(pool *, const char *, const char *, char *);
 void         ssl_util_thread_setup(void);
+void         ssl_util_thread_cleanup(void);
 
 /*  Vendor extension support  */
 #if defined(SSL_VENDOR) && defined(SSL_VENDOR_OBJS)
Index: ssl_engine_init.c
===================================================================
RCS file: /e/modssl/cvs/mod_ssl/pkg.apache/src/modules/ssl/ssl_engine_init.c,v
retrieving revision 1.106
diff -u -d -r1.106 ssl_engine_init.c
--- ssl_engine_init.c	2001/10/16 12:03:18	1.106
+++ ssl_engine_init.c	2002/02/01 16:08:26
@@ -1086,6 +1086,8 @@
     EVP_cleanup();
 #endif
 
+    ssl_util_thread_cleanup();
+
     return;
 }
 
Index: ssl_util.c
===================================================================
RCS file: /e/modssl/cvs/mod_ssl/pkg.apache/src/modules/ssl/ssl_util.c,v
retrieving revision 1.28
diff -u -d -r1.28 ssl_util.c
--- ssl_util.c	2001/01/01 10:51:27	1.28
+++ ssl_util.c	2002/02/01 16:06:06
@@ -435,3 +435,15 @@
     return;
 }
 
+void ssl_util_thread_cleanup(void)
+{
+#ifdef WIN32
+    int i;
+
+    CRYPTO_set_locking_callback(NULL);
+    for (i = 0; i < CRYPTO_NUM_LOCKS; i++)
+        CloseHandle(lock_cs[i]);
+#endif /* WIN32 */
+    return;
+}
+
                                       Ralf S. Engelschall
                                       [email-masked]
                                       www.engelschall.com
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]