mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-23 00:00:06 +01:00
![]() HTTP server protocols have had for a while LWS_CALLBACK_HTTP_DROP/BIND_PROTOCOL callbacks that mark when a wsi is attched to a protocol and detached. It turns out this is generally useful for everything to know when a wsi is joining a protocol and definitively completely finished with a protocol. Particularly with client wsi where you provided the userdata externally, this makes a clear point to free() it on the protocol binding being dropped. This patch adds protocol bind / unbind callbacks to the role definition and lets them operate on all roles. For the various roles HTTP server: LWS_CALLBACK_HTTP_BIND/DROP_PROTOCOL as before HTTP client: LWS_CALLBACK_CLIENT_HTTP_BIND/DROP_PROTOCOL ws server: LWS_CALLBACK_WS_SERVER_BIND/DROP_PROTOCOL ws client: LWS_CALLBACK_WS_CLIENT_BIND/DROP_PROTOCOL raw file: LWS_CALLBACK_RAW_FILE_BIND/DROP_PROTOCOL raw skt: LWS_CALLBACK_RAW_SKT_BIND/DROP_PROTOCOL |
||
---|---|---|
.. | ||
core | ||
event-libs | ||
misc | ||
plat | ||
roles | ||
tls | ||
libwebsockets.h | ||
README.md |
Library sources layout
Code that goes in the libwebsockets library itself lives down ./lib
Path | Sources |
---|---|
lib/core | Core lws code related to generic fd and wsi servicing and management |
lib/event-libs | Code containing optional event-lib specific adaptations |
lib/misc | Code for various mostly optional miscellaneous features |
lib/plat | Platform-specific adaptation code |
lib/roles | Code for specific optional wsi roles, eg, http/1, h2, ws, raw, etc |
lib/tls | Code supporting the various TLS libraries |
libwebsockets.h | Public API header for the whole of lws |