Skip to main content
Sign in
Snippets Groups Projects
Commit 3f62870e authored by Andy Green's avatar Andy Green
Browse files

introduce lws_wsi_user

parent 1a366bf9
Branches
Tags
No related merge requests found
......@@ -4,7 +4,7 @@ Changelog
User api additions
------------------
lws now exposes his internal platform file abstraction in a way that can be
1) lws now exposes his internal platform file abstraction in a way that can be
both used by user code to make it platform-agnostic, and be overridden or
subclassed by user code. This allows things like handling the URI "directory
space" as a virtual filesystem that may or may not be backed by a regular
......@@ -45,6 +45,9 @@ lws_plat_file_write(struct lws_plat_file_ops *fops, lws_filefd_type fd,
The user code can also override or subclass the file operations, to either
wrap or replace them. An example is shown in test server.
2) A new API void * lws_wsi_user(struct lws *wsi) lets you get the pointer to
the user data associated with the wsi, just from the wsi.
User api changes
----------------
......
......
......@@ -941,6 +941,12 @@ lws_get_ctx(const struct lws *wsi)
return wsi->context;
}
LWS_VISIBLE LWS_EXTERN void *
lws_wsi_user(struct lws *wsi)
{
return wsi->user_space;
}
#ifdef LWS_WITH_OLD_API_WRAPPERS
/*
......
......
......@@ -1414,6 +1414,9 @@ lws_service_fd(struct lws_context *context,
LWS_VISIBLE LWS_EXTERN void *
lws_context_user(struct lws_context *context);
LWS_VISIBLE LWS_EXTERN void *
lws_wsi_user(struct lws *wsi);
/*
* NOTE: These public enums are part of the abi. If you want to add one,
* add it at where specified so existing users are unaffected.
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment