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

2604 commits

Author SHA1 Message Date
Andy Green
e052edb14f minimal-http-server-libuv-foreign 2018-04-06 10:38:03 +08:00
Andy Green
b9c7f3df92 libuv: run loop to clean up per-pt objects before exiting 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
3a020c1eab lws_filename_purify_inplace 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
cd30656e01 logging: reduce logs related to POST and spa 2018-04-06 10:38:03 +08:00
Andy Green
865b2439ce mingw: also workaround ENOTCONN 2018-04-06 10:38:03 +08:00
Andy Green
b45956fcb9 client: add alpn processing on mbedtls and openssl
This just supports "http/1.1" alpn and lets the client know it
can use keepalive earlier if it affirmitively negotiated
"http/1.1" on alpn.

mbedTLS wrapper needed a small adaptation to also allow
per-client-ssl control of the alpn negotiation list.
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
7cef6fcc7b udp 2018-04-06 10:38:03 +08:00
Andy Green
1820212724 lws_set_timer_usecs: change to usec resolution
This replaces the existing, unreleased lws_set_timer(wsi, secs) with
lws_set_timer_usecs(wsi, usecs).

wsi with a timer waiting are added to a linked-list sorted by the
timer trigger time.

1) poll() timeout (ie, poll wait) is trimmed to the nearest ms of the
first waiting timer if the default poll wait is longer than the
interval until the first waiting timer.

The linked-list of waiting timers is checked every entry and exit
from poll()... if no timers waiting or none reached their time
this costs almost nothing.

2) libuv: the earliest hrtimer is checked after every IO, again this
is costing nothing if the list head is NULL.  If the case there
are hrtimers on the list, it costs a getimeofday (a VDSO in linux)
and more only if any of the timers have fired.

In addition on entry to libuv idle, if there are any waiting hrtimers
on the list, a libuv timer is used to force a wake in case we stay
idle (the libuv timer has ms resolution).

3) libev: not implemented

4) libevent: not implemented

Warnings are logged in the api is used on an event backend without
support.  Patches welcome to add support similarly to libuv.
2018-04-06 10:38:03 +08:00
Andy Green
9cf641dece minimal: minimal-raw-adopt-tcp 2018-04-06 10:38:03 +08:00
Andy Green
feeca915b9 lwsws: fix inherited vhost info 2018-04-06 10:38:03 +08:00
Andy Green
eedee9c0d3 cmake: remove unused check on inttypes.h 2018-04-06 10:38:03 +08:00
Andy Green
7aa511d8c5 minimal: minimal raw vhost 2018-04-06 10:38:03 +08:00
Andy Green
03acd5a24d valgrind: context creation error path 2018-04-06 10:38:03 +08:00
Andy Green
b80cef6919 minimal: minimal-raw-file 2018-04-06 10:38:03 +08:00
Andy Green
a4161780df wss-over-h2: show feedback in test page if active 2018-04-06 10:38:03 +08:00
Andy Green
3e4a1f3b0e client: choose right vh client ssl_ctx 2018-04-06 10:38:03 +08:00
Andy Green
b04708178a minimal: http-server-tls 2018-04-06 10:38:03 +08:00
Andy Green
5ecec970b2 minimal: dynamic http server 2018-04-06 10:38:03 +08:00
Andy Green
2519ac9ced coverity 188316: supposed deadcode 2018-04-06 10:38:03 +08:00
Andy Green
5fe9335b36 coverity 188416: possibility of NULL iface 2018-04-06 10:38:03 +08:00
Andy Green
0b65112ec4 coverity 188317: more fiddling around NO_EXTENSIONS 2018-04-06 10:38:03 +08:00
Andy Green
5acbb04b51 unixskt: add test server support and cleanup inode on exit 2018-04-06 10:38:03 +08:00
Andy Green
422cbf24bd align private LWS_NO_EXTENSIONS to be same as public LWS_WITHOUT_EXTENSIONS
This is just an internal mass change of LWS_NO_EXTENSIONS to
LWS_WITHOUT_EXTENSIONS to match the public name and eliminate
all instances of LWS_NO_EXTENSIONS.
2018-04-06 10:38:03 +08:00
Andy Green
80e3e723e3 coverity 188326: hide supposed dead code from coverity with NO_EXTENSIONS 2018-04-06 10:38:03 +08:00
Andy Green
95f8328ffc coverity 188320: hide supposed dead code from coverity with NO_EXTENSIONS 2018-04-06 10:38:03 +08:00
Andy Green
e157fcfe37 coverity 188316: hide supposed dead code from coverity with NO_EXTENSIONS 2018-04-06 10:38:03 +08:00
Andy Green
b0b10001fe coverity 188318: try to hide fake unused var from coverity 2018-04-06 10:38:03 +08:00
Andy Green
396b42ac6d coverity 188310: mirror plugin: when reach max mirror instances release lock before disconnect 2018-04-06 10:38:03 +08:00
Andy Green
b9a3b808fb coverity 188319: hide logically deaf code from coverity when WITHOUT_EXTENSIONS 2018-04-06 10:38:03 +08:00
Andy Green
313cbb5350 coverity 188323: hide logically deaf code from coverity when WITHOUT_EXTENSIONS 2018-04-06 10:38:03 +08:00
Andy Green
d237ac1b95 coverity 188312: hide logically deaf code from coverity when WITHOUT_EXTENSIONS
There's nothing wrong with this but coverity chokes on it.

Also 188317 "solved" by this.
2018-04-06 10:38:03 +08:00
Andy Green
775f7bce09 coverity 188313: client: avoid possibility of strlen on NULL cce 2018-04-06 10:38:03 +08:00
Andy Green
bfc8a5cb1b coverity 188325: client: require at least once vhost 2018-04-06 10:38:03 +08:00
Andy Green
5a8fca6f79 coverity 188322: confirm wsi->protocol non-NULL before CONNECTION_ERROR 2018-04-06 10:38:03 +08:00
Andy Green
da38a17a31 coverity 188321: reject wsi with NULL vhost earlier 2018-04-06 10:38:03 +08:00
Andy Green
ea8c44d799 coverity 188315: reject wsi with NULL vhost earlier 2018-04-06 10:38:03 +08:00
Andy Green
613ae7921a coverity 188314: reject wsi with NULL vhost earlier 2018-04-06 10:38:03 +08:00
Andy Green
3775ac9d2e coverity 169270: client: handle NULL protocol 2018-04-06 10:38:03 +08:00
Andy Green
0e8b3fed12 coverity 188324: dead code when no extensions 2018-04-06 10:38:03 +08:00
Andy Green
f63f4e56aa lwsws: change the example to not bind to lo
https://github.com/warmcat/libwebsockets/issues/1211
2018-04-06 10:38:03 +08:00
Andy Green
e4a3e8c4d4 LWS_WITH_MINIMAL_EXAMPLES: default-off build all minimal samples after lws for QA
This adds an lws cmake option that builds all the minimal examples as part of lws,
it's useful for QA.

It adds a macro to examples that depend on a particular lws configuration to understand
they should just null out their project definition in builds where the lws configuration
requirement is not met, and we are building as part of lws.

It also adapts all the example library additions to select the just-built-but-not-yet-installed
library in the case it is built as part of lws.  If built standalone, it now uses the cmake
platform-abstracted way to add the library requirement too.
2018-04-06 10:38:03 +08:00
Andy Green
876878a2af minimal: ws-client-tx and change dir names to match project name 2018-04-06 10:38:03 +08:00