mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
ss: add lws_ss_to_user_object
The ss handle is opaque, so if you need to get the user allocation from the handle outside of a callback, a helper is needed. ABI change.
This commit is contained in:
parent
2cd8f599eb
commit
f843668db9
2 changed files with 18 additions and 0 deletions
|
@ -420,6 +420,18 @@ lws_ss_state_name(int state);
|
|||
LWS_VISIBLE LWS_EXTERN struct lws_context *
|
||||
lws_ss_get_context(struct lws_ss_handle *h);
|
||||
|
||||
/**
|
||||
* lws_ss_to_user_object() - convenience helper to get user object from handle
|
||||
*
|
||||
* \param h: secure streams handle
|
||||
*
|
||||
* Returns the user allocation related to the handle. Normally you won't need
|
||||
* this since it's available in the rx, tx and state callbacks as "userdata"
|
||||
* already.
|
||||
*/
|
||||
LWS_VISIBLE LWS_EXTERN void *
|
||||
lws_ss_to_user_object(struct lws_ss_handle *h);
|
||||
|
||||
/**
|
||||
* lws_ss_rideshare() - find the current streamtype when types rideshare
|
||||
*
|
||||
|
|
|
@ -480,6 +480,12 @@ lws_ss_create(struct lws_context *context, int tsi, const lws_ss_info_t *ssi,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void *
|
||||
lws_ss_to_user_object(struct lws_ss_handle *h)
|
||||
{
|
||||
return (void *)&h[1];
|
||||
}
|
||||
|
||||
void
|
||||
lws_ss_destroy(lws_ss_handle_t **ppss)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue