mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
![]() In the case we have a lot of connections, checking them all for timeout state once a second becomes burdensome. At the moment if you have 100K connections, once a second they all get checked for timeout in a loop. This patch adds a doubly-linked list based in the context to each wsi, and only wsi with pending timeouts appear on it. At checking time, we traverse the list, which costs nothing if empty because nobody has a pending timeout. Similarly adding and removing from the list costs almost nothing since no iteration is required no matter how big the list. The extra 8 or 16 bytes in the wsi are offset a little bit by demoting .pps from int to char (save 3 bytes). And trim max act exts to 2, since we only provide one, saving 8 /16 bytes by itself if exts enabled. Signed-off-by: Andy Green <andy.green@linaro.org> |
||
---|---|---|
.. | ||
.gitignore | ||
alloc.c | ||
base64-decode.c | ||
client-handshake.c | ||
client-parser.c | ||
client.c | ||
context.c | ||
daemonize.c | ||
extension-permessage-deflate.c | ||
extension-permessage-deflate.h | ||
extension.c | ||
getifaddrs.c | ||
getifaddrs.h | ||
handshake.c | ||
header.c | ||
hpack.c | ||
http2.c | ||
huftable.h | ||
lextable-strings.h | ||
lextable.h | ||
libev.c | ||
libwebsockets.c | ||
libwebsockets.h | ||
lws-plat-mbed3.c | ||
lws-plat-mbed3.cpp | ||
lws-plat-unix.c | ||
lws-plat-win.c | ||
minihuf.c | ||
minilex.c | ||
output.c | ||
parsers.c | ||
pollfd.c | ||
private-libwebsockets.h | ||
server-handshake.c | ||
server.c | ||
service.c | ||
sha-1.c | ||
ssl-http2.c | ||
ssl.c |