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

2216 commits

Author SHA1 Message Date
Andy Green
fc995df480 CMake: convert all LWS_USE_... to LWS_WITH_...
Almost all the CMake options begin with LWS_WITH_..., but many of the
symbols passed to lws are LWS_USE_... , this causes neededless confusion,
compounded by the fact that a few CMake options also begin with
LWS_USE_.

This patch globally converts all LWS_USE_... to LWS_WITH_..., so there
is only one prefix to remember in both CMake and the code.

The affected public CMake options are

LWS_USE_BORINGSSL     ->  LWS_WITH_BORINGSSL
LWS_USE_CYASSL        ->  LWS_WITH_CYASSL
LWS_USE_WOLFSSL       ->  LWS_WITH_WOLFSSL
LWS_USE_MBEDTLS       ->  LWS_WITH_MBEDTLS
LWS_USE_BUNDLED_ZLIB  ->  LWS_WITH_BUNDLED_ZLIB
2017-10-16 17:13:48 +08:00
Andy Green
7597ac3766 Plugins: add ssh-base ssh server plugin 2017-10-16 16:59:57 +08:00
Andy Green
d383b94dbf README.build: update openssl link to their new wiki location 2017-09-27 08:24:05 +08:00
Alexander von Gluck IV
8bea6c144e Subject: Haiku: initial platform support
https://github.com/warmcat/libwebsockets/pull/1033
2017-09-27 08:24:05 +08:00
Andy Green
495342c2ae libuv: use shadow active events mask
libuv .events or .pevents in the io watcher don't seem to hold the POLLIN / POLLOUT
state correctly.  When POLLIN is defeated, using the rx flow control, POLLOUT seems
to go away somewhere along the line when trying to OR on to the active mask.

This has us track what we enabled outside in a container struct and use that for
the mask instead.  With this rx flow control works properly with the latest mirror
using libuv (it worked fine with poll() event loop without libuv).
2017-09-27 08:24:05 +08:00
Andy Green
bc451afb30 lws-meta: add var in js to enable and disable by default 2017-09-27 08:24:05 +08:00
Andy Green
49f8029677 coverity fixes 2017-09-27 08:24:05 +08:00
Andy Green
c52a6267ab clean 2017-09-27 08:24:05 +08:00
Andy Green
91166ecb2a pmd: handle zero-length rx 2017-09-27 08:24:05 +08:00
Andy Green
93f05d6eff test-client: add justmirror flag 2017-09-27 08:24:05 +08:00
Andy Green
4f267c515e clean up top level of project 2017-09-27 08:24:05 +08:00
Andy Green
66a402cc96 cgi: also allow for generic spawn 2017-09-27 08:24:04 +08:00
Andy Green
4a0db7fbf1 LWS_CALLBACK_ADD_HEADERS: also on upgrade headers
https://github.com/warmcat/libwebsockets/issues/1028
2017-09-27 08:24:04 +08:00
Andy Green
12adb39542 lws_ring: introduce generic flexible ringbuffer abstraction 2017-09-21 08:45:56 +08:00
Andy Green
f85a1d42d8 docs: README.coding.md: add explicit note about external poll loop forced service 2017-09-21 08:45:56 +08:00
Andy Green
d1859ad4fd logging: move most everything during startup to info 2017-09-21 08:45:56 +08:00
Andy Green
217dfe7c6b drop_privs: ignore if uid or gid is zero
0 is the natural default for the info struct.

If you are not 0 (root) then you can't change to root, it will fail
without having done anything.  What the user probably wanted is
just leave it as the uid/gid it was started as.

If you are 0 (root) you are already at 0 and the change has no
meaning.

Net effect is get rid of two warning logs if you left it at 0 in
the info struct and start as non-root.
2017-09-21 08:45:56 +08:00
Andy Green
69e4433f4e add PENDING_TIMEOUT_USER_REASON_BASE 2017-09-21 08:45:56 +08:00
Andy Green
6750365393 lwsl_hexdump: always export even if debug level disabled 2017-09-21 08:45:56 +08:00
Andy Green
59687e04e0 lws_protocol_vh_priv_get: fail gracefully with NULL vhost 2017-09-21 08:45:56 +08:00
Andy Green
98df6722ea LWS_WITH_PEER_LIMITS
Introduces an optional, settable restriction on the number of
simultaneous wsi connections and ah that a single peer IP can
obtain.

The default is disabled for build, and if enabled, unlimited.

However when enabled at CMake, setting info.ip_limit_ah and / or
info.ip_limit_wsi at context creation time will enforce the limits.

Connections past the info.ip_limit_wsi limit are dropped, and
connections needing an ah are forced to stay in the ah waiting list
even when ah are available, while the peer is at the number of
ah in info.ip_limit_ah.
2017-09-19 12:09:17 +08:00
Andy Green
4efc35db58 LWS_WITH_STATS: dont add latency when start point not set
Also fix lws_meta child connections to also measure their
own latency.
2017-09-19 12:09:17 +08:00
Andy Green
9b484ff507 docs: clarify difference between client and server ssl members in creation_info struct
Update test-client from the deprecated server ssl members that still work for
backwards compatibility to the preferred client-specific ones.

Remove .client_ssl_... member dependency on OPENSSL

https://github.com/warmcat/libwebsockets/issues/1022
2017-09-19 12:09:17 +08:00
Petar Paradzik
7379e5ad6b Subject: mbedtls_wrapper: fix using uninitialized variable
Fixes issues when compiling with "-Werror=maybe-uninitialized".

Signed-off-by: Petar Paradzik <petar.paradzik@sartura.hr>
2017-09-19 12:09:17 +08:00
Andy Green
dee2d68b9c cmake: add confirm_command macro and use for genromfs + xxd on ESP32 build
Solves the exact issue in

https://github.com/warmcat/libwebsockets/issues/1021
2017-09-19 12:09:17 +08:00
Andy Green
ca3013ca38 enable -Wundef for UNIX to catch dependencies on preprocessor defines that do not actually exist in the build 2017-09-19 12:08:31 +08:00
Andy Green
b4673d871b docs: fix typo in lws_vhost_destroy docs 2017-09-19 12:08:31 +08:00
Andy Green
a3cc4a368e esp32: report heap changes 2017-09-19 12:08:31 +08:00
Andy Green
0186490fad lws-genhash
This gives you a thin api on top of your TLS library digest functions
which abstracts away whether you are using mbedtls apis or openssl
ones.  Using lws_genhash... apis the same code works either way and
the dependencies on which TLS lib is hidden.
2017-09-10 14:44:12 +08:00
Andy Green
37b994cc69 mbedtls: find LWS_HAVE_X509_VERIFY_PARAM_set1_host in CMake 2017-09-09 08:54:58 +08:00
Andy Green
b8d3f51ebd wrapper: introduce X509_VERIFY_PARAM_set/clear_hostflags
This defines the OpenSSL X509_CHECK_FLAG_...s and the set/clear
accessors.  Since none of them are supported, the set / clear
accessor always does nothing and returns error.
2017-09-09 08:54:58 +08:00
Andy Green
14cc31fe7d wrapper: introduce X509_VERIFY_PARAM_set1_host
This lets the user code set the mbedtls hostname using the standard OpenSSL
api semantics.
2017-09-09 08:54:58 +08:00
Andy Green
43b3141f93 wrapper: introduce SSL_get0_param
This adds the standard OpenSSL api to get a pointer to the SSL struct's
X509_VERIFY_PARAM.  We need this for the OpenSSL api to set the peer
hostname introduced in the next patch.
2017-09-09 07:56:25 +08:00
Andy Green
d78c93254b cgi: stdout POLLHUP holy grail
This a) directly discovers cgi stdout POLLUP and b) modulates rx flow control on CGI STDOUT
according to the outgoing writeable service.  When the outgoing writeable service finally sees
0 read() waiting for it even though it was signalled for POLLIN, it knows it is a POLLHUP.

Critically when it sees POLLHUP like that, it leaves the rx flow control defeating any
further stdout POLLIN signalling while the rest of the CGI lifecycle completes, eliminating
busywaiting during the CGI.
2017-09-08 20:57:53 +08:00
Petar Paradzik
04ed8d2673 Subject: cgi: fix uint64_t formating
On some platforms 'llu' format is needed for uint64_t instead of 'lu'.
PRIu64 format specifier fixes these platform specific issues.

Signed-off-by: Petar Paradzik <petar.paradzik@sartura.hr>
2017-09-08 20:56:05 +08:00
Andy Green
138c8523f9 docs: add missing description of tsi on lws_service_tsi
Fixes https://github.com/warmcat/libwebsockets/issues/1017
2017-09-08 20:56:04 +08:00
Andy Green
3ea4fcf8a5 esp32: unbreak including mbedtls bits from mbedtls integration 2017-09-08 20:56:04 +08:00
Andy Green
8cb341314a esp32: unbreak cert gen from mbedtls integration 2017-09-08 20:56:04 +08:00
Andy Green
d38f630519 logging: reduce timeout and detach logs to info 2017-09-08 20:56:04 +08:00
Andy Green
f06967fa84 cgi: if we ask for writable to send chunk end, defer close 2017-09-07 11:45:35 +08:00
Andy Green
cad115bf6b docs: add mising CALLBACK docs and some extra info
https://github.com/warmcat/libwebsockets/issues/1015
2017-09-07 09:29:09 +08:00
Andy Green
f5058fa9b7 server TLS: allow user to provide cert without using filepaths
This is a rewrite of the patch from HarishSRIB here:

https://github.com/warmcat/libwebsockets/pull/1013
2017-09-06 16:31:53 +08:00
Andy Green
8d63fbb6aa ACCESS_LOG: allow early rejected accesses to log 2017-09-06 09:30:32 +08:00
Andy Green
4046239bc8 ACCESS_LOG: truncate referrer always leaving enough room for at least an empty useragent and delimiters 2017-09-06 08:39:58 +08:00
Andy Green
f8fad0d350 mbedtls: client provide CA
WIP https://github.com/warmcat/libwebsockets/issues/1011
2017-09-02 10:50:54 +08:00
Andy Green
32eaf83f24 socks5: style and exit handling 2017-09-01 19:09:47 +08:00
Andy Green
df5c143b89 socks5: remove dodgy casts
Change the last arg of socks_generate_msg() to be ssize_t * to match
signedness of original caller type of int, then convert the caller
type also to ssize_t so the pointer needs no cast.

This keeps stuff in the caller checking for len < 0 happy.

https://github.com/warmcat/libwebsockets/issues/1010
2017-09-01 15:37:53 +08:00
Andy Green
d6e8459c07 vhost: allow user pointer to be attached at creation time
https://github.com/warmcat/libwebsockets/issues/1008
2017-08-29 15:37:16 +08:00
unprompted
f994a4f728 free vs lws_free: lws_vhost_destroy2 2017-08-29 08:45:36 +08:00
Andy Green
6d25763d10 esp32: fixes for mbedtls breakout 2017-08-29 08:45:36 +08:00