-
- Downloads
introduce vhosts
This patch splits out some lws_context members into a new lws_vhost struct.
- ssl state and options per vhost
- SSL_CTX for serving and client per vhost
- protocols[] per vhost
- extensions[] per vhost
lws_context maintains a linked list of lws_vhosts.
The same lws_context_creation_info struct is used to regulate both the
context creation and to create vhosts: for backward compatibility if you
didn't provide the new LWS_SERVER_OPTION_EXPLICIT_VHOSTS option, then
a default vhost is created at context creation time using the same info
data as the context itself.
If you will have multiple vhosts though, you should give the
LWS_SERVER_OPTION_EXPLICIT_VHOSTS option at context creation time,
create the context first and then the vhosts afterwards using
lws_create_vhost(contest, &info);
Although there is a lot of housekeeping to implement this change, there
is almost no additional overhead if you don't use multiple vhosts and
very little api impact (no changes to test apps).
Signed-off-by:
Andy Green <andy@warmcat.com>
Showing
- lib/client-handshake.c 15 additions, 12 deletionslib/client-handshake.c
- lib/client.c 11 additions, 11 deletionslib/client.c
- lib/context.c 187 additions, 55 deletionslib/context.c
- lib/extension-permessage-deflate.c 1 addition, 1 deletionlib/extension-permessage-deflate.c
- lib/extension.c 6 additions, 2 deletionslib/extension.c
- lib/http2.c 7 additions, 6 deletionslib/http2.c
- lib/libev.c 10 additions, 2 deletionslib/libev.c
- lib/libuv.c 14 additions, 9 deletionslib/libuv.c
- lib/libwebsockets.c 39 additions, 24 deletionslib/libwebsockets.c
- lib/libwebsockets.h 48 additions, 20 deletionslib/libwebsockets.h
- lib/lws-plat-unix.c 8 additions, 8 deletionslib/lws-plat-unix.c
- lib/lws-plat-win.c 21 additions, 19 deletionslib/lws-plat-win.c
- lib/pollfd.c 13 additions, 11 deletionslib/pollfd.c
- lib/private-libwebsockets.h 92 additions, 44 deletionslib/private-libwebsockets.h
- lib/server-handshake.c 2 additions, 2 deletionslib/server-handshake.c
- lib/server.c 152 additions, 33 deletionslib/server.c
- lib/ssl.c 157 additions, 110 deletionslib/ssl.c
- test-server/test-server.c 1 addition, 1 deletiontest-server/test-server.c
Loading
Please register or sign in to comment