mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-17 10:49:47 +00:00
Uninitializing SSL on mg_stop()
This commit is contained in:
1 parent
8942a4cdad
commit
a77519def3
1 file changed
+16
+16
@@ -3647,6 +3647,18 @@ static int set_ssl_option(struct mg_context *ctx) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void uninitialize_ssl(struct mg_context *ctx) {
|
||||
int i;
|
||||
if (ctx->ssl_ctx != NULL) {
|
||||
CRYPTO_set_locking_callback(NULL);
|
||||
for (i = 0; i < CRYPTO_num_locks(); i++) {
|
||||
pthread_mutex_destroy(&ssl_mutexes[i]);
|
||||
}
|
||||
CRYPTO_set_locking_callback(NULL);
|
||||
CRYPTO_set_id_callback(NULL);
|
||||
}
|
||||
}
|
||||
#endif // !NO_SSL
|
||||
|
||||
static int set_gpass_option(struct mg_context *ctx) {
|
||||
@@ -4026,6 +4038,10 @@ static void master_thread(struct mg_context *ctx) {
|
||||
(void) pthread_cond_destroy(&ctx->sq_empty);
|
||||
(void) pthread_cond_destroy(&ctx->sq_full);
|
||||
|
||||
#if !defined(NO_SSL)
|
||||
uninitialize_ssl(ctx);
|
||||
#endif
|
||||
|
||||
// Signal mg_stop() that we're done
|
||||
ctx->stop_flag = 2;
|
||||
|
||||
|
||||
Reference in new issue
Block a user