diff --git a/lib/core-net/adopt.c b/lib/core-net/adopt.c index fe305293e..0f9f5cc69 100644 --- a/lib/core-net/adopt.c +++ b/lib/core-net/adopt.c @@ -45,7 +45,8 @@ lws_get_idlest_tsi(struct lws_context *context) } struct lws * -lws_create_new_server_wsi(struct lws_vhost *vhost, int fixed_tsi, const char *desc) +lws_create_new_server_wsi(struct lws_vhost *vhost, int fixed_tsi, int group, + const char *desc) { struct lws *new_wsi; int n = fixed_tsi; @@ -69,11 +70,8 @@ lws_create_new_server_wsi(struct lws_vhost *vhost, int fixed_tsi, const char *de lws_wsi_fault_timedclose(new_wsi); - __lws_lc_tag(vhost->context, &vhost->context->lcg[ -#if defined(LWS_ROLE_H2) || defined(LWS_ROLE_MQTT) - strcmp(desc, "adopted") ? LWSLCG_WSI_MUX : -#endif - LWSLCG_WSI_SERVER], &new_wsi->lc, desc); + __lws_lc_tag(vhost->context, &vhost->context->lcg[group], + &new_wsi->lc, "%s|%s", vhost->name, desc); new_wsi->wsistate |= LWSIFR_SERVER; new_wsi->tsi = (char)n; @@ -138,7 +136,7 @@ __lws_adopt_descriptor_vhost1(struct lws_vhost *vh, lws_adoption_type type, n = -1; if (parent) n = parent->tsi; - new_wsi = lws_create_new_server_wsi(vh, n, "adopted"); + new_wsi = lws_create_new_server_wsi(vh, n, LWSLCG_WSI_SERVER, fi_wsi_name); if (!new_wsi) return NULL; diff --git a/lib/core-net/private-lib-core-net.h b/lib/core-net/private-lib-core-net.h index 42a511b67..6c9276baa 100644 --- a/lib/core-net/private-lib-core-net.h +++ b/lib/core-net/private-lib-core-net.h @@ -1214,7 +1214,8 @@ lws_client_reset(struct lws **wsi, int ssl, const char *address, int port, const char *path, const char *host, char weak); struct lws * LWS_WARN_UNUSED_RESULT -lws_create_new_server_wsi(struct lws_vhost *vhost, int fixed_tsi, const char *desc); +lws_create_new_server_wsi(struct lws_vhost *vhost, int fixed_tsi, + int group, const char *desc); char * LWS_WARN_UNUSED_RESULT lws_generate_client_handshake(struct lws *wsi, char *pkt); diff --git a/lib/roles/h2/http2.c b/lib/roles/h2/http2.c index a09b97fc0..1e26c147e 100644 --- a/lib/roles/h2/http2.c +++ b/lib/roles/h2/http2.c @@ -260,7 +260,7 @@ __lws_wsi_server_new(struct lws_vhost *vh, struct lws *parent_wsi, } while (b < 3 && n < sizeof(tmp1) - 2); tmp1[n] = '\0'; lws_snprintf(tmp, sizeof(tmp), "h2_sid%u_(%s)", sid, tmp1); - wsi = lws_create_new_server_wsi(vh, parent_wsi->tsi, tmp); + wsi = lws_create_new_server_wsi(vh, parent_wsi->tsi, LWSLCG_WSI_MUX, tmp); if (!wsi) { lwsl_notice("new server wsi failed (%s)\n", lws_vh_tag(vh)); return NULL; diff --git a/lib/roles/mqtt/mqtt.c b/lib/roles/mqtt/mqtt.c index 7170b2e32..6bb95ec55 100644 --- a/lib/roles/mqtt/mqtt.c +++ b/lib/roles/mqtt/mqtt.c @@ -1241,7 +1241,9 @@ cmd_completion: lws_set_timeout(wsi, 0, 0); w = lws_create_new_server_wsi(wsi->a.vhost, - wsi->tsi, "mqtt_sid1"); + wsi->tsi, + LWSLCG_WSI_MUX, + "mqtt_sid1"); if (!w) { lwsl_notice("%s: sid 1 migrate failed\n", __func__);