1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00
Commit graph

472 commits

Author SHA1 Message Date
Andy Green
d2bdb60a17 cgi: fix for https git server 2018-06-16 09:35:07 +08:00
Andy Green
44e5e1231b minimal client: add different paths to multi 2018-06-04 07:14:49 +08:00
Andy Green
95e31cb126 minimal ring: keep coverity happy for NULL pointer possibility 2018-06-03 17:09:27 +08:00
Andy Green
a4b44320c0 role ws: allow zero length PONG 2018-05-09 18:06:45 +08:00
Andy Green
6c1fbbf4cb minimal-ws-client-ping 2018-05-09 17:00:37 +08:00
Andy Green
d78f3a25dd minimal-http-server-form-get: fix redirect api usage 2018-05-07 16:27:58 +08:00
Andy Green
412ff64be9 lws_ring: implement lagging client culling 2018-05-06 07:36:31 +08:00
Andy Green
eeb76e822a minimal-http-server-mimetypes 2018-05-05 06:03:16 +08:00
Andy Green
c99a99e9b4 LRS_DOING_TRANSACTION 2018-05-04 12:05:56 +08:00
Andy Green
de064fd65a refactor: core code in lib/core and private-libwebsockets.h to core/private.h
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
2018-05-03 10:49:36 +08:00
Andy Green
a01ad0dd20 hrtimer: add support for libevent and libev 2018-05-02 19:27:33 +08:00
Andy Green
bce8cca042 refactor: also migrate tls to the ops struct and private.h pattern
Several new ops are planned for tls... so better to bite the bullet and
clean it out to the same level as roles + event-libs first.

Also adds a new travis target "mbedtls" and all the tests except
autobahn against mbedtls build.
2018-05-02 12:10:36 +08:00
Andy Green
da0be64f68 minimal-raw-netcat
Adapt attack.sh to use it instead of OS netcat and fox various bugs that
exposed.
2018-05-02 08:46:16 +08:00
Andy Green
f497562a62 refactor: change event lib minimal examples to serve as the test apps 2018-04-30 19:17:32 +08:00
Andy Green
0b52d92d12 refactor: remove more test apps and replace with minimal-examples 2018-04-30 09:16:04 +08:00
Andy Green
d37b383edc refactor: apply ops structs to event loop handlers 2018-04-29 10:44:36 +08:00
Andy Green
ac6c48d98f refactor: most preparation for -DLWS_ROLE_H1=0 2018-04-27 19:16:50 +08:00
Andy Green
ae688609a0 qa: add 6 x h2load tests 2018-04-27 11:19:09 +08:00
Andy Green
800cd40f88 client: support pipelining / h2 multi for POST
https://github.com/warmcat/libwebsockets/issues/1256
2018-04-27 07:25:45 +08:00
Andy Green
5d06f610a9 travis: h2spec integration 2018-04-26 15:27:02 +08:00
Andy Green
27e86e2641 cmake: allow setting LWS_ROLE_WS
You can build lws without support for ws, with -DLWS_ROLE_WS=0.

This is thanks to the role ops isolating all the ws-specific business
in the ws role.

Also retire more test apps replaced by minmal-examples.
2018-04-25 08:42:18 +08:00
Andy Green
7b227eb333 autobahn fixes
This replaces the old test-app for echo with separate client and server
minimal versions.

The autobahn test script is made more autonomous and tests both
client and server.
2018-04-22 06:45:46 +08:00
Andy Green
97e36d8901 minimal examples for Server Side Events 2018-04-20 07:15:42 +08:00
Andy Green
1d2094996e refactor: absorb other caches into buflist
1) Remove the whole ah rxbuf and put things on to the wsi buflist

This eliminates the whole detachability thing based on ah rxbuf
state... ah can always be detached.

2) Remove h2 scratch and put it on the wsi buflist

3) Remove preamble_rx and use the wsi buflist

This was used in the case adopted sockets had already been read.


Basically there are now only three forced service scenarios

 - something in buflist (and not in state LRS_DEFERRING_ACTION)

 - tls layer has buffered rx

 - extension has buffered rx

This is a net removal of around 400 lines of special-casing.
2018-04-20 07:13:05 +08:00
Andy Green
6059c965dd minimal-http-server-basicauth 2018-04-19 16:16:48 +08:00
Andy Green
ae4897f58a smp: add some overview docs on the related minimal example 2018-04-19 16:16:48 +08:00
Andy Green
b9b100bdfd minimal-http-server-post: redirect does its own header write
https://github.com/warmcat/libwebsockets/issues/1218
2018-04-19 16:16:48 +08:00
Andy Green
8829c2f365 selftests
This converts several of the selftests to return a status in their exit code
about whether they 'worked'.

A small bash script framework is added, with a selftest.sh in the mininmal
example dirs that support it, and a ./minimal-examples/selftests.sh script
that can be run from the build dir with no args that discovers and runs all
the selftest.sh scripts underneath.

That is also integrated into travis and the enabled tests must pass now for
travis to pass.  Travis does not have a modern libuv so it can't run a
couple of tests which are nulled out if it sees it's running in travis env.
2018-04-19 16:16:48 +08:00
Andy Green
f0048acbee minimal: add switches and exit results 2018-04-19 16:16:48 +08:00
Andy Green
62af7934c8 rxflow buflist: handle forced service 2018-04-19 16:15:10 +08:00
Andy Green
aa816e98a9 alpn: assemble defaults from roles and allow override
Since new roles may be incompatible with http, add support for
alpn names at the role struct, automatic generation of the
default list of alpn names that servers advertise, and the
ability to override the used alpn names per-vhost and per-
client connection.

This not only lets you modulate visibility or use of h2,
but also enables vhosts that only offer non-http roles,
as well as restricting http role vhosts to only alpn
identifiers related to http roles.
2018-04-19 16:15:10 +08:00
Andy Green
126be3ccf3 refactor role ops
This only refactors internal architecture and representations, the user
api is unaffected.
2018-04-11 13:39:42 +08:00
Andy Green
16e2f09710 refactor mode and states into roles and states 2018-04-06 12:22:19 +08:00
Andy Green
9a51bd0a63 LWS_TLS_CERT_INFO_OPAQUE_PUBLIC_KEY 2018-04-06 10:38:04 +08:00
Andy Green
c8af76c07c minimal-ws-server-pmd-bulk: add echo 2018-04-06 10:38:04 +08:00
Andy Green
ece243f961 Coverity 189187: hide coverity false positive 2018-04-06 10:38:04 +08:00
Andy Green
719f735309 minimal-http-client-post 2018-04-06 10:38:04 +08:00
Andy Green
2a9b6f54c6 client: h2
This adds h2 http support for the client api.

The public client api requires no changes, it will detect by
ALPN if the server can handle http/2, if so, it will use it.

Multiple client connections using the lws api will be mapped on
to the same single http/2 + tls socket using http/2 streams
that are serviced simultaneously where possible.
2018-04-06 10:38:03 +08:00
Andy Green
2d3fc52b73 h2: allow control of rx scratch buffer from vhost info 2018-04-06 10:38:03 +08:00
Andy Green
7d466ba98f minimal-http-client-hugeurl 2018-04-06 10:38:03 +08:00
Andy Green
e052edb14f minimal-http-server-libuv-foreign 2018-04-06 10:38:03 +08:00
Andy Green
80d84896f1 minimal-http-server-form-post-file 2018-04-06 10:38:03 +08:00
Andy Green
764d0d3b45 minimal-http-server-form-get 2018-04-06 10:38:03 +08:00
Andy Green
020a8a2c38 minimal-http-server-form-post 2018-04-06 10:38:03 +08:00
Andy Green
04e1661411 client: http1.1 pipelining 2018-04-06 10:38:03 +08:00
Andy Green
3647cd8968 minimal: client multi 2018-04-06 10:38:03 +08:00
Andy Green
bd6fc106d9 lws_write_ws_flags helper 2018-04-06 10:38:03 +08:00
Fabio Alessandrelli
94f3981bef mbedtls: wrapper: client: Force mbedTLS to attemp to verify cert
AG: unlike openssl, mbedtls does not load the system trust store.
So this change will make client tls operations that work OK on openssl fail on
mbedtls unless you provide the correct CA cert.

This allows lws to distinguish between untrusted CAs, hostname
mismatches, expired certificates.

NOTE: LCCSCF_ALLOW_SELFSIGNED actually allows for untrusted CAs, and
will also skip hostname verification. This is somewhat a limitiation of
the current lws verification process.

AG: improve error reporting up to the CLIENT_CONNECTION_ERROR argument
and add a note specific to mbedtls in the test client.  Adapt the test
client to note the CA requirement if built with mbedTLS.  Adapt the
minimal test clients to have the CAs available and use them if mbedTLS.
2018-04-06 10:38:03 +08:00
Andy Green
d5bb8ecbc6 minimal: raw udp 2018-04-06 10:38:03 +08:00
Andy Green
9cf641dece minimal: minimal-raw-adopt-tcp 2018-04-06 10:38:03 +08:00