1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00
libwebsockets/test-server
Andy Green d2ac22c27a 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>
2015-12-14 06:43:26 +08:00
..
.gitignore Ignoring linux build files 2013-01-09 15:46:11 +08:00
attack.sh attack.sh update for test server changes 2015-12-04 12:04:59 +08:00
favicon.ico refactor-into-dirs.patch 2010-11-01 09:12:17 +00:00
leaf.jpg add by hand http send example 2013-02-14 23:24:07 +08:00
libwebsockets.org-logo.png add libwebsockets.org logo to share 2013-01-16 10:00:39 +08:00
test-client.c make protocols const require explicit context API BREAK 2015-12-14 06:43:26 +08:00
test-echo.c make protocols const require explicit context API BREAK 2015-12-14 06:43:26 +08:00
test-fraggle.c api rationalization: eliminate all libwebsocket[s]_ prefixes 2015-12-04 11:08:32 +08:00
test-ping.c api rationalization: eliminate all libwebsocket[s]_ prefixes 2015-12-04 11:08:32 +08:00
test-server-dumb-increment.c api rationalization: eliminate all libwebsocket[s]_ prefixes 2015-12-04 11:08:32 +08:00
test-server-http.c LWS_O_RDONLY to hide perversions 2015-12-10 13:03:10 +08:00
test-server-mirror.c make protocols const require explicit context API BREAK 2015-12-14 06:43:26 +08:00
test-server-pthreads.c make protocols const require explicit context API BREAK 2015-12-14 06:43:26 +08:00
test-server.c make protocols const require explicit context API BREAK 2015-12-14 06:43:26 +08:00
test-server.h lws_plat_fd implement platform default handlers 2015-12-10 11:01:59 +08:00
test.html test html add open close buttons 2015-11-15 09:24:25 +08:00