1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-23 00:00:06 +01:00
libwebsockets/lib/core-net
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
..
adopt.c mingw: windows: make minimal examples build 2019-03-10 08:02:02 +08:00
client.c ipv6: support [ipv6]:port in client proxy 2019-03-10 08:02:02 +08:00
close.c cgi: fix stdin cgiwsi leak when closed early 2019-03-10 08:02:02 +08:00
connect.c LWS_WITH_NETWORK: cmake option for no network code 2019-01-13 07:54:57 +08:00
dummy-callback.c cgi: fix stdin cgiwsi leak when closed early 2019-03-10 08:02:02 +08:00
network.c bzero: replace all with memset 2019-03-10 08:02:02 +08:00
output.c LWS_WITH_NETWORK: cmake option for no network code 2019-01-13 07:54:57 +08:00
pollfd.c smp: take pt lock in poll foreign thread detection 2019-03-10 08:02:02 +08:00
private.h ipv6: force ipv4 if iface bind uses ipv4 address 2019-03-10 08:02:02 +08:00
server.c server-status: add proc statm and switch to vhost protocol timer 2019-03-10 08:02:02 +08:00
service.c smp: adopt: deal with load balancing init window 2019-03-10 08:02:02 +08:00
stats.c LWS_WITH_NETWORK: cmake option for no network code 2019-01-13 07:54:57 +08:00
vhost.c vhost: add pprotocols to vhost info 2019-03-10 08:02:02 +08:00
wsi-timeout.c lws_http_mark_sse 2019-01-30 20:59:56 +08:00
wsi.c lws_http_mark_sse 2019-01-30 20:59:56 +08:00