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

new API function libwebsocket_wsi_user

which returns the optional user allocation that is attached to the wsi
This commit is contained in:
vpeter4 2014-04-27 18:58:55 +02:00
parent 6ea337aa3e
commit d1aa5ed93f
2 changed files with 18 additions and 0 deletions

View file

@ -420,6 +420,21 @@ libwebsocket_context_user(struct libwebsocket_context *context)
return context->user_space;
}
/**
* libwebsocket_wsi_user() - get the user data associated with the wsi
* @wsi: struct libwebsocket
*
* This returns the optional user allocation that is attached to
* the wsi.
*/
LWS_EXTERN void *
libwebsocket_wsi_user(struct libwebsocket *wsi)
{
if (wsi == NULL)
return NULL;
else
return wsi->user_space;
}
/**
* libwebsocket_callback_all_protocol() - Callback all connections using

View file

@ -999,6 +999,9 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
LWS_VISIBLE LWS_EXTERN void *
libwebsocket_context_user(struct libwebsocket_context *context);
LWS_VISIBLE LWS_EXTERN void *
libwebsocket_wsi_user(struct libwebsocket *wsi);
enum pending_timeout {
NO_PENDING_TIMEOUT = 0,
PENDING_TIMEOUT_AWAITING_PROXY_RESPONSE,