diff --git a/lib/roles/cgi/ops-cgi.c b/lib/roles/cgi/ops-cgi.c index 878580164..2855a3bd2 100644 --- a/lib/roles/cgi/ops-cgi.c +++ b/lib/roles/cgi/ops-cgi.c @@ -114,7 +114,7 @@ rops_pt_init_destroy_cgi(struct lws_context *context, } -struct lws_role_ops role_ops_cgi = { +const struct lws_role_ops role_ops_cgi = { /* role name */ "cgi", /* alpn id */ NULL, /* check_upgrades */ NULL, diff --git a/lib/roles/cgi/private-lib-roles-cgi.h b/lib/roles/cgi/private-lib-roles-cgi.h index bffc706e7..35b71c5d7 100644 --- a/lib/roles/cgi/private-lib-roles-cgi.h +++ b/lib/roles/cgi/private-lib-roles-cgi.h @@ -32,7 +32,7 @@ #endif #endif -extern struct lws_role_ops role_ops_cgi; +extern const struct lws_role_ops role_ops_cgi; #define lwsi_role_cgi(wsi) (wsi->role_ops == &role_ops_cgi) diff --git a/lib/roles/dbus/dbus.c b/lib/roles/dbus/dbus.c index 7721b8088..75b65aa62 100644 --- a/lib/roles/dbus/dbus.c +++ b/lib/roles/dbus/dbus.c @@ -512,7 +512,7 @@ rops_pt_init_destroy_dbus(struct lws_context *context, return 0; } -struct lws_role_ops role_ops_dbus = { +const struct lws_role_ops role_ops_dbus = { /* role name */ "dbus", /* alpn id */ NULL, /* check_upgrades */ NULL, diff --git a/lib/roles/dbus/private-lib-roles-dbus.h b/lib/roles/dbus/private-lib-roles-dbus.h index 8245fbfcc..4606a22d0 100644 --- a/lib/roles/dbus/private-lib-roles-dbus.h +++ b/lib/roles/dbus/private-lib-roles-dbus.h @@ -26,7 +26,7 @@ #include -extern struct lws_role_ops role_ops_dbus; +extern const struct lws_role_ops role_ops_dbus; #define lwsi_role_dbus(wsi) (wsi->role_ops == &role_ops_dbus) diff --git a/lib/roles/h1/ops-h1.c b/lib/roles/h1/ops-h1.c index 0287eed8f..3eac468c9 100644 --- a/lib/roles/h1/ops-h1.c +++ b/lib/roles/h1/ops-h1.c @@ -1131,7 +1131,7 @@ rops_pt_init_destroy_h1(struct lws_context *context, return 0; } -struct lws_role_ops role_ops_h1 = { +const struct lws_role_ops role_ops_h1 = { /* role name */ "h1", /* alpn id */ "http/1.1", /* check_upgrades */ NULL, diff --git a/lib/roles/h1/private-lib-roles-h1.h b/lib/roles/h1/private-lib-roles-h1.h index 7b1ebbffe..f58ce7e8b 100644 --- a/lib/roles/h1/private-lib-roles-h1.h +++ b/lib/roles/h1/private-lib-roles-h1.h @@ -26,5 +26,5 @@ * Most of the h1 business is defined in the h1 / h2 common roles/http dir */ -extern struct lws_role_ops role_ops_h1; +extern const struct lws_role_ops role_ops_h1; #define lwsi_role_h1(wsi) (wsi->role_ops == &role_ops_h1) diff --git a/lib/roles/h2/ops-h2.c b/lib/roles/h2/ops-h2.c index f9ca9dbae..56e8e981e 100644 --- a/lib/roles/h2/ops-h2.c +++ b/lib/roles/h2/ops-h2.c @@ -1221,7 +1221,7 @@ rops_issue_keepalive_h2(struct lws *wsi, int isvalid) return 0; } -struct lws_role_ops role_ops_h2 = { +const struct lws_role_ops role_ops_h2 = { /* role name */ "h2", /* alpn id */ "h2", /* check_upgrades */ rops_check_upgrades_h2, diff --git a/lib/roles/h2/private-lib-roles-h2.h b/lib/roles/h2/private-lib-roles-h2.h index f308678a8..454fe1b9e 100644 --- a/lib/roles/h2/private-lib-roles-h2.h +++ b/lib/roles/h2/private-lib-roles-h2.h @@ -22,7 +22,7 @@ * IN THE SOFTWARE. */ -extern struct lws_role_ops role_ops_h2; +extern const struct lws_role_ops role_ops_h2; #define lwsi_role_h2(wsi) (wsi->role_ops == &role_ops_h2) struct http2_settings { diff --git a/lib/roles/listen/ops-listen.c b/lib/roles/listen/ops-listen.c index 2c18cd418..c49159f13 100644 --- a/lib/roles/listen/ops-listen.c +++ b/lib/roles/listen/ops-listen.c @@ -176,7 +176,7 @@ int rops_handle_POLLOUT_listen(struct lws *wsi) return LWS_HP_RET_USER_SERVICE; } -struct lws_role_ops role_ops_listen = { +const struct lws_role_ops role_ops_listen = { /* role name */ "listen", /* alpn id */ NULL, /* check_upgrades */ NULL, diff --git a/lib/roles/pipe/ops-pipe.c b/lib/roles/pipe/ops-pipe.c index 16a952e9e..225f3e978 100644 --- a/lib/roles/pipe/ops-pipe.c +++ b/lib/roles/pipe/ops-pipe.c @@ -68,7 +68,7 @@ rops_handle_POLLIN_pipe(struct lws_context_per_thread *pt, struct lws *wsi, return LWS_HPI_RET_HANDLED; } -struct lws_role_ops role_ops_pipe = { +const struct lws_role_ops role_ops_pipe = { /* role name */ "pipe", /* alpn id */ NULL, /* check_upgrades */ NULL, diff --git a/lib/roles/private-lib-roles.h b/lib/roles/private-lib-roles.h index 7d75ba6d2..2ff9ba929 100644 --- a/lib/roles/private-lib-roles.h +++ b/lib/roles/private-lib-roles.h @@ -270,8 +270,8 @@ struct lws_role_ops { }; /* core roles */ -extern struct lws_role_ops role_ops_raw_skt, role_ops_raw_file, role_ops_listen, - role_ops_pipe; +extern const struct lws_role_ops role_ops_raw_skt, role_ops_raw_file, + role_ops_listen, role_ops_pipe; /* bring in role private declarations */ diff --git a/lib/roles/raw-file/ops-raw-file.c b/lib/roles/raw-file/ops-raw-file.c index 7bd0e777d..67660e6d6 100644 --- a/lib/roles/raw-file/ops-raw-file.c +++ b/lib/roles/raw-file/ops-raw-file.c @@ -77,7 +77,7 @@ rops_adoption_bind_raw_file(struct lws *wsi, int type, const char *vh_prot_name) return 1; /* bound */ } -struct lws_role_ops role_ops_raw_file = { +const struct lws_role_ops role_ops_raw_file = { /* role name */ "raw-file", /* alpn id */ NULL, /* check_upgrades */ NULL, diff --git a/lib/roles/raw-proxy/ops-raw-proxy.c b/lib/roles/raw-proxy/ops-raw-proxy.c index 9fa3bc381..c9ee397c6 100644 --- a/lib/roles/raw-proxy/ops-raw-proxy.c +++ b/lib/roles/raw-proxy/ops-raw-proxy.c @@ -186,7 +186,7 @@ rops_handle_POLLOUT_raw_proxy(struct lws *wsi) return LWS_HP_RET_BAIL_OK; } -struct lws_role_ops role_ops_raw_proxy = { +const struct lws_role_ops role_ops_raw_proxy = { /* role name */ "raw-proxy", /* alpn id */ NULL, /* check_upgrades */ NULL, diff --git a/lib/roles/raw-proxy/private-lib-roles-raw-proxy.h b/lib/roles/raw-proxy/private-lib-roles-raw-proxy.h index 52fc9cd9e..cae5a3412 100644 --- a/lib/roles/raw-proxy/private-lib-roles-raw-proxy.h +++ b/lib/roles/raw-proxy/private-lib-roles-raw-proxy.h @@ -24,7 +24,7 @@ * This is included from private-lib-core.h if LWS_ROLE_RAW_PROXY */ -extern struct lws_role_ops role_ops_raw_proxy; +extern const struct lws_role_ops role_ops_raw_proxy; #define lwsi_role_raw_proxy(wsi) (wsi->role_ops == &role_ops_raw_proxy) diff --git a/lib/roles/raw-skt/ops-raw-skt.c b/lib/roles/raw-skt/ops-raw-skt.c index b2a571825..39f907e6e 100644 --- a/lib/roles/raw-skt/ops-raw-skt.c +++ b/lib/roles/raw-skt/ops-raw-skt.c @@ -240,7 +240,7 @@ rops_client_bind_raw_skt(struct lws *wsi, } #endif -struct lws_role_ops role_ops_raw_skt = { +const struct lws_role_ops role_ops_raw_skt = { /* role name */ "raw-skt", /* alpn id */ NULL, /* check_upgrades */ NULL, diff --git a/lib/roles/ws/ops-ws.c b/lib/roles/ws/ops-ws.c index a256cff11..89597f29b 100644 --- a/lib/roles/ws/ops-ws.c +++ b/lib/roles/ws/ops-ws.c @@ -2045,7 +2045,7 @@ rops_issue_keepalive_ws(struct lws *wsi, int isvalid) return 0; } -struct lws_role_ops role_ops_ws = { +const struct lws_role_ops role_ops_ws = { /* role name */ "ws", /* alpn id */ NULL, /* check_upgrades */ NULL, diff --git a/lib/roles/ws/private-lib-roles-ws.h b/lib/roles/ws/private-lib-roles-ws.h index 287b0a9e3..09d5b2128 100644 --- a/lib/roles/ws/private-lib-roles-ws.h +++ b/lib/roles/ws/private-lib-roles-ws.h @@ -24,7 +24,7 @@ * This is included from private-lib-core.h if LWS_ROLE_WS */ -extern struct lws_role_ops role_ops_ws; +extern const struct lws_role_ops role_ops_ws; #define lwsi_role_ws(wsi) (wsi->role_ops == &role_ops_ws)