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

adopt: disable ssl flags if ssl not enabled

https://github.com/warmcat/libwebsockets/issues/2011
This commit is contained in:
Yucong Sun 2020-08-20 06:53:12 +01:00 committed by Andy Green
parent 2330f69082
commit 8584c973fa

View file

@ -163,6 +163,10 @@ lws_adopt_descriptor_vhost1(struct lws_vhost *vh, lws_adoption_type type,
}
}
if (!LWS_SSL_ENABLED(new_wsi->a.vhost) ||
!(type & LWS_ADOPT_SOCKET))
type &= ~LWS_ADOPT_ALLOW_SSL;
if (lws_role_call_adoption_bind(new_wsi, type, vh_prot_name)) {
lwsl_err("%s: no role for desc type 0x%x\n", __func__, type);
goto bail;