This commit is contained in:
Sergey Lyubka committed 2015-03-24 08:04:46 +00:00
1 parent 4cbd113d01
commit 2e63b5a5e5
1 file changed
+6
+6
View File
@@ -5091,6 +5091,12 @@ void mg_copy_listeners(struct mg_server *s, struct mg_server *to) {
if ((c->flags & NSF_LISTENING) &&
(tmp = (struct ns_connection *) NS_MALLOC(sizeof(*tmp))) != NULL) {
memcpy(tmp, c, sizeof(*tmp));
#ifdef NS_ENABLE_SSL
/* See https://github.com/cesanta/mongoose/issues/441 */
if (tmp->ssl_ctx != NULL) (SSL_CTX *) tmp->ssl_ctx->references++;
#endif
tmp->mgr = &to->ns_mgr;
ns_add_conn(tmp->mgr, tmp);
}