libwebsockets/lib
Andy Green faa1526b39 lws-vhost-destroy
Adds a new api lws_vhost_destroy(struct lws_vhost *) which allows dynamic removal of vhosts.

The external api calls two parts of internal helpers that get reused for context destroy.

The second part is called deferred by 5s... this is to ensure that event library objects
composed into structs owned by the vhost all have a chance to complete their close
asynchronously.  That should happen immediately, but it requires us to return to the
event loop first.

The vhost being removed is deleted from the context vhost list by the first part, and does
not block further removals or creation during the delay for the deferred freeing of the
vhost memory.

Part 1:

 - if the vhost owned a listen socket needed by other vhosts listening on same iface + port, the listen
   socket is first handed off to another vhost so it stays alive

 - all wsi still open on the vhost are forcibly closed (including any listen socket still attached)

 - inform all active protocols on the vhost they should destroy themselves

 - remove vhost from context vhost list (can no longer be found by incoming connections)

 - add to a "being destroyed" context list and schedule the second part to be called in 5s

Part 2:

 - remove us from the being destroyed list

 - free all allocations owned by the vhost

 - zero down the vhost and free the vhost itself


In libwebsockets-test-server, you can send it a SIGUSR1 to have it toggle the creation and destruction of
a second vhost on port + 1.
2017-07-19 08:51:43 +08:00
..
.gitignore Ignoring linux build files 2013-01-09 15:46:11 +08:00
alloc.c LWS_PLAT_OPTEE: Convert to use TEE_Malloc 2017-02-07 00:51:25 +08:00
base64-decode.c base64 decode fix lengths 2016-08-10 21:20:23 +08:00
client-handshake.c ah: require parsing complete before detach 2017-06-28 12:13:13 +08:00
client-parser.c pmd: handle case we are already on drain list 2017-03-26 10:19:34 +08:00
client.c client: use right state machine 2017-06-28 22:25:57 +08:00
context.c lws-vhost-destroy 2017-07-19 08:51:43 +08:00
daemonize.c context deprecation 2016-12-20 14:37:07 +08:00
extension-permessage-deflate.c ext: pmd: improve dealing with partial input usage with drain 2017-03-20 19:07:19 +08:00
extension-permessage-deflate.h extension permessage deflate 2016-01-11 11:34:01 +08:00
extension.c lws_intptr_t 2017-07-07 08:32:04 +08:00
fops-zip.c win32: enable 64-bit file lengths 2017-06-09 20:20:42 +08:00
getifaddrs.c lws_intptr_t 2017-07-07 08:32:04 +08:00
getifaddrs.h esp8266 initial support 2016-08-10 21:20:23 +08:00
handshake.c serving: protect file sending from downgrading to waiting pipelined headers 2017-06-28 10:04:57 +08:00
header.c lws_intptr_t 2017-07-07 08:32:04 +08:00
hpack.c http2 update integration 2016-04-13 11:53:40 +08:00
http2.c lws_intptr_t 2017-07-07 08:32:04 +08:00
huftable.h http2 hpack basic decode ok including huff 2014-10-12 08:38:16 +08:00
lejp-conf.c lws_intptr_t 2017-07-07 08:32:04 +08:00
lejp.c documentation convert to doxygen 2016-07-14 08:57:27 +08:00
lejp.h documentation convert to doxygen 2016-07-14 08:57:27 +08:00
lextable-strings.h raw: adoption and processing 2017-02-21 07:47:35 +08:00
lextable.h raw: adoption and processing 2017-02-21 07:47:35 +08:00
libev.c ev: stop event listeners during context destroy 2017-03-29 08:22:19 +08:00
libevent.c Subject: Libevent: Initial Support 2017-03-22 05:36:25 +08:00
libuv.c lws-vhost-destroy 2017-07-19 08:51:43 +08:00
libwebsockets.c lws-vhost-destroy 2017-07-19 08:51:43 +08:00
libwebsockets.h lws-vhost-destroy 2017-07-19 08:51:43 +08:00
lws-plat-esp32.c esp32: make button debounce also available in factory 2017-06-15 07:59:22 +08:00
lws-plat-esp8266.c Subject: windows: support to bind to a specific IPv6 address 2017-06-06 07:44:50 +08:00
lws-plat-optee.c Subject: windows: support to bind to a specific IPv6 address 2017-06-06 07:44:50 +08:00
lws-plat-unix.c valgrind: fix leak in caps handling 2017-07-19 04:10:36 +08:00
lws-plat-win.c lws_intptr_t 2017-07-07 08:32:04 +08:00
minihuf.c whitespace trailing mass cleanout 2015-12-14 08:52:03 +08:00
minilex.c whitespace trailing mass cleanout 2015-12-14 08:52:03 +08:00
output.c lws_intptr_t 2017-07-07 08:32:04 +08:00
parsers.c ah: enforce waiting list detach 2017-07-19 04:19:25 +08:00
pollfd.c LWS_WITH_STATS 2017-05-09 14:19:43 +08:00
private-libwebsockets.h lws-vhost-destroy 2017-07-19 08:51:43 +08:00
ranges.c RFC7233 HTTP Ranges support for server 2016-12-20 14:37:07 +08:00
rewrite.c check oom on lws_malloc 2016-05-12 21:04:33 +08:00
romfs.c esp32: ROMFS use checksum as mtime so ETAG caching works 2017-04-05 10:44:28 +08:00
romfs.h esp32: ROMFS use checksum as mtime so ETAG caching works 2017-04-05 10:44:28 +08:00
server-handshake.c clean: fixes for appveyor warnings 2017-07-19 04:25:20 +08:00
server.c lws-vhost-destroy 2017-07-19 08:51:43 +08:00
service.c lws-vhost-destroy 2017-07-19 08:51:43 +08:00
sha-1.c polarssl implementation 2016-04-18 20:05:43 +08:00
smtp.c boilerplate: add back missing Lesser that cut-and-pasted itself around 2017-04-06 23:01:34 +08:00
ssl-client.c client: reject init_client_ssl more than once 2017-07-08 16:03:38 +08:00
ssl-http2.c gcc format strings: http2 2017-02-07 00:51:25 +08:00
ssl-server.c lws-vhost-destroy 2017-07-19 08:51:43 +08:00
ssl.c valgrind: stop openssl still reachable complaints 2017-07-19 04:11:30 +08:00