[Libwebsockets] Unable to access context->user data with 1.6

Andy Green andy at warmcat.com
Thu Dec 24 06:04:26 CET 2015



On 12/24/2015 12:24 PM, Andy Green wrote:
>
>
> On 12/24/2015 12:22 PM, Mark Hessling wrote:
>> With the change in the 1.6 API to remove context as a passed parameter,
>> I am unable to access the context->user data field in all my user
>> callbacks. I use context->user for thread-safe data and I need this for
>> every user callback at every stage. As many of the callback reasons pass
>> wsi as null, I can't see a way to access the context->user data. Is
>> there something I'm missing?
>
> Yes: you can ALWAYS get the context from the wsi with
>
> lws_get_context(wsi)
>
> in the user callback.

Welp, that is the theory, it seems GET_THREAD_ID didn't get the memo.

It should be true now.

https://github.com/warmcat/libwebsockets/commit/c35b36b1cf5a00f244f2c176a301c60450230899

-Andy

> -Andy
>
>> Thanks, Mark
>>
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets



More information about the Libwebsockets mailing list