1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

vh protocol destroy: dont miss vhosts

This commit is contained in:
Andy Green 2017-10-11 19:42:45 +08:00
parent f66b84778c
commit 1673554c6b

View file

@ -1173,7 +1173,8 @@ lws_vhost_destroy1(struct lws_vhost *vh)
assert(v->lserv_wsi == NULL);
v->lserv_wsi = vh->lserv_wsi;
vh->lserv_wsi = NULL;
v->lserv_wsi->vhost = v;
if (v->lserv_wsi)
v->lserv_wsi->vhost = v;
lwsl_notice("%s: listen skt from %s to %s\n",
__func__, vh->name, v->name);
@ -1435,8 +1436,9 @@ lws_context_destroy(struct lws_context *context)
if (context->protocol_init_done)
vh = context->vhost_list;
while (vh) {
struct lws_vhost *vhn = vh->vhost_next;
lws_vhost_destroy1(vh);
vh = vh->vhost_next;
vh = vhn;
}
for (n = 0; n < context->count_threads; n++) {