mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
![]() The user protocols struct has not been const until now. This has been painful for a while because the semantics of the protocols struct look like it's going to be treated as const. At context creation, the protocols struct has been getting marked with the context, and three apis exploited that to only need to be passed a pointer to a protocol to get access to the context. This patch removes the two writeable members in the context (these were never directly used by user code), changes all pointers to protocols to be const, and adds an explicit first argument to the three affected apis so they can have access to context. The three affected apis are these LWS_VISIBLE LWS_EXTERN int -lws_callback_on_writable_all_protocol(const struct lws_protocols *protocol); +lws_callback_on_writable_all_protocol(const struct lws_context *context, + const struct lws_protocols *protocol); LWS_VISIBLE LWS_EXTERN int -lws_callback_all_protocol(const struct lws_protocols *protocol, int reason); +lws_callback_all_protocol(struct lws_context *context, + const struct lws_protocols *protocol, int reason); LWS_VISIBLE LWS_EXTERN void -lws_rx_flow_allow_all_protocol(const struct lws_protocols *protocol); +lws_rx_flow_allow_all_protocol(const struct lws_context *context, + const struct lws_protocols *protocol); unfortunately the original apis can no longer be emulated and users of them must update. Signed-off-by: Andy Green <andy.green@linaro.org> |
||
---|---|---|
.. | ||
.gitignore | ||
attack.sh | ||
favicon.ico | ||
leaf.jpg | ||
libwebsockets.org-logo.png | ||
test-client.c | ||
test-echo.c | ||
test-fraggle.c | ||
test-ping.c | ||
test-server-dumb-increment.c | ||
test-server-http.c | ||
test-server-mirror.c | ||
test-server-pthreads.c | ||
test-server.c | ||
test-server.h | ||
test.html |