1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/minimal-examples/api-tests
Andy Green 625bade63e ss: static policy: dynamic vhost instantiation
Presently a vh is allocated per trust store at policy parsing-time, this
is no problem on a linux-class device or if you decide you need a dynamic
policy for functionality reasons.

However if you're in a constrained enough situation that the static policy
makes sense, in the case your trust stores do not have 100% duty cycle, ie,
are anyway always in use, the currently-unused vhosts and their x.509 stack
are sitting there taking up heap for no immediate benefit.

This patch modifies behaviour in ..._STATIC_POLICY_ONLY so that vhosts and
associated x.509 tls contexts are not instantiated until a secure stream using
them is created; they are refcounted, and when the last logical secure
stream using a vhost is destroyed, the vhost and its tls context is also
destroyed.

If another ss connection is created that wants to use the trust store, the
vhost and x.509 context is regenerated again as needed.

Currently the refcounting is by ss, it's also possible to move the refcounting
to be by connection.  The choice is between the delay to generate the vh
being visisble at logical ss creation-time, or at connection-time.  It's anyway
not preferable to have ss instantiated and taking up space with no associated
connection or connection attempt underway.

NB you will need to reprocess any static policies after this patch so they
conform to the trust_store changes.
2020-07-21 12:43:32 +01:00
..
api-test-async-dns cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
api-test-dhcpc cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
api-test-fts cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
api-test-gencrypto cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
api-test-jose jwt: sign and create jws helper 2020-07-15 16:17:59 +01:00
api-test-lejp lws_json_simple: allow running into end 2020-07-15 16:18:00 +01:00
api-test-lws_dsh cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
api-test-lws_sequencer cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
api-test-lws_smd lws_smd: system message distribution 2020-06-27 07:57:22 +01:00
api-test-lws_struct-json struct-lejp: handle no path match 2020-07-15 16:18:00 +01:00
api-test-lws_struct_sqlite cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
api-test-lws_tokenize lws_smd: system message distribution 2020-06-27 07:57:22 +01:00
api-test-lwsac cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
api-test-secure-streams ss: static policy: dynamic vhost instantiation 2020-07-21 12:43:32 +01:00
api-test-smtp_client cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
README.md smtp: make abstract 2019-05-04 08:28:31 +01:00

These are buildable test apps that run in CI to confirm correct api operation.

name tests
api-test-lwsac LWS Allocated Chunks api
api-test-lws_struct-json Selftests for lws_struct JSON serialization and deserialization
api-test-lws_tokenize Generic secure string tokenizer api
api-test-fts LWS Full-text Search api
api-test-gencrypto LWS Generic Crypto apis
api-test-jose LWS JOSE apis
api-test-smtp_client SMTP client for sending emails