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

4449 commits

Author SHA1 Message Date
Michael Drake
781c6f3227 base64: prevent writing null char into zero length output buffer
This allows handling of the unusal but foreseeable situation were
the client provides a zero length output buffer, for example, if
the input buffer was also zero length.
2022-01-10 14:21:33 +00:00
Michael Drake
c735a9f383 docs: add return value documentation for base64 decode 2022-01-10 14:20:26 +00:00
Andy Green
fdef0a2dd0 threadpool: adjust sync wait budget up 2022-01-10 04:37:15 +00:00
Andy Green
65768cf3eb dll2: add api for inserting afer existing member 2022-01-04 16:08:50 +00:00
Andy Green
8b16aa18c8 minilex: add improved generic version in misc
Leave the http minilex as it is, and add an improved version in lib/misc

 - get a list of strings from stdin and emit C header to stdout

 - support ambiguous terminals (xxx and xxx-something) correctly regardless
   of introduction order

 - add generic parser in lib/misc

minilex doesn't build as part of lws since it's only needed by developers,
there's a one-line build documented at a comment at the top of
lib/misc/minilex.c
2022-01-04 16:08:44 +00:00
Andy Green
236512687e dsh: msvc refuses void pointer arithmetic 2021-12-23 06:22:54 +00:00
Andy Green
bea294dd26 http: redirect: keep ssl options at redirect 2021-12-23 06:22:48 +00:00
Andy Green
7b82498d33 esp32: update against Dec 21 idf
Freertos in idf has moved around a bit.
2021-12-23 06:20:27 +00:00
chenzhongaaron
27f8affcd0 qnx: toolchain file and adaptations
https://github.com/warmcat/libwebsockets/issues/2527
2021-12-15 13:28:23 +00:00
Paul Lee
05c67c1879 service: make sure to sleep if nothing to do
https://github.com/warmcat/libwebsockets/issues/2524
2021-12-14 06:58:11 +00:00
chilL1n
1418042935 docs: lws_service_tsi 2021-12-13 20:32:50 +00:00
Vitaliy Orazov
05997f4503 http: proxying: allow for large headers
set the buffer size (rpath) for header processing during
 proxying equal to the value in max_http_header_data
2021-12-13 19:02:56 +00:00
Andy Green
0dae22e4dd logging: gate_accepts: reduce verbosity 2021-12-13 19:02:56 +00:00
Andy Green
f7aff789ca cancel pipe: mark close when wsi is close 2021-12-13 19:02:56 +00:00
Joerg Wendel
fe8170dcdc http: server: added no-cache handling to mounts 2021-12-13 19:02:56 +00:00
Andy Green
b8c4820be4 openssl: support SSLKEYLOGFILE client secret logging
This patch checks for the env var SSLKEYLOGFILE=path, if present, then
client connection tls secrets are appended into path.vhostname.

This allows decryption of captured encrypted data for debugging purposes.

SSKEYLOGFILE=path env var method is the same as provided by Firefox and
Chrome for this purpose.
2021-12-13 19:02:49 +00:00
DerKleinePunk
e88a1b1b32 http: cookie_get
The loop check shouldn't care about bl any more, since we snipped bl from n
already.
2021-12-02 09:21:27 +00:00
Vitaliy Orazov
5747203406 http proxy: support PUT, PATCH and DELETE methods 2021-11-29 15:18:16 +00:00
Andy Green
3feddc06a4 examples: lgtm fixes now on by default 2021-11-29 15:18:15 +00:00
Andy Green
00e24e11ee docs: decruft README.coding 2021-11-29 05:39:47 +00:00
Daniel
59abab0e79 extpoll: make sure DEL_POLL_FD only coming once
https://github.com/warmcat/libwebsockets/issues/2500
2021-11-22 15:44:53 +00:00
Andy Green
ba89af373b async dns: allow multiple servers and public add remove apis 2021-11-17 14:50:08 +00:00
Andy Green
ac5bb1c47f h2: post: do not try to bind origin for files 2021-11-17 14:50:05 +00:00
Andy Green
d080ab3585 ws: client: fail server link if masked 2021-11-17 10:14:43 +00:00
Chunho Lee
e2e020f954 ss: mqtt: add ss mqtt minimal example
Adds an example for Secure Stream MQTT.
2021-11-17 09:54:12 +00:00
Chunho Lee
afe61d3828 mqtt: always init wildcard and shadow 2021-11-17 06:53:10 +00:00
Ilya Smelykh
d425691d9f client: flag defeating default cache-control headers added 2021-11-11 16:55:20 +00:00
calvin2021y
c8811bfe48 android: fix extra warnings on android-resolv 2021-11-11 11:52:48 +00:00
Andy Green
3ede7bae26 http: remove stray debug log 2021-11-11 11:52:48 +00:00
Andy Green
53d195022f cmake: Enable WITH_MINIMAL_EXAMPLES by default
Although many of the examples must be run from the example directory as
cwd, everyone getting started probably wants to try the examples, cmake
knows how to do it, so let's enable it by default.
2021-11-11 11:52:46 +00:00
Andy Green
80e06d2175 ss: revert make ss timeout handle underlying wsi gone 2021-11-11 08:34:53 +00:00
Andy Green
8ddcb16ef1 freertos-service: remove cruft
This can't be reached currently, so remove it and simplify the setting of c
to the exact equivalent.
2021-11-11 08:34:51 +00:00
Andy Green
591d42ff67 windows: mingw file type is int 2021-11-11 08:34:02 +00:00
Yichen Gu
87dd9283e1 wsimux: immortal: only process immortality once per stream
We can call mark immortal multiple times for a child stream, make sure it
is only processed (and increments the nwsi refcount) the once.
2021-11-09 07:45:58 +00:00
Andy Green
a335958923 sspc: proxy: coverity: handle unknown metadata name 2021-11-09 07:45:58 +00:00
Andy Green
81b481ef2f h2: coverity: check for OOM on dynamic table alloc
It can fail, we should check it.
2021-11-09 07:45:58 +00:00
Andy Green
3709d80f3d ss-deserialize: add pointless h NULL check
h cannot be NULL since it's set by address offset earlier.
Help coverity understand that.
2021-11-09 07:45:58 +00:00
Andy Green
f8d74d058e adopt: coverity: add pointless vh NULL check
The wsi is always created on a valid vhost.  Add a needless NULL check on
it to satisfy coverity.
2021-11-09 07:45:48 +00:00
Andy Green
a53eb4d4fe ss-h1: coverity: add needless header NULL check
Coverity does not understand that once we checked that  the header has
a non-zero length, the associated pointer can never be NULL.  Add a
pointless check to make it happy.
2021-11-08 13:44:45 +00:00
Andy Green
7b34626a22 mbedtls-x509: coverity: remove needless check
ip can't be NULL, it's set to the address of another object.
2021-11-08 13:44:45 +00:00
Andy Green
d1f6101bad unix-sockets: NOP for coverity
continue here makes no difference than using break, but continue gets us a
pointless complaint "statement continue does not have any effect" and break
does not.
2021-11-08 13:44:45 +00:00
Andy Green
d3783f0c71 client: connect: confirm we have a protocol
Coverity gets antsy that we were checking wsi->a.protocol for NULL earlier
then start using it... explicitly bail if it's NULL before we start using
it.
2021-11-08 13:44:45 +00:00
Andy Green
f3a1263bc1 jit-trust: SAN_RFC822_NAME needs other_name union member
->san is a union, in this case we set the type to indicate we use
SAN_OTHER_NAME member, but set the unstructured_name union member, that is
smaller.

This doesn't cause any problem, since the union has space for it.  But
Coverity noticed, it is wrong, so fix it.
2021-11-08 13:44:45 +00:00
Andy Green
81a69d10e9 jit-trust: show coverity we handle NULL attribute source
Coverity doesn't understand that since we already handled
akid.keyIdentifier.MBEDTLS_PRIVATE(len) being zero, we don't need to
check for akid.keyIdentifier.MBEDTLS_PRIVATE(p) being NULL.

So explicitly check it, even though it is a NOP.
2021-11-08 13:44:45 +00:00
Andy Green
7de0d88ac3 jit-trust: clean after failed mbedtls_x509_get_name
mbedtls_x509_get_name() does not clean up properly after itself in the case
of OOM on multi-segment name.  We have to add extra handling and cleaning.
2021-11-08 13:44:45 +00:00
PW Hu
fe31dcd8ac docs: audit api return information
https://github.com/warmcat/libwebsockets/issues/2481
2021-11-07 10:08:00 +00:00
Andy Green
c19dc963c9 cgi: issue CGI_TERMINATED also on reap
We also need to report CGI_TERMINATED when reaping children that closed by
themselves.  Keep an extra copy of the pid outside of the lws_spawn object
so it's still around by then.
2021-11-07 07:04:09 +00:00
Andy Green
270a14813f sshd: fix leak on disconnect
Disconnect wants to keep a copy of the description string, but it is never
freed.  Make it ephemeral just for the ->disconnect_reason() op so it is
cleaned out correctly.
2021-11-07 07:04:09 +00:00
Andy Green
095798d5d9 sshd: plugin: work with _BUILTIN
The sshd example has gotten crufted a few different ways.

Adapt the test-sshd protocol and callbacks to not collide with the plugin
ssh-demo exports, for BUILTIN case.

Do not build a static copy of ssh-base for test-sshd if PLUGINS_BUILTIN is
going to provide it via lws import.

Add pvo for ssh-base to enable it on to the test-sshd vhost.

Banner staging in buf[] shared some of source and dest when it was copied
in, move it up a bit to avoid this.

Add note about rsa key disable workaround on Fedora.

test-sshd uses CGI (and requires it enabled to build) because it predates
lws_spawn... lws cgi was migrated to lws_spawn, really the test=sshd needs
rewriting to use lws_spawn directly instead of cgi.
2021-11-07 07:04:09 +00:00
Andy Green
7c9f1ca0a6 plugins: iterate builtin plugins as if loaded
For plugins that handle PROTOCOL_INIT, we have to iterate any PLUGINS_BUILTIN
plugins as if we had just discovered and loaded them from plugin files, so
they bind to vhosts appropriately.

Add some private helpers to keep the guts from duplication in plat.
2021-11-07 07:04:09 +00:00