Age | Commit message (Collapse) | Author |
|
|
|
C++ APIs wrapping SS client
These are intended to provide an experimental protocol-independent c++
api even more abstracted than secure streams, along the lines of
"wget -Omyfile https://example.com/thing"
WIP
|
|
There's a type of router in the wild issuing malformed http when
in captive portal mode... there's no \x0a\x0d but just \x0a
|
|
As found by Sai
|
|
Establish a new distributed CMake architecture with CMake code related to
a source directory moving to be in the subdir in its own CMakeLists.txt.
In particular, there's now one in ./lib which calls through to ones
further down the directory tree like ./lib/plat/xxx, ./lib/roles/xxx etc.
This cuts the main CMakelists.txt from 98KB -> 33KB, about a 66% reduction,
and it's much easier to maintain sub-CMakeLists.txt that are in the same
directory as the sources they manage, and conceal all the details that that
level.
Child CMakelists.txt become responsible for:
- include_directories() definition (this is not supported by CMake
directly, it passes it back up via PARENT_SCOPE vars in helper
macros)
- Addition child CMakeLists.txt inclusion, for example toplevel ->
role -> role subdir
- Source file addition to the build
- Dependent library path resolution... this is now a private thing
in the child CMakeLists.txt, it just passes back any adaptations
to include_directories() and the LIB_LIST without filling the
parent namespace with the details
|
|
|
|
Move the unix spawn.c from lib/misc through to lib/plat/unix, and
add an implementation for windows in lib/plat/windows
|
|
ebuf.token incoming
(Includes fixes from Yichen Gu)
Currently the incoming ebuf is always replaced to point to either a whole
buflist segment, or up to the (pt_serv_buf - LWS_PRE) length in the pt_serv_buf.
This is called on path for handling http read... some user code reasonably wants to
restrict the read size to what it can handle.
Change the other lws_buflist_aware_read() callers to zero ebuf before calling, and for
those have it keep the current behaviour; but if non-NULL ebuf.token on incoming, as
in http read path case, restrict both reported len of buflist content and the read length
to the incoming ebuf.len so the user code can control what it will get at one time.
Additionally muxed protocol wsi have no choice but to read what was sent to them
since it's HOL-blocking for other streams and its own WINDOW_UPDATEs. So add an
internal param to lws_buflist_aware_read() forcing read even if buflist content
is available.
|
|
Notifiers may also have scoped lifecycles, support deregister
|
|
|
|
|
|
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.
|
|
|
|
|
|
This commit is coverity-clean as tested
cmake .. -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITHOUT_EXTENSIONS=1 -DLWS_WITH_ACME=1 -DLWS_WITH_LWSWS=1 -DLWS_WITH_LIBUV=1 -DLWS_WITH_HTTP2=1 -DLWS_WITHOUT_CLIENT=0 -DLWS_WITHOUT_SERVER=0 -DLWS_UNIX_SOCK=1 -DLWS_WITH_TLS=0 -DLWS_WITH_MBEDTLS=0 -DLWS_WITH_CGI=1 -DCMAKE_BUILD_TYPE=DEBUG -DLWS_WITH_GENERIC_SESSIONS=1 -DLWS_WITH_RANGES=1 -DLWS_ROLE_WS=1 -DLWS_MAX_SMP=16 -DLWS_ROLE_H1=1 -DLWS_WITH_WOLFSSL=0 -DLWS_WITH_LIBEV=0 -DLWS_WITH_LIBEVENT=1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You can get a worst-first list of stack allocators like this
$ cat ./lib/.libs/*.su | sort -k2g | tac
On x86_64, currently the ones above 100 bytes are
server.c:126:5:lws_server_socket_service 4208 static
client.c:42:5:lws_client_socket_service 1584 static
libwebsockets.c:1539:1:libwebsocket_create_context 1136 static
libwebsockets.c:783:1:libwebsocket_service_fd 656 static
client-handshake.c:3:22:__libwebsocket_client_connect_2 592 static
libwebsockets.c:2149:6:_lws_log 496 static
server-handshake.c:33:1:handshake_0405 464 static
libwebsockets.c:2102:13:lwsl_emit_stderr 352 static
client.c:351:1:lws_client_interpret_server_handshake 240 static
daemonize.c:93:1:lws_daemonize 224 static
libwebsockets.c:434:1:libwebsockets_get_peer_addresses 208 static
client.c:694:1:libwebsockets_generate_client_handshake 208 static
output.c:534:5:libwebsockets_serve_http_file 192 static
output.c:51:6:lwsl_hexdump 176 static
sha-1.c:316:1:SHA1 160 static
libwebsockets.c:157:1:libwebsocket_close_and_free_session 144 static
Signed-off-by: Andy Green <andy.green@linaro.org>
|
|
|
|
Signed-off-by: David Galeano <davidgaleano@turbulenz.biz>
|
|
Signed-off-by: Jean-Pierre Gygax <gygax@practicomp.ch>
|