mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
Subject: [PATCH] add user context pointer to the protocol structure
This commit is contained in:
parent
98e491fdff
commit
b399237fe8
1 changed files with 5 additions and 0 deletions
|
@ -923,6 +923,10 @@ typedef int (extension_callback_function)(struct libwebsocket_context *context,
|
|||
* code that acts differently according to the version can do so by
|
||||
* switch (wsi->protocol->id), user code might use some bits as
|
||||
* capability flags based on selected protocol version, etc.
|
||||
* @user: User provided context data at the protocol level.
|
||||
* Accessible via libwebsockets_get_protocol(wsi)->user
|
||||
* This should not be confused with wsi->user, it is not the same.
|
||||
* The library completely ignores any value in here.
|
||||
* @owning_server: the server init call fills in this opaque pointer when
|
||||
* registering this protocol with the server.
|
||||
* @protocol_index: which protocol we are starting from zero
|
||||
|
@ -942,6 +946,7 @@ struct libwebsocket_protocols {
|
|||
size_t per_session_data_size;
|
||||
size_t rx_buffer_size;
|
||||
unsigned int id;
|
||||
void *user;
|
||||
|
||||
/*
|
||||
* below are filled in on server init and can be left uninitialized,
|
||||
|
|
Loading…
Add table
Reference in a new issue