summaryrefslogtreecommitdiff
path: root/lib/server.c
diff options
context:
space:
mode:
authorAndy Green <andy.green@linaro.org>2015-12-11 10:45:35 +0800
committerAndy Green <andy.green@linaro.org>2015-12-14 06:43:26 +0800
commitd2ac22c27abf34d3cccb3a6fe1e2c6d92123f436 (patch)
treea6001d3a781da31eed96cec2000f0fcbf824a6cb /lib/server.c
parent8203be6742d8187cd3d3c0f9007c64f4f5f67c08 (diff)
downloadlibwebsockets-d2ac22c27abf34d3cccb3a6fe1e2c6d92123f436.tar.gz
libwebsockets-d2ac22c27abf34d3cccb3a6fe1e2c6d92123f436.tar.bz2
libwebsockets-d2ac22c27abf34d3cccb3a6fe1e2c6d92123f436.zip
make protocols const require explicit context API BREAK
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>
Diffstat (limited to 'lib/server.c')
0 files changed, 0 insertions, 0 deletions