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

lws_set_wsi_user: allow setting if protocol pss size zero

This commit is contained in:
Andy Green 2020-02-27 19:10:29 +00:00
parent a9b00f50ee
commit 9adc64114b

View file

@ -635,7 +635,10 @@ lws_wsi_user(struct lws *wsi)
void
lws_set_wsi_user(struct lws *wsi, void *data)
{
if (wsi->user_space_externally_allocated)
/* client and user owns it... */
if (wsi->user_space_externally_allocated ||
/* server, and protocol can never own it, user can control it... */
(wsi->protocol && !wsi->protocol->per_session_data_size))
wsi->user_space = data;
else
lwsl_err("%s: Cannot set internally-allocated user_space\n",