1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00
libwebsockets/lib
Andy Green 0079099f10 vhost: add pprotocols to vhost info
info.protocols works okay, but it has an annoying problem... you have to know
the type for each protocol's pss at the top level of the code, so you can set
the struct lws_protocols user_data size for it.

Lws already rewrites the protocol tables for a vhost in the case of runtime
protocol plugins... this adapts that already-existing code slightly to give
a new optional way to declare the protocol array.

Everything works as before by default, but now info.protocols may be NULL and
info.pprotocols defined instead (if that's also NULL, as it will be if you
just ignore it after memsetting to 0, then it continues to fall back to the
dummy protocol handler as before).

info.pprotocols is a NULL-termined array of pointers to lws_protocol
structs.  This can be composed at the top level of your code without knowing
anything except the name of the externally-defined lws_protocol struct(s).

The minimal example http-server-dynamic is changed to use the new scheme as
an example.
2019-03-10 08:02:02 +08:00
..
core bzero: replace all with memset 2019-03-10 08:02:02 +08:00
core-net vhost: add pprotocols to vhost info 2019-03-10 08:02:02 +08:00
event-libs uv: ensure watcher exists before operating on it 2019-03-10 08:02:02 +08:00
jose rsa-aes-gcm: only strip padding when required 2019-01-30 08:08:16 +08:00
misc bzero: replace all with memset 2019-03-10 08:02:02 +08:00
plat mingw: windows: make minimal examples build 2019-03-10 08:02:02 +08:00
roles vhost: add pprotocols to vhost info 2019-03-10 08:02:02 +08:00
tls vhost: add pprotocols to vhost info 2019-03-10 08:02:02 +08:00
README.md JOSE: refactor and prepare for JWE 2018-12-27 06:45:31 +08:00

Library sources layout

Code that goes in the libwebsockets library itself lives down ./lib

Path Sources
lib/core Core lws code related to generic fd and wsi servicing and management
lib/event-libs Code containing optional event-lib specific adaptations
lib/jose JOSE / JWS / JWK / JWE implementations
lib/misc Code for various mostly optional miscellaneous features
lib/plat Platform-specific adaptation code
lib/roles Code for specific optional wsi roles, eg, http/1, h2, ws, raw, etc
lib/tls Code supporting the various TLS libraries
libwebsockets.h Public API header for the whole of lws