Subject: [PATCH] add user context pointer to the protocol structure

This commit is contained in:
Neal Horman 2014-12-10 18:59:04 -06:00 committed by Andy Green
parent 98e491fdff
commit b399237fe8

View file

@ -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,