mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +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 |
||
---|---|---|
.. | ||
adopt.c | ||
alloc.c | ||
connect.c | ||
context.c | ||
libwebsockets.c | ||
output.c | ||
pollfd.c | ||
private.h | ||
service.c |