diff --git a/include/libwebsockets/lws-misc.h b/include/libwebsockets/lws-misc.h index 2a33eba53..073108ad4 100644 --- a/include/libwebsockets/lws-misc.h +++ b/include/libwebsockets/lws-misc.h @@ -335,6 +335,15 @@ lws_get_library_version(void); LWS_VISIBLE LWS_EXTERN void * lws_wsi_user(struct lws *wsi); +/** + * lws_wsi_tsi() - get the service thread index the wsi is bound to + * \param wsi: lws connection + * + * Only useful is LWS_MAX_SMP > 1 + */ +LWS_VISIBLE LWS_EXTERN int +lws_wsi_tsi(struct lws *wsi); + /** * lws_set_wsi_user() - set the user data associated with the client connection * \param wsi: lws connection diff --git a/lib/core-net/wsi.c b/lib/core-net/wsi.c index 58c8e2bc6..2a8064edf 100644 --- a/lib/core-net/wsi.c +++ b/lib/core-net/wsi.c @@ -640,6 +640,13 @@ lws_wsi_user(struct lws *wsi) return wsi->user_space; } +int +lws_wsi_tsi(struct lws *wsi) +{ + return wsi->tsi; +} + + void lws_set_wsi_user(struct lws *wsi, void *data) {