diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c57395bc..039a6a7e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -769,7 +769,7 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG) # always warn all and generate debug info if (UNIX AND NOT LWS_PLAT_FREERTOS) - set(CMAKE_C_FLAGS "-Wall -Wconversion -Wsign-compare -Wstrict-aliasing ${VISIBILITY_FLAG} -Wundef ${GCOV_FLAGS} ${CMAKE_C_FLAGS} ${ASAN_FLAGS}" ) + set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wconversion -Wsign-compare -Wstrict-aliasing ${VISIBILITY_FLAG} -Wundef ${GCOV_FLAGS} ${CMAKE_C_FLAGS} ${ASAN_FLAGS}" ) else() set(CMAKE_C_FLAGS "-Wall -Wsign-compare ${VISIBILITY_FLAG} ${GCOV_FLAGS} ${CMAKE_C_FLAGS}" ) endif() diff --git a/include/libwebsockets/lws-context-vhost.h b/include/libwebsockets/lws-context-vhost.h index 9fee5e2a1..f1c4afd9a 100644 --- a/include/libwebsockets/lws-context-vhost.h +++ b/include/libwebsockets/lws-context-vhost.h @@ -1308,13 +1308,7 @@ struct lws_http_mount { /* Add new things just above here ---^ * This is part of the ABI, don't needlessly break compatibility - * - * The below is to ensure later library versions with new - * members added above will see 0 (default) even if the app - * was not built against the newer headers. */ - - void *_unused[2]; /**< dummy */ }; ///@} diff --git a/include/libwebsockets/lws-protocols-plugins.h b/include/libwebsockets/lws-protocols-plugins.h index ec9d8d8c8..66240c967 100644 --- a/include/libwebsockets/lws-protocols-plugins.h +++ b/include/libwebsockets/lws-protocols-plugins.h @@ -86,6 +86,8 @@ struct lws_protocols { * This is part of the ABI, don't needlessly break compatibility */ }; +#define LWS_PROTOCOL_LIST_TERM { NULL, NULL, 0, 0, 0, NULL, 0 } + /** * lws_vhost_name_to_protocol() - get vhost's protocol object from its name * diff --git a/lib/core-net/adopt.c b/lib/core-net/adopt.c index dea7f6fbf..e8696c256 100644 --- a/lib/core-net/adopt.c +++ b/lib/core-net/adopt.c @@ -184,8 +184,9 @@ __lws_adopt_descriptor_vhost1(struct lws_vhost *vh, lws_adoption_type type, } #if defined(LWS_WITH_SERVER) - if (new_wsi->role_ops) + if (new_wsi->role_ops) { lws_metrics_tag_wsi_add(new_wsi, "role", new_wsi->role_ops->name); + } #endif lws_pt_unlock(pt); diff --git a/lib/core-net/client/connect3.c b/lib/core-net/client/connect3.c index c9d757175..05e1373f6 100644 --- a/lib/core-net/client/connect3.c +++ b/lib/core-net/client/connect3.c @@ -433,8 +433,9 @@ ads_known: */ #if defined(LWS_WITH_SYS_METRICS) - if (wsi->cal_conn.mt) + if (wsi->cal_conn.mt) { lws_metrics_caliper_report(wsi->cal_conn, METRES_NOGO); + } lws_metrics_caliper_bind(wsi->cal_conn, wsi->a.context->mt_conn_tcp); #endif diff --git a/lib/roles/h2/http2.c b/lib/roles/h2/http2.c index aeb1383c7..8aab20131 100644 --- a/lib/roles/h2/http2.c +++ b/lib/roles/h2/http2.c @@ -267,8 +267,9 @@ __lws_wsi_server_new(struct lws_vhost *vh, struct lws *parent_wsi, } #if defined(LWS_WITH_SERVER) - if (lwsi_role_server(parent_wsi)) + if (lwsi_role_server(parent_wsi)) { lws_metrics_caliper_bind(wsi->cal_conn, wsi->a.context->mth_srv); + } #endif h2n->highest_sid_opened = sid; diff --git a/lib/secure-streams/protocols/ss-h1.c b/lib/secure-streams/protocols/ss-h1.c index a4727635d..3f31b83bf 100644 --- a/lib/secure-streams/protocols/ss-h1.c +++ b/lib/secure-streams/protocols/ss-h1.c @@ -1074,8 +1074,7 @@ malformed: const struct lws_protocols protocol_secstream_h1 = { "lws-secstream-h1", secstream_h1, - 0, - 0, + 0, 0, 0, NULL, 0 }; /* @@ -1140,5 +1139,5 @@ const struct ss_pcols ss_pcol_h1 = { "http/1.1", &protocol_secstream_h1, secstream_connect_munge_h1, - NULL + NULL, NULL }; diff --git a/lib/secure-streams/protocols/ss-h2.c b/lib/secure-streams/protocols/ss-h2.c index 719115de4..96a0fa3c5 100644 --- a/lib/secure-streams/protocols/ss-h2.c +++ b/lib/secure-streams/protocols/ss-h2.c @@ -120,8 +120,7 @@ secstream_h2(struct lws *wsi, enum lws_callback_reasons reason, void *user, const struct lws_protocols protocol_secstream_h2 = { "lws-secstream-h2", secstream_h2, - 0, - 0, + 0, 0, 0, NULL, 0 }; /* diff --git a/lib/secure-streams/protocols/ss-mqtt.c b/lib/secure-streams/protocols/ss-mqtt.c index 9b92a5682..8349d47fd 100644 --- a/lib/secure-streams/protocols/ss-mqtt.c +++ b/lib/secure-streams/protocols/ss-mqtt.c @@ -390,8 +390,7 @@ secstream_mqtt(struct lws *wsi, enum lws_callback_reasons reason, void *user, const struct lws_protocols protocol_secstream_mqtt = { "lws-secstream-mqtt", secstream_mqtt, - 0, - 0, + 0, 0, 0, NULL, 0 }; /* * Munge connect info according to protocol-specific considerations... this @@ -575,5 +574,6 @@ const struct ss_pcols ss_pcol_mqtt = { "MQTT", "x-amzn-mqtt-ca", //"mqtt/3.1.1", &protocol_secstream_mqtt, - secstream_connect_munge_mqtt + secstream_connect_munge_mqtt, + NULL, NULL }; diff --git a/lib/secure-streams/protocols/ss-raw.c b/lib/secure-streams/protocols/ss-raw.c index b11a74bcb..31516ddd9 100644 --- a/lib/secure-streams/protocols/ss-raw.c +++ b/lib/secure-streams/protocols/ss-raw.c @@ -177,6 +177,7 @@ const struct lws_protocols protocol_secstream_raw = { secstream_raw, 0, 0, + 0, NULL, 0 }; const struct ss_pcols ss_pcol_raw = { @@ -184,5 +185,5 @@ const struct ss_pcols ss_pcol_raw = { "", &protocol_secstream_raw, secstream_connect_munge_raw, - NULL + NULL, NULL }; diff --git a/lib/secure-streams/protocols/ss-ws.c b/lib/secure-streams/protocols/ss-ws.c index d7b04c093..e2ffe2c44 100644 --- a/lib/secure-streams/protocols/ss-ws.c +++ b/lib/secure-streams/protocols/ss-ws.c @@ -186,8 +186,7 @@ secstream_ws(struct lws *wsi, enum lws_callback_reasons reason, void *user, const struct lws_protocols protocol_secstream_ws = { "lws-secstream-ws", secstream_ws, - 0, - 0, + 0, 0, 0, NULL, 0 }; /* * Munge connect info according to protocol-specific considerations... this @@ -238,5 +237,5 @@ secstream_connect_munge_ws(lws_ss_handle_t *h, char *buf, size_t len, } const struct ss_pcols ss_pcol_ws = { - "ws", "http/1.1", &protocol_secstream_ws, secstream_connect_munge_ws + "ws", "http/1.1", &protocol_secstream_ws, secstream_connect_munge_ws, 0, 0 }; diff --git a/lib/secure-streams/secure-streams.c b/lib/secure-streams/secure-streams.c index d8b4b161b..f94a27f80 100644 --- a/lib/secure-streams/secure-streams.c +++ b/lib/secure-streams/secure-streams.c @@ -833,8 +833,9 @@ _lws_ss_client_connect(lws_ss_handle_t *h, int is_retry, void *conn_if_sspc_onw) #if defined(LWS_WITH_SYS_METRICS) /* possibly already hanging connect retry... */ - if (!h->cal_txn.mt) + if (!h->cal_txn.mt) { lws_metrics_caliper_bind(h->cal_txn, h->context->mth_ss_conn); + } lws_metrics_tag_add(&h->cal_txn.mtags_owner, "ss", h->policy->streamtype); #endif diff --git a/lib/system/async-dns/async-dns.c b/lib/system/async-dns/async-dns.c index f479480f3..b134d639d 100644 --- a/lib/system/async-dns/async-dns.c +++ b/lib/system/async-dns/async-dns.c @@ -327,7 +327,7 @@ callback_async_dns(struct lws *wsi, enum lws_callback_reasons reason, } struct lws_protocols lws_async_dns_protocol = { - "lws-async-dns", callback_async_dns, 0, 0 + "lws-async-dns", callback_async_dns, 0, 0, 0, NULL, 0 }; int diff --git a/lib/system/dhcpclient/dhcpc4.c b/lib/system/dhcpclient/dhcpc4.c index 33c8494fc..d7f91997d 100644 --- a/lib/system/dhcpclient/dhcpc4.c +++ b/lib/system/dhcpclient/dhcpc4.c @@ -282,7 +282,7 @@ retry_conn: } struct lws_protocols lws_system_protocol_dhcpc4 = - { "lws-dhcp4client", callback_dhcpc4, 0, 128, }; + { "lws-dhcp4client", callback_dhcpc4, 0, 128, 0, NULL, 0 }; void lws_dhcpc4_retry_conn(struct lws_sorted_usec_list *sul) diff --git a/lib/system/ntpclient/ntpclient.c b/lib/system/ntpclient/ntpclient.c index bc5a96158..b7ea660b6 100644 --- a/lib/system/ntpclient/ntpclient.c +++ b/lib/system/ntpclient/ntpclient.c @@ -306,5 +306,5 @@ lws_ntpc_trigger(struct lws_context *ctx) } struct lws_protocols lws_system_protocol_ntpc = - { "lws-ntpclient", callback_ntpc, 0, 128, }; + { "lws-ntpclient", callback_ntpc, 0, 128, 0, NULL, 0 }; diff --git a/lib/tls/lws-gencrypto-common.c b/lib/tls/lws-gencrypto-common.c index 917a5f12b..7b32872d6 100644 --- a/lib/tls/lws-gencrypto-common.c +++ b/lib/tls/lws-gencrypto-common.c @@ -460,7 +460,7 @@ static const struct lws_jose_jwe_alg lws_gencrypto_jwe_alg_map[] = { }, /* list terminator */ - { 0, 0, 0, 0, NULL, NULL } + { 0, 0, 0, 0, NULL, NULL, 0, 0, 0 } }; /* diff --git a/lib/tls/mbedtls/mbedtls-extensions.c b/lib/tls/mbedtls/mbedtls-extensions.c index 4a65af04f..77d4aadb8 100644 --- a/lib/tls/mbedtls/mbedtls-extensions.c +++ b/lib/tls/mbedtls/mbedtls-extensions.c @@ -92,7 +92,7 @@ static const oid_x509_ext_t oid_x509_ext[] = { "Authority Key Identifier" }, LWS_MBEDTLS_OID_X509_EXT_AUTHORITY_KEY_IDENTIFIER, }, - { { NULL, 0 }, 0 }, + { { NULL, 0, NULL, NULL }, 0 }, }; #define FN_OID_TYPED_FROM_ASN1( TYPE_T, NAME, LIST ) \ diff --git a/minimal-examples/api-tests/api-test-lws_smd/main.c b/minimal-examples/api-tests/api-test-lws_smd/main.c index 9e2510fa6..b3f8bd5ee 100644 --- a/minimal-examples/api-tests/api-test-lws_smd/main.c +++ b/minimal-examples/api-tests/api-test-lws_smd/main.c @@ -181,7 +181,8 @@ system_notify_cb(lws_state_manager_t *mgr, lws_state_notify_link_t *link, int main(int argc, const char **argv) { - lws_state_notify_link_t notifier = { {0}, system_notify_cb, "app" }; + lws_state_notify_link_t notifier = { { NULL, NULL, NULL }, + system_notify_cb, "app" }; lws_state_notify_link_t *na[] = { ¬ifier, NULL }; int logs = LLL_USER | LLL_ERR | LLL_WARN | LLL_NOTICE; struct lws_context_creation_info info; diff --git a/minimal-examples/client-server/minimal-ws-proxy/minimal-ws-proxy.c b/minimal-examples/client-server/minimal-ws-proxy/minimal-ws-proxy.c index 4bb5a3e58..e304c6188 100644 --- a/minimal-examples/client-server/minimal-ws-proxy/minimal-ws-proxy.c +++ b/minimal-examples/client-server/minimal-ws-proxy/minimal-ws-proxy.c @@ -24,9 +24,10 @@ #include "protocol_lws_minimal.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0}, LWS_PLUGIN_PROTOCOL_MINIMAL, - { NULL, NULL, 0, 0 } /* terminator */ + + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/dbus-server/minimal-dbus-ws-proxy/main.c b/minimal-examples/dbus-server/minimal-dbus-ws-proxy/main.c index 066a20ace..353b159d3 100644 --- a/minimal-examples/dbus-server/minimal-dbus-ws-proxy/main.c +++ b/minimal-examples/dbus-server/minimal-dbus-ws-proxy/main.c @@ -26,7 +26,7 @@ static int interrupted; static struct lws_protocols protocols[] = { LWS_PLUGIN_PROTOCOL_MINIMAL_DBUS_WSPROXY, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; /* diff --git a/minimal-examples/gtk/minimal-gtk/main.c b/minimal-examples/gtk/minimal-gtk/main.c index fdb193992..56f234cd0 100644 --- a/minimal-examples/gtk/minimal-gtk/main.c +++ b/minimal-examples/gtk/minimal-gtk/main.c @@ -130,7 +130,8 @@ static const struct lws_protocols protocols[] = { static gpointer t1_main (gpointer user_data) { - lws_state_notify_link_t notifier = { {0}, system_notify_cb, "app" }; + lws_state_notify_link_t notifier = { { NULL, NULL, NULL }, + system_notify_cb, "app" }; lws_state_notify_link_t *na[] = { ¬ifier, NULL }; GMainContext *t1_mc = (GMainContext *)user_data; struct lws_context_creation_info info; diff --git a/minimal-examples/http-client/minimal-http-client-attach/minimal-http-client-attach.c b/minimal-examples/http-client/minimal-http-client-attach/minimal-http-client-attach.c index 046a005b9..460f9466a 100644 --- a/minimal-examples/http-client/minimal-http-client-attach/minimal-http-client-attach.c +++ b/minimal-examples/http-client/minimal-http-client-attach/minimal-http-client-attach.c @@ -106,10 +106,9 @@ static const struct lws_protocols protocols[] = { { "http", callback_http, - 0, - 0, + 0, 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; void sigint_handler(int sig) diff --git a/minimal-examples/http-client/minimal-http-client-captive-portal/minimal-http-client-captive-portal.c b/minimal-examples/http-client/minimal-http-client-captive-portal/minimal-http-client-captive-portal.c index ffa1390d0..d9a00bc93 100644 --- a/minimal-examples/http-client/minimal-http-client-captive-portal/minimal-http-client-captive-portal.c +++ b/minimal-examples/http-client/minimal-http-client-captive-portal/minimal-http-client-captive-portal.c @@ -158,13 +158,13 @@ static const struct lws_protocols protocols[] = { { "http", callback_http, - 0, - 0, + 0, 0, 0, NULL, 0 }, { "lws-cpd-http", - callback_cpd_http + callback_cpd_http, + 0, 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; void sigint_handler(int sig) diff --git a/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c b/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c index 4b3e12017..9f3bf04a6 100644 --- a/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c +++ b/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c @@ -154,10 +154,9 @@ static const struct lws_protocols protocols[] = { { "http", callback_http, - 0, - 0, + 0, 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static void diff --git a/minimal-examples/http-client/minimal-http-client-custom-headers/minimal-http-client-custom-headers.c b/minimal-examples/http-client/minimal-http-client-custom-headers/minimal-http-client-custom-headers.c index 92f5326da..686837179 100644 --- a/minimal-examples/http-client/minimal-http-client-custom-headers/minimal-http-client-custom-headers.c +++ b/minimal-examples/http-client/minimal-http-client-custom-headers/minimal-http-client-custom-headers.c @@ -128,10 +128,9 @@ static const struct lws_protocols protocols[] = { { "http", callback_http, - 0, - 0, + 0, 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static void diff --git a/minimal-examples/http-client/minimal-http-client-h2-rxflow/minimal-http-client.c b/minimal-examples/http-client/minimal-http-client-h2-rxflow/minimal-http-client.c index 61baa6012..dbd04b845 100644 --- a/minimal-examples/http-client/minimal-http-client-h2-rxflow/minimal-http-client.c +++ b/minimal-examples/http-client/minimal-http-client-h2-rxflow/minimal-http-client.c @@ -131,9 +131,9 @@ static const struct lws_protocols protocols[] = { "http", callback_http, sizeof(struct pss), - 0, + 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static void @@ -235,7 +235,8 @@ system_notify_cb(lws_state_manager_t *mgr, lws_state_notify_link_t *link, int main(int argc, const char **argv) { - lws_state_notify_link_t notifier = { {0}, system_notify_cb, "app" }; + lws_state_notify_link_t notifier = { { NULL, NULL, NULL }, + system_notify_cb, "app" }; lws_state_notify_link_t *na[] = { ¬ifier, NULL }; struct lws_context_creation_info info; struct lws_context *context; diff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c b/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c index 7b58f3e4c..a3cda5d12 100644 --- a/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c +++ b/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c @@ -132,10 +132,9 @@ static const struct lws_protocols protocols[] = { { "http", callback_http, - 0, - 0, + 0, 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static void diff --git a/minimal-examples/http-client/minimal-http-client-jit-trust/minimal-http-client.c b/minimal-examples/http-client/minimal-http-client-jit-trust/minimal-http-client.c index 879b21c53..55ff73f04 100644 --- a/minimal-examples/http-client/minimal-http-client-jit-trust/minimal-http-client.c +++ b/minimal-examples/http-client/minimal-http-client-jit-trust/minimal-http-client.c @@ -407,7 +407,8 @@ static lws_system_ops_t system_ops = { int main(int argc, const char **argv) { - lws_state_notify_link_t notifier = { {0}, system_notify_cb, "app" }; + lws_state_notify_link_t notifier = { { NULL, NULL, NULL }, + system_notify_cb, "app" }; lws_state_notify_link_t *na[] = { ¬ifier, NULL }; struct lws_context_creation_info info; struct lws_context *context; diff --git a/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c b/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c index 8ea7d29a7..cbbbf9ed9 100644 --- a/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c +++ b/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c @@ -344,8 +344,8 @@ finished: } static const struct lws_protocols protocols[] = { - { "http", callback_http, sizeof(struct pss), 0, }, - { NULL, NULL, 0, 0 } + { "http", callback_http, sizeof(struct pss), 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; #if defined(LWS_WITH_SYS_METRICS) @@ -512,7 +512,8 @@ stagger_cb(lws_sorted_usec_list_t *sul) int main(int argc, const char **argv) { - lws_state_notify_link_t notifier = { {0}, system_notify_cb, "app" }; + lws_state_notify_link_t notifier = { { NULL, NULL, NULL }, + system_notify_cb, "app" }; lws_state_notify_link_t *na[] = { ¬ifier, NULL }; struct lws_context_creation_info info; unsigned long long start; diff --git a/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c b/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c index 2cd5d3d21..3bff115a6 100644 --- a/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c +++ b/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c @@ -173,9 +173,9 @@ static const struct lws_protocols protocols[] = { "http", callback_http, sizeof(struct pss), - 0, + 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static void diff --git a/minimal-examples/http-client/minimal-http-client/minimal-http-client.c b/minimal-examples/http-client/minimal-http-client/minimal-http-client.c index c254b9586..b1fddf050 100644 --- a/minimal-examples/http-client/minimal-http-client/minimal-http-client.c +++ b/minimal-examples/http-client/minimal-http-client/minimal-http-client.c @@ -199,10 +199,9 @@ static const struct lws_protocols protocols[] = { { "http", callback_http, - 0, - 0, + 0, 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static void @@ -335,7 +334,8 @@ system_notify_cb(lws_state_manager_t *mgr, lws_state_notify_link_t *link, int main(int argc, const char **argv) { - lws_state_notify_link_t notifier = { {0}, system_notify_cb, "app" }; + lws_state_notify_link_t notifier = { { NULL, NULL, NULL }, + system_notify_cb, "app" }; lws_state_notify_link_t *na[] = { ¬ifier, NULL }; struct lws_context_creation_info info; struct lws_context *context; diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c b/minimal-examples/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c index 06f500d52..d9a1f31ab 100644 --- a/minimal-examples/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c +++ b/minimal-examples/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c @@ -105,8 +105,8 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, } static struct lws_protocols protocols[] = { - { "http", callback_http, sizeof(struct pss), 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "http", callback_http, sizeof(struct pss), 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; static const struct lws_http_mount mount_dyn = { diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c b/minimal-examples/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c index 3a9db09d9..97902acf0 100644 --- a/minimal-examples/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c +++ b/minimal-examples/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c @@ -23,7 +23,7 @@ static struct lws_protocols protocols[] = { LWS_PLUGIN_PROTOCOL_DEADDROP, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c b/minimal-examples/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c index 7ead9fe89..f919146b3 100644 --- a/minimal-examples/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c +++ b/minimal-examples/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c @@ -216,8 +216,8 @@ callback_dynamic_http(struct lws *wsi, enum lws_callback_reasons reason, } static const struct lws_protocols defprot = - { "defprot", lws_callback_http_dummy, 0, 0 }, protocol = - { "http", callback_dynamic_http, sizeof(struct pss), 0 }; + { "defprot", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, protocol = + { "http", callback_dynamic_http, sizeof(struct pss), 0, 0, NULL, 0 }; static const struct lws_protocols *pprotocols[] = { &defprot, &protocol, NULL }; diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c b/minimal-examples/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c index dd8e637ce..be060da7c 100644 --- a/minimal-examples/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c +++ b/minimal-examples/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c @@ -29,12 +29,12 @@ static struct lws_context *context; static struct lws_protocols protocols[] = { /* first protocol must always be HTTP handler */ - { "http-only", lws_callback_http_dummy, 0, 0, }, + { "http-only", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_DUMB_INCREMENT, LWS_PLUGIN_PROTOCOL_MIRROR, LWS_PLUGIN_PROTOCOL_LWS_STATUS, LWS_PLUGIN_PROTOCOL_POST_DEMO, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; /* @@ -59,8 +59,6 @@ static const struct lws_http_mount mount_ziptest_uncomm = { LWSMPRO_FILE, /* origin points to a callback */ 14, /* strlen("/ziptest"), ie length of the mountpoint */ NULL, - - { NULL, NULL } // sentinel }, mount_ziptest = { (struct lws_http_mount *)&mount_ziptest_uncomm, /* linked-list pointer to next*/ "/ziptest", /* mountpoint in URL namespace on this vhost */ @@ -80,7 +78,6 @@ static const struct lws_http_mount mount_ziptest_uncomm = { 8, /* strlen("/ziptest"), ie length of the mountpoint */ NULL, - { NULL, NULL } // sentinel }, mount_post = { (struct lws_http_mount *)&mount_ziptest, /* linked-list pointer to next*/ "/formtest", /* mountpoint in URL namespace on this vhost */ @@ -100,7 +97,6 @@ static const struct lws_http_mount mount_ziptest_uncomm = { 9, /* strlen("/formtest"), ie length of the mountpoint */ NULL, - { NULL, NULL } // sentinel }, mount = { /* .mount_next */ &mount_post, /* linked-list "next" */ /* .mountpoint */ "/", /* mountpoint URL */ diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c b/minimal-examples/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c index 35aaaab12..a2a695db7 100644 --- a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c +++ b/minimal-examples/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c @@ -126,8 +126,8 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, } static const struct lws_protocols protocols[] = { - { "httptest", callback_http, 0, 0, }, - { NULL, NULL, 0, 0 } + { "httptest", callback_http, 0, 0, 0, NULL, 0}, + LWS_PROTOCOL_LIST_TERM }; static int diff --git a/minimal-examples/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c b/minimal-examples/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c index b0ce321e5..d0ce969e6 100644 --- a/minimal-examples/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c +++ b/minimal-examples/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c @@ -73,8 +73,8 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, } static struct lws_protocols protocols[] = { - { "http", callback_http, 0, 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "http", callback_http, 0, 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; /* default mount serves the URL space from ./mount-origin */ diff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c b/minimal-examples/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c index bdc6056f6..0b41f4048 100644 --- a/minimal-examples/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c +++ b/minimal-examples/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c @@ -188,8 +188,8 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, } static struct lws_protocols protocols[] = { - { "http", callback_http, sizeof(struct pss), 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "http", callback_http, sizeof(struct pss), 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; /* default mount serves the URL space from ./mount-origin */ diff --git a/minimal-examples/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c b/minimal-examples/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c index 59d2bc374..225cdd619 100644 --- a/minimal-examples/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c +++ b/minimal-examples/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c @@ -137,8 +137,8 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, } static struct lws_protocols protocols[] = { - { "http", callback_http, sizeof(struct pss), 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "http", callback_http, sizeof(struct pss), 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; /* default mount serves the URL space from ./mount-origin */ diff --git a/minimal-examples/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c b/minimal-examples/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c index 0f8082ed1..58af16ee4 100644 --- a/minimal-examples/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c +++ b/minimal-examples/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c @@ -134,8 +134,8 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, } static struct lws_protocols protocols[] = { - { "http", callback_http, sizeof(struct pss), 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "http", callback_http, sizeof(struct pss), 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; /* default mount serves the URL space from ./mount-origin */ diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/minimal-http-server.c b/minimal-examples/http-server/minimal-http-server-fulltext-search/minimal-http-server.c index 29b3ec315..010ef7487 100644 --- a/minimal-examples/http-server/minimal-http-server-fulltext-search/minimal-http-server.c +++ b/minimal-examples/http-server/minimal-http-server-fulltext-search/minimal-http-server.c @@ -21,7 +21,7 @@ static int interrupted; static struct lws_protocols protocols[] = { LWS_PLUGIN_PROTOCOL_FULLTEXT_DEMO, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static struct lws_protocol_vhost_options pvo_idx = { diff --git a/minimal-examples/http-server/minimal-http-server-h2-long-poll/minimal-http-server.c b/minimal-examples/http-server/minimal-http-server-h2-long-poll/minimal-http-server.c index 36c8e06c8..c5614e559 100644 --- a/minimal-examples/http-server/minimal-http-server-h2-long-poll/minimal-http-server.c +++ b/minimal-examples/http-server/minimal-http-server-h2-long-poll/minimal-http-server.c @@ -101,8 +101,8 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, } static struct lws_protocols protocols[] = { - { "http", callback_http, sizeof(struct pss), 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "http", callback_http, sizeof(struct pss), 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; diff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c b/minimal-examples/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c index 41d2edd20..faef2f64c 100644 --- a/minimal-examples/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c +++ b/minimal-examples/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c @@ -306,9 +306,9 @@ callback_sse(struct lws *wsi, enum lws_callback_reasons reason, void *user, } static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, - { "sse", callback_sse, sizeof(struct pss), 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, + { "sse", callback_sse, sizeof(struct pss), 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; /* override the default mount for /sse in the URL space */ diff --git a/minimal-examples/http-server/minimal-http-server-sse/minimal-http-server-sse.c b/minimal-examples/http-server/minimal-http-server-sse/minimal-http-server-sse.c index da620dd8e..a87a7c2e7 100644 --- a/minimal-examples/http-server/minimal-http-server-sse/minimal-http-server-sse.c +++ b/minimal-examples/http-server/minimal-http-server-sse/minimal-http-server-sse.c @@ -126,9 +126,9 @@ callback_sse(struct lws *wsi, enum lws_callback_reasons reason, void *user, } static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, - { "sse", callback_sse, sizeof(struct pss), 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, + { "sse", callback_sse, sizeof(struct pss), 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; /* override the default mount for /sse in the URL space */ diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client-multi/minimal-mqtt-client-multi.c b/minimal-examples/mqtt-client/minimal-mqtt-client-multi/minimal-mqtt-client-multi.c index 4a23f832a..31f2aa2b7 100644 --- a/minimal-examples/mqtt-client/minimal-mqtt-client-multi/minimal-mqtt-client-multi.c +++ b/minimal-examples/mqtt-client/minimal-mqtt-client-multi/minimal-mqtt-client-multi.c @@ -374,12 +374,13 @@ static const struct lws_protocols protocols[] = { .callback = callback_mqtt, .per_session_data_size = sizeof(struct pss) }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; int main(int argc, const char **argv) { - lws_state_notify_link_t notifier = { {}, system_notify_cb, "app" }; + lws_state_notify_link_t notifier = { { NULL, NULL, NULL }, + system_notify_cb, "app" }; lws_state_notify_link_t *na[] = { ¬ifier, NULL }; struct lws_context_creation_info info; struct lws_context *context; diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client/minimal-mqtt-client.c b/minimal-examples/mqtt-client/minimal-mqtt-client/minimal-mqtt-client.c index c02ae813f..948cbbda8 100644 --- a/minimal-examples/mqtt-client/minimal-mqtt-client/minimal-mqtt-client.c +++ b/minimal-examples/mqtt-client/minimal-mqtt-client/minimal-mqtt-client.c @@ -296,12 +296,13 @@ static const struct lws_protocols protocols[] = { .callback = callback_mqtt, .per_session_data_size = sizeof(struct pss) }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; int main(int argc, const char **argv) { - lws_state_notify_link_t notifier = { {}, system_notify_cb, "app" }; + lws_state_notify_link_t notifier = { { NULL, NULL, NULL }, + system_notify_cb, "app" }; lws_state_notify_link_t *na[] = { ¬ifier, NULL }; struct lws_context_creation_info info; struct lws_context *context; diff --git a/minimal-examples/raw/minimal-raw-adopt-tcp/minimal-raw-adopt-tcp.c b/minimal-examples/raw/minimal-raw-adopt-tcp/minimal-raw-adopt-tcp.c index 725ff6308..a3ff2be00 100644 --- a/minimal-examples/raw/minimal-raw-adopt-tcp/minimal-raw-adopt-tcp.c +++ b/minimal-examples/raw/minimal-raw-adopt-tcp/minimal-raw-adopt-tcp.c @@ -76,8 +76,8 @@ callback_raw_test(struct lws *wsi, enum lws_callback_reasons reason, } static struct lws_protocols protocols[] = { - { "raw-test", callback_raw_test, 0, 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "raw-test", callback_raw_test, 0, 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/raw/minimal-raw-adopt-udp/minimal-raw-adopt-udp.c b/minimal-examples/raw/minimal-raw-adopt-udp/minimal-raw-adopt-udp.c index e93b54298..a2a74893d 100644 --- a/minimal-examples/raw/minimal-raw-adopt-udp/minimal-raw-adopt-udp.c +++ b/minimal-examples/raw/minimal-raw-adopt-udp/minimal-raw-adopt-udp.c @@ -127,8 +127,8 @@ callback_raw_test(struct lws *wsi, enum lws_callback_reasons reason, } static struct lws_protocols protocols[] = { - { "raw-test", callback_raw_test, 0, 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "raw-test", callback_raw_test, 0, 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/raw/minimal-raw-audio/audio.c b/minimal-examples/raw/minimal-raw-audio/audio.c index 639f34ebb..6b595399d 100644 --- a/minimal-examples/raw/minimal-raw-audio/audio.c +++ b/minimal-examples/raw/minimal-raw-audio/audio.c @@ -171,7 +171,7 @@ callback_raw_test(struct lws *wsi, enum lws_callback_reasons reason, static struct lws_protocols protocols[] = { { "lws-audio-test", callback_raw_test, 0, 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c b/minimal-examples/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c index 5a3e4b749..59f95afcf 100644 --- a/minimal-examples/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c +++ b/minimal-examples/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c @@ -83,8 +83,8 @@ callback_raw_echo(struct lws *wsi, enum lws_callback_reasons reason, void *user, } static const struct lws_protocols protocols[] = { - { "raw-echo", callback_raw_echo, sizeof(struct pss__raw_echo), 2048 }, - { NULL, NULL, 0, 0 } + { "raw-echo", callback_raw_echo, sizeof(struct pss__raw_echo), 2048, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; void sigint_handler(int sig) diff --git a/minimal-examples/raw/minimal-raw-file/minimal-raw-file.c b/minimal-examples/raw/minimal-raw-file/minimal-raw-file.c index f9759e97b..7f1cb050b 100644 --- a/minimal-examples/raw/minimal-raw-file/minimal-raw-file.c +++ b/minimal-examples/raw/minimal-raw-file/minimal-raw-file.c @@ -98,8 +98,8 @@ callback_raw_test(struct lws *wsi, enum lws_callback_reasons reason, } static struct lws_protocols protocols[] = { - { "raw-test", callback_raw_test, 0, 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "raw-test", callback_raw_test, 0, 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/raw/minimal-raw-netcat/minimal-raw-netcat.c b/minimal-examples/raw/minimal-raw-netcat/minimal-raw-netcat.c index 489c030cc..13c1ead69 100644 --- a/minimal-examples/raw/minimal-raw-netcat/minimal-raw-netcat.c +++ b/minimal-examples/raw/minimal-raw-netcat/minimal-raw-netcat.c @@ -128,8 +128,8 @@ callback_raw_test(struct lws *wsi, enum lws_callback_reasons reason, } static struct lws_protocols protocols[] = { - { "raw-test", callback_raw_test, 0, 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "raw-test", callback_raw_test, 0, 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; void sigint_handler(int sig) diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c b/minimal-examples/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c index ef94fad9a..2d290ec4b 100644 --- a/minimal-examples/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c +++ b/minimal-examples/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c @@ -28,7 +28,7 @@ static struct lws_protocols protocols[] = { LWS_PLUGIN_PROTOCOL_RAW_PROXY, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static const struct lws_http_mount mount = { diff --git a/minimal-examples/raw/minimal-raw-proxy/minimal-raw-proxy.c b/minimal-examples/raw/minimal-raw-proxy/minimal-raw-proxy.c index 09997806b..1634a803e 100644 --- a/minimal-examples/raw/minimal-raw-proxy/minimal-raw-proxy.c +++ b/minimal-examples/raw/minimal-raw-proxy/minimal-raw-proxy.c @@ -22,7 +22,7 @@ static struct lws_protocols protocols[] = { LWS_PLUGIN_PROTOCOL_RAW_PROXY, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/raw/minimal-raw-serial/minimal-raw-file.c b/minimal-examples/raw/minimal-raw-serial/minimal-raw-file.c index 4b15320be..45d50af0a 100644 --- a/minimal-examples/raw/minimal-raw-serial/minimal-raw-file.c +++ b/minimal-examples/raw/minimal-raw-serial/minimal-raw-file.c @@ -170,8 +170,8 @@ callback_raw_test(struct lws *wsi, enum lws_callback_reasons reason, } static struct lws_protocols protocols[] = { - { "raw-test", callback_raw_test, 0, 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "raw-test", callback_raw_test, 0, 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/raw/minimal-raw-vhost/minimal-raw-vhost.c b/minimal-examples/raw/minimal-raw-vhost/minimal-raw-vhost.c index d0f9e2750..48267ba32 100644 --- a/minimal-examples/raw/minimal-raw-vhost/minimal-raw-vhost.c +++ b/minimal-examples/raw/minimal-raw-vhost/minimal-raw-vhost.c @@ -100,8 +100,8 @@ callback_raw_test(struct lws *wsi, enum lws_callback_reasons reason, } static struct lws_protocols protocols[] = { - { "raw-test", callback_raw_test, sizeof(struct raw_pss), 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "raw-test", callback_raw_test, sizeof(struct raw_pss), 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/secure-streams/minimal-secure-streams-testsfail/minimal-secure-streams-testsfail.c b/minimal-examples/secure-streams/minimal-secure-streams-testsfail/minimal-secure-streams-testsfail.c index eee55046e..6243df1b7 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-testsfail/minimal-secure-streams-testsfail.c +++ b/minimal-examples/secure-streams/minimal-secure-streams-testsfail/minimal-secure-streams-testsfail.c @@ -433,19 +433,22 @@ struct tests_seq { "h1:80 just get 200", "t_h1", 5 * LWS_US_PER_SEC, LWSSSCS_QOS_ACK_REMOTE, (1 << LWSSSCS_TIMEOUT) | (1 << LWSSSCS_QOS_NACK_REMOTE) | - (1 << LWSSSCS_ALL_RETRIES_FAILED) + (1 << LWSSSCS_ALL_RETRIES_FAILED), + 0 }, { "h1:443 just get 200", "t_h1_tls", 5 * LWS_US_PER_SEC, LWSSSCS_QOS_ACK_REMOTE, (1 << LWSSSCS_TIMEOUT) | (1 << LWSSSCS_QOS_NACK_REMOTE) | - (1 << LWSSSCS_ALL_RETRIES_FAILED) + (1 << LWSSSCS_ALL_RETRIES_FAILED), + 0 }, { "h2:443 just get 200", "t_h2_tls", 5 * LWS_US_PER_SEC, LWSSSCS_QOS_ACK_REMOTE, (1 << LWSSSCS_TIMEOUT) | (1 << LWSSSCS_QOS_NACK_REMOTE) | - (1 << LWSSSCS_ALL_RETRIES_FAILED) + (1 << LWSSSCS_ALL_RETRIES_FAILED), + 0 }, /* @@ -458,19 +461,22 @@ struct tests_seq { "h1:80 timeout after connection", "d_h1", 5 * LWS_US_PER_SEC, LWSSSCS_TIMEOUT, (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE) | - (1 << LWSSSCS_ALL_RETRIES_FAILED) + (1 << LWSSSCS_ALL_RETRIES_FAILED), + 0 }, { "h1:443 timeout after connection", "d_h1_tls", 5 * LWS_US_PER_SEC, LWSSSCS_TIMEOUT, (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE) | - (1 << LWSSSCS_ALL_RETRIES_FAILED) + (1 << LWSSSCS_ALL_RETRIES_FAILED), + 0 }, { "h2:443 timeout after connection", "d_h2_tls", 5 * LWS_US_PER_SEC, LWSSSCS_TIMEOUT, (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE) | - (1 << LWSSSCS_ALL_RETRIES_FAILED) + (1 << LWSSSCS_ALL_RETRIES_FAILED), + 0 }, /* @@ -482,19 +488,22 @@ struct tests_seq { "h1:80 NXDOMAIN", "nxd_h1", 65 * LWS_US_PER_SEC, LWSSSCS_UNREACHABLE, (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE) | - (1 << LWSSSCS_TIMEOUT) | (1 << LWSSSCS_ALL_RETRIES_FAILED) + (1 << LWSSSCS_TIMEOUT) | (1 << LWSSSCS_ALL_RETRIES_FAILED), + 0 }, { "h1:443 NXDOMAIN", "nxd_h1_tls", 35 * LWS_US_PER_SEC, LWSSSCS_UNREACHABLE, (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE) | - (1 << LWSSSCS_TIMEOUT) | (1 << LWSSSCS_ALL_RETRIES_FAILED) + (1 << LWSSSCS_TIMEOUT) | (1 << LWSSSCS_ALL_RETRIES_FAILED), + 0 }, { "h2:443 NXDOMAIN", "nxd_h2_tls", 35 * LWS_US_PER_SEC, LWSSSCS_UNREACHABLE, (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE) | - (1 << LWSSSCS_TIMEOUT) | (1 << LWSSSCS_ALL_RETRIES_FAILED) + (1 << LWSSSCS_TIMEOUT) | (1 << LWSSSCS_ALL_RETRIES_FAILED), + 0 }, /* @@ -507,17 +516,20 @@ struct tests_seq { { "h1:80 NXDOMAIN exhaust retries", "nxd_h1", 65 * LWS_US_PER_SEC, LWSSSCS_ALL_RETRIES_FAILED, - (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE) + (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE), + 0 }, { "h1:443 NXDOMAIN exhaust retries", "nxd_h1_tls", 65 * LWS_US_PER_SEC, LWSSSCS_ALL_RETRIES_FAILED, - (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE) + (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE), + 0 }, { "h2:443 NXDOMAIN exhaust retries", "nxd_h2_tls", 65 * LWS_US_PER_SEC, LWSSSCS_ALL_RETRIES_FAILED, - (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE) + (1 << LWSSSCS_QOS_ACK_REMOTE) | (1 << LWSSSCS_QOS_NACK_REMOTE), + 0 }, /* @@ -553,17 +565,20 @@ struct tests_seq { { "h1:badcert_hostname", "badcert_hostname", 6 * LWS_US_PER_SEC, LWSSSCS_ALL_RETRIES_FAILED, - (1 << LWSSSCS_QOS_NACK_REMOTE) + (1 << LWSSSCS_QOS_NACK_REMOTE), + 0 }, { "h1:badcert_expired", "badcert_expired", 6 * LWS_US_PER_SEC, LWSSSCS_ALL_RETRIES_FAILED, - (1 << LWSSSCS_QOS_NACK_REMOTE) + (1 << LWSSSCS_QOS_NACK_REMOTE), + 0 }, { "h1:badcert_selfsigned", "badcert_selfsigned", 6 * LWS_US_PER_SEC, LWSSSCS_ALL_RETRIES_FAILED, - (1 << LWSSSCS_QOS_NACK_REMOTE) + (1 << LWSSSCS_QOS_NACK_REMOTE), + 0 }, }; diff --git a/minimal-examples/secure-streams/minimal-secure-streams-threads/minimal-secure-streams-threads.c b/minimal-examples/secure-streams/minimal-secure-streams-threads/minimal-secure-streams-threads.c index f41e96fee..57a11f8fb 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-threads/minimal-secure-streams-threads.c +++ b/minimal-examples/secure-streams/minimal-secure-streams-threads/minimal-secure-streams-threads.c @@ -188,7 +188,8 @@ system_notify_cb(lws_state_manager_t *mgr, lws_state_notify_link_t *link, int main(int argc, const char **argv) { - lws_state_notify_link_t notifier = { {0}, system_notify_cb, "app" }; + lws_state_notify_link_t notifier = { { NULL, NULL, NULL}, + system_notify_cb, "app" }; lws_state_notify_link_t *na[] = { ¬ifier, NULL }; struct lws_context_creation_info info; diff --git a/minimal-examples/ws-client/minimal-ws-client-binance/main.c b/minimal-examples/ws-client/minimal-ws-client-binance/main.c index 2aa31ca19..152d393e4 100644 --- a/minimal-examples/ws-client/minimal-ws-client-binance/main.c +++ b/minimal-examples/ws-client/minimal-ws-client-binance/main.c @@ -326,8 +326,8 @@ do_retry: } static const struct lws_protocols protocols[] = { - { "lws-minimal-client", callback_minimal, 0, 0, }, - { NULL, NULL, 0, 0 } + { "lws-minimal-client", callback_minimal, 0, 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; static void diff --git a/minimal-examples/ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c b/minimal-examples/ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c index a74d45416..285d17f1c 100644 --- a/minimal-examples/ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c +++ b/minimal-examples/ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c @@ -19,7 +19,7 @@ static struct lws_protocols protocols[] = { LWS_PLUGIN_PROTOCOL_MINIMAL_CLIENT_ECHO, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static struct lws_context *context; diff --git a/minimal-examples/ws-client/minimal-ws-client-ping/minimal-ws-client-ping.c b/minimal-examples/ws-client/minimal-ws-client-ping/minimal-ws-client-ping.c index 6f98e31dd..fceee1331 100644 --- a/minimal-examples/ws-client/minimal-ws-client-ping/minimal-ws-client-ping.c +++ b/minimal-examples/ws-client/minimal-ws-client-ping/minimal-ws-client-ping.c @@ -87,10 +87,9 @@ static const struct lws_protocols protocols[] = { { "lws-ping-test", callback_minimal_pingtest, - 0, - 0, + 0, 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static void diff --git a/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/minimal-ws-client-pmd-bulk.c b/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/minimal-ws-client-pmd-bulk.c index 1f6aa47a9..bdc7058b7 100644 --- a/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/minimal-ws-client-pmd-bulk.c +++ b/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/minimal-ws-client-pmd-bulk.c @@ -27,9 +27,9 @@ #include "protocol_lws_minimal_pmd_bulk.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_MINIMAL_PMD_BULK, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted, options; diff --git a/minimal-examples/ws-client/minimal-ws-client-rx/minimal-ws-client.c b/minimal-examples/ws-client/minimal-ws-client-rx/minimal-ws-client.c index 6883caec0..281a841a2 100644 --- a/minimal-examples/ws-client/minimal-ws-client-rx/minimal-ws-client.c +++ b/minimal-examples/ws-client/minimal-ws-client-rx/minimal-ws-client.c @@ -60,10 +60,9 @@ static const struct lws_protocols protocols[] = { { "dumb-increment-protocol", callback_dumb_increment, - 0, - 0, + 0, 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static void diff --git a/minimal-examples/ws-client/minimal-ws-client-spam-tx-rx/minimal-ws-client.c b/minimal-examples/ws-client/minimal-ws-client-spam-tx-rx/minimal-ws-client.c index ce223c32a..98b08cd06 100644 --- a/minimal-examples/ws-client/minimal-ws-client-spam-tx-rx/minimal-ws-client.c +++ b/minimal-examples/ws-client/minimal-ws-client-spam-tx-rx/minimal-ws-client.c @@ -128,7 +128,7 @@ callback(struct lws *wsi, enum lws_callback_reasons reason, static const struct lws_protocols protocols[] = { { "spam-rx-tx", callback, 4096, 4096, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static void diff --git a/minimal-examples/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c b/minimal-examples/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c index 365475995..62580eedc 100644 --- a/minimal-examples/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c +++ b/minimal-examples/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c @@ -175,9 +175,9 @@ static const struct lws_protocols protocols[] = { "lws-spam-test", callback_minimal_spam, sizeof(struct pss), - 0, + 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static struct lws_protocol_vhost_options pvo = { diff --git a/minimal-examples/ws-client/minimal-ws-client-tx/minimal-ws-client.c b/minimal-examples/ws-client/minimal-ws-client-tx/minimal-ws-client.c index d31beb133..dd8757cb2 100644 --- a/minimal-examples/ws-client/minimal-ws-client-tx/minimal-ws-client.c +++ b/minimal-examples/ws-client/minimal-ws-client-tx/minimal-ws-client.c @@ -284,10 +284,9 @@ static const struct lws_protocols protocols[] = { { "lws-minimal-broker", callback_minimal_broker, - 0, - 0, + 0, 0, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } + LWS_PROTOCOL_LIST_TERM }; static void diff --git a/minimal-examples/ws-client/minimal-ws-client/minimal-ws-client.c b/minimal-examples/ws-client/minimal-ws-client/minimal-ws-client.c index 8c46739de..70b246147 100644 --- a/minimal-examples/ws-client/minimal-ws-client/minimal-ws-client.c +++ b/minimal-examples/ws-client/minimal-ws-client/minimal-ws-client.c @@ -137,8 +137,8 @@ do_retry: } static const struct lws_protocols protocols[] = { - { "lws-minimal-client", callback_minimal, 0, 0, }, - { NULL, NULL, 0, 0 } + { "lws-minimal-client", callback_minimal, 0, 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; static void diff --git a/minimal-examples/ws-server/minimal-ws-broker/minimal-ws-broker.c b/minimal-examples/ws-server/minimal-ws-broker/minimal-ws-broker.c index 88ee988bf..cab9af550 100644 --- a/minimal-examples/ws-server/minimal-ws-broker/minimal-ws-broker.c +++ b/minimal-examples/ws-server/minimal-ws-broker/minimal-ws-broker.c @@ -22,9 +22,9 @@ #include "protocol_lws_minimal.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_MINIMAL, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c b/minimal-examples/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c index 4fd5cb8ed..6f66c4459 100644 --- a/minimal-examples/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c +++ b/minimal-examples/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c @@ -362,10 +362,10 @@ callback_proxy_raw_client(struct lws *wsi, enum lws_callback_reasons reason, } static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, - { "lws-ws-raw-ws", callback_proxy_ws_server, 0, 1024 }, - { "lws-ws-raw-raw", callback_proxy_raw_client, 0, 1024 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, + { "lws-ws-raw-ws", callback_proxy_ws_server, 0, 1024, 0, NULL, 0 }, + { "lws-ws-raw-raw", callback_proxy_raw_client, 0, 1024, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; static const lws_retry_bo_t retry = { diff --git a/minimal-examples/ws-server/minimal-ws-server-echo/minimal-ws-server-echo.c b/minimal-examples/ws-server/minimal-ws-server-echo/minimal-ws-server-echo.c index e3b217f90..7a8e94625 100644 --- a/minimal-examples/ws-server/minimal-ws-server-echo/minimal-ws-server-echo.c +++ b/minimal-examples/ws-server/minimal-ws-server-echo/minimal-ws-server-echo.c @@ -19,7 +19,7 @@ static struct lws_protocols protocols[] = { LWS_PLUGIN_PROTOCOL_MINIMAL_SERVER_ECHO, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted, port = 7681, options; diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c b/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c index 6f655c4f2..fbda46124 100644 --- a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c +++ b/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c @@ -21,9 +21,9 @@ #include "protocol_lws_minimal_pmd_bulk.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_MINIMAL_PMD_BULK, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted, options; diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c b/minimal-examples/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c index 7a31a1f3a..06ecb6796 100644 --- a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c +++ b/minimal-examples/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c @@ -21,9 +21,9 @@ #include "protocol_lws_minimal.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_MINIMAL, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c b/minimal-examples/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c index 2b7b567f3..4496a351d 100644 --- a/minimal-examples/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c +++ b/minimal-examples/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c @@ -21,9 +21,9 @@ #include "protocol_lws_minimal.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_MINIMAL, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c b/minimal-examples/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c index c87ad2014..f4e02a28e 100644 --- a/minimal-examples/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c +++ b/minimal-examples/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c @@ -22,9 +22,9 @@ #include "protocol_lws_minimal.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_MINIMAL, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c b/minimal-examples/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c index 61beb54da..63a120241 100644 --- a/minimal-examples/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c +++ b/minimal-examples/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c @@ -33,9 +33,9 @@ #include "protocol_lws_minimal_threadpool.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_MINIMAL, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c b/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c index b9b7d35d8..1b8299a4d 100644 --- a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c +++ b/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c @@ -36,9 +36,9 @@ #include "protocol_lws_minimal.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_MINIMAL, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static struct lws_context *context; diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c b/minimal-examples/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c index 8a74eb747..4613e9e86 100644 --- a/minimal-examples/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c +++ b/minimal-examples/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c @@ -35,9 +35,9 @@ #define COUNT_THREADS 2 static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_MINIMAL, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static struct lws_context *context; diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/minimal-ws-server.c b/minimal-examples/ws-server/minimal-ws-server-threads/minimal-ws-server.c index fb96a1bf0..9e4627e6e 100644 --- a/minimal-examples/ws-server/minimal-ws-server-threads/minimal-ws-server.c +++ b/minimal-examples/ws-server/minimal-ws-server-threads/minimal-ws-server.c @@ -33,9 +33,9 @@ #include "protocol_lws_minimal.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, LWS_PLUGIN_PROTOCOL_MINIMAL, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static int interrupted; diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/minimal-ws-server.c b/minimal-examples/ws-server/minimal-ws-server-timer/minimal-ws-server.c index de97e6c73..a7f0d1acc 100644 --- a/minimal-examples/ws-server/minimal-ws-server-timer/minimal-ws-server.c +++ b/minimal-examples/ws-server/minimal-ws-server-timer/minimal-ws-server.c @@ -48,9 +48,9 @@ callback_protocol(struct lws *wsi, enum lws_callback_reasons reason, } static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, - { "timer", callback_protocol, 0, 0 }, - { NULL, NULL, 0, 0 } /* terminator */ + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0 }, + { "timer", callback_protocol, 0, 0, 0, NULL, 0 }, + LWS_PROTOCOL_LIST_TERM }; static const lws_retry_bo_t retry = { diff --git a/minimal-examples/ws-server/minimal-ws-server/minimal-ws-server.c b/minimal-examples/ws-server/minimal-ws-server/minimal-ws-server.c index 741d17410..921bcffaf 100644 --- a/minimal-examples/ws-server/minimal-ws-server/minimal-ws-server.c +++ b/minimal-examples/ws-server/minimal-ws-server/minimal-ws-server.c @@ -22,9 +22,9 @@ #include "protocol_lws_minimal.c" static struct lws_protocols protocols[] = { - { "http", lws_callback_http_dummy, 0, 0 }, + { "http", lws_callback_http_dummy, 0, 0, 0, NULL, 0}, LWS_PLUGIN_PROTOCOL_MINIMAL, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; static const lws_retry_bo_t retry = { diff --git a/plugins/protocol_client_loopback_test.c b/plugins/protocol_client_loopback_test.c index 067738f11..ca9b42900 100644 --- a/plugins/protocol_client_loopback_test.c +++ b/plugins/protocol_client_loopback_test.c @@ -174,6 +174,7 @@ LWS_VISIBLE const struct lws_protocols client_loopback_test_protocols[] = { callback_client_loopback_test, sizeof(struct per_session_data__client_loopback_test), 1024, /* rx buf size must be >= permessage-deflate rx size */ + 0, NULL, 0 }, }; diff --git a/plugins/protocol_lws_openmetrics_export.c b/plugins/protocol_lws_openmetrics_export.c index 0fe216ada..f7fb60155 100644 --- a/plugins/protocol_lws_openmetrics_export.c +++ b/plugins/protocol_lws_openmetrics_export.c @@ -1162,19 +1162,19 @@ LWS_VISIBLE const struct lws_protocols lws_openmetrics_export_protocols[] = { "lws-openmetrics", callback_lws_openmetrics_export, sizeof(struct pss), - 1024, + 1024, 0, NULL, 0 }, { /* for scraper via ws proxy: http export on listen socket */ "lws-openmetrics-prox-agg", callback_lws_openmetrics_prox_agg, sizeof(struct pss), - 1024, + 1024, 0, NULL, 0 }, { /* metrics proxy server side: ws server for clients to connect to */ "lws-openmetrics-prox-server", callback_lws_openmetrics_prox_server, sizeof(struct pss), - 1024, + 1024, 0, NULL, 0 }, #endif #if defined(LWS_WITH_CLIENT) && defined(LWS_ROLE_WS) @@ -1182,7 +1182,7 @@ LWS_VISIBLE const struct lws_protocols lws_openmetrics_export_protocols[] = { "lws-openmetrics-prox-client", callback_lws_openmetrics_prox_client, sizeof(struct pss), - 1024, + 1024, 0, NULL, 0 }, #endif }; diff --git a/plugins/protocol_lws_raw_test.c b/plugins/protocol_lws_raw_test.c index 329663a37..78bb8acd7 100644 --- a/plugins/protocol_lws_raw_test.c +++ b/plugins/protocol_lws_raw_test.c @@ -278,7 +278,7 @@ callback_raw_test(struct lws *wsi, enum lws_callback_reasons reason, void *user, "protocol-lws-raw-test", \ callback_raw_test, \ sizeof(struct per_session_data__raw_test), \ - 1024, /* rx buf size must be >= permessage-deflate rx size */ \ + 1024, /* rx buf size must be >= permessage-deflate rx size */ 0, NULL, 0\ } #if !defined (LWS_PLUGIN_STATIC) diff --git a/plugins/ssh-base/sshd.c b/plugins/ssh-base/sshd.c index d934f3af3..f90c50082 100644 --- a/plugins/ssh-base/sshd.c +++ b/plugins/ssh-base/sshd.c @@ -2067,7 +2067,7 @@ lws_callback_raw_sshd(struct lws *wsi, enum lws_callback_reasons reason, * * The RECOMMENDED timeout period is 10 minutes. */ - lws_set_timeout(wsi, + lws_set_timeout(wsi, (enum pending_timeout) SSH_PENDING_TIMEOUT_CONNECT_TO_SUCCESSFUL_AUTH, 10 * 60); break; diff --git a/test-apps/test-client.c b/test-apps/test-client.c index 2c3e97cee..640fa8a0a 100644 --- a/test-apps/test-client.c +++ b/test-apps/test-client.c @@ -515,21 +515,18 @@ static const struct lws_protocols protocols[] = { { "dumb-increment-protocol", callback_dumb_increment, - 0, - 20, + 0, 20, 0, NULL, 0 }, { "lws-mirror-protocol", callback_lws_mirror, - 0, - 4096, + 0, 4096, 0, NULL, 0 }, { "lws-test-raw-client", callback_test_raw_client, - 0, - 128 + 0, 128, 0, NULL, 0 }, - { NULL, NULL, 0, 0 } /* end */ + LWS_PROTOCOL_LIST_TERM }; #if defined(LWS_ROLE_WS) && !defined(LWS_WITHOUT_EXTENSIONS) diff --git a/test-apps/test-server.c b/test-apps/test-server.c index 706f9445f..36fec50e7 100644 --- a/test-apps/test-server.c +++ b/test-apps/test-server.c @@ -187,14 +187,14 @@ lws_callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, static struct lws_protocols protocols[] = { /* first protocol must always be HTTP handler */ - { "http-only", lws_callback_http, 0, 0, }, + { "http-only", lws_callback_http, 0, 0, 0, NULL, 0 }, #if defined(LWS_ROLE_WS) LWS_PLUGIN_PROTOCOL_DUMB_INCREMENT, LWS_PLUGIN_PROTOCOL_MIRROR, LWS_PLUGIN_PROTOCOL_LWS_STATUS, #endif LWS_PLUGIN_PROTOCOL_POST_DEMO, - { NULL, NULL, 0, 0 } /* terminator */ + LWS_PROTOCOL_LIST_TERM }; @@ -278,8 +278,6 @@ static const struct lws_http_mount mount_ziptest_uncomm = { LWSMPRO_FILE, /* origin points to a callback */ 14, /* strlen("/ziptest"), ie length of the mountpoint */ NULL, - - { NULL, NULL } // sentinel }, mount_ziptest = { (struct lws_http_mount *)&mount_ziptest_uncomm, /* linked-list pointer to next*/ "/ziptest", /* mountpoint in URL namespace on this vhost */ @@ -298,8 +296,6 @@ static const struct lws_http_mount mount_ziptest_uncomm = { LWSMPRO_FILE, /* origin points to a callback */ 8, /* strlen("/ziptest"), ie length of the mountpoint */ NULL, - - { NULL, NULL } // sentinel }, mount_post = { (struct lws_http_mount *)&mount_ziptest, /* linked-list pointer to next*/ "/formtest", /* mountpoint in URL namespace on this vhost */ @@ -318,8 +314,6 @@ static const struct lws_http_mount mount_ziptest_uncomm = { LWSMPRO_CALLBACK, /* origin points to a callback */ 9, /* strlen("/formtest"), ie length of the mountpoint */ NULL, - - { NULL, NULL } // sentinel }, mount = { /* .mount_next */ &mount_post, /* linked-list "next" */ /* .mountpoint */ "/", /* mountpoint URL */