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

3150 commits

Author SHA1 Message Date
Andy Green
c4c60fb95e minimal: update copies of test assets to CSP-compatible versions 2018-11-15 17:15:29 +08:00
Andy Green
b2b58b5b14 smp: lws_timed_callback_vh_protocol: request sets handler tsi and other fixes 2018-11-15 16:37:55 +08:00
Wei Zhang
8750582fc6 lws_hdr_total_length: match lws_hdr_copy actual length also for COOKIE 2018-11-15 16:37:53 +08:00
Andy Green
0a0b88174d minimal: minimal-ws-client-spam 2018-11-15 10:00:54 +08:00
Andy Green
129d080a8a service: if we got POLLIN service it before checking timeout 2018-11-14 20:04:14 +08:00
Andy Green
0647806f4c docs: release-policy README and pics 2018-11-14 08:57:29 +08:00
Andy Green
3fc4be005d hdr frag conacatenation already has separator for COOKIE 2018-11-14 06:42:35 +08:00
Andy Green
59837cdf06 coverity 192911/2: set NUL on access log after malloc fail check 2018-11-13 17:20:34 +08:00
Andy Green
7d9ff98263 logs: go back to ansi only on tty and add lwsl_emit_stderr_notimestamp 2018-11-13 17:03:33 +08:00
Andy Green
66b73c680c coverity 192910: check length in h2 header dump
Since the NUL was always taken care of at the end of buf, the worst it could
do was log some junk.  This makes it explicitly log it as oversize separately.
2018-11-13 16:53:41 +08:00
Andy Green
f6ae0edf8d strict host check vhost flag
https://github.com/warmcat/libwebsockets/issues/1423

If you vhost->options has the flag LWS_SERVER_OPTION_VHOST_UPG_STRICT_HOST_CHECK,
then if the server is sent an upgrade request, the content of the Host: header is
required to match the vhost name + port.  The port is set to the well-known values
of 80 and 443 if no :port on the host: value, depending on tls or not on the
connection.

minimal-ws-server can now take a -h flag to set this.  lejp-conf (eg, lwsws) can now take
a flag strict-host-check on the vhost to enable it as well.
2018-11-13 09:55:06 +08:00
Andy Green
97f9af5e3b tokenizer: flags for dot not delim and floats as strings 2018-11-13 09:34:10 +08:00
Andy Green
aa4143aebd lws_diskcache: split generic parts from gitohashi into lws 2018-11-12 15:24:42 +08:00
Rosen Penev
c5d6255487 tls: Fix compile without deprecated OpenSSL APIs
These headers are included implicitly with others when deprecated APIs are enabled.
2018-11-09 08:33:04 +08:00
Andy Green
47579b5306 gcc 8.2.0: ensure port always defined to something 2018-11-07 19:30:37 +08:00
Andy Green
79ea44704c server: check lws_hdr_copy return and cleanup 2018-11-07 17:02:09 +08:00
Andy Green
2312ee88fc fts: clear down the path stack with memset
https://github.com/warmcat/libwebsockets/issues/1445
2018-11-06 07:04:12 +08:00
Andy Green
175f2a2d18 tls pending: convert to lws_dll_lws
Also add a check for pending after accept, in case pending was aggregated.
2018-11-05 14:43:50 +08:00
Andy Green
f6e6818ca7 freebsd: clang requires -pthread
In the now default case that THREADPOOL is enabled... not sure what OSX
will make of that as previously it blew up with -pthread on clang cmdline
at link time
2018-11-05 10:25:36 +08:00
Andy Green
cbb8b1d3e9 LWS_WITH_ASAN
This lets you build using the runtime Address Sanitizer in gcc.

LWS is heavily tested with valgrind routinely during development.  But ASAN
did find some theoretical-only issues with shifting, strictly ~(1 << 31) is
a signed int, it should be ~(1u << 31).  Gcc does the same for both, but it's
good to have the ability to find these.
2018-11-03 14:47:48 +08:00
Andy Green
ae4b511d9a trie: fix up gcc 8.2.1 armv7 off_t vs jg2_file_offset
We really don't want to use off_t in the trie struct if we can avoid it since with
alignment it adds 16 bytes per trie-entry.  Cast around warnings.
2018-11-03 09:24:20 +08:00
Andy Green
45c788fecc docs: add ascii-art to lws_write description
https://github.com/warmcat/libwebsockets/issues/736
2018-11-03 09:15:36 +08:00
Andy Green
da59453302 minimal-ws-client-echo: add --ssl flag 2018-11-03 09:10:57 +08:00
Andy Green
27ae132e7b http: add callback to allow upgrade reject
https://github.com/warmcat/libwebsockets/issues/1415
2018-10-31 13:45:00 +08:00
dennisWind
984b7d3b53 Create cross-arm-android-gnueabi.cmake
add cross cmake config file
2018-10-31 13:44:57 +08:00
dennisWind
9d9c90bc5b Update android-make-script.sh
build libwebsockets for android ndk standalone toolchain,test in ndk-r17
2018-10-31 13:44:45 +08:00
Andy Green
ba612c3df6 http: return 415 instead of hang up if no mimetype for fileserve
Change the err log for this to info, since it makes clear what the problem is now at the client.
2018-10-31 13:44:45 +08:00
Andy Green
93d4e186c2 openssl tls1.3: allow setting ciphersuites at context creation time
https://github.com/warmcat/libwebsockets/issues/1440
2018-10-27 08:05:21 +08:00
Andy Green
1f1314160a lws_hdr_copy: ensure enough extra space
Audit all lws_hdr_copy() usages inside lws and make sure we
take care about it failing.

Also since the patch around aggregation of headers by ',',
lws_hdr_copy() needs a little more space in the output buffer,
adjust one place where that caused it to start failing in an
exact-sized buffer.
2018-10-26 16:14:30 +08:00
Andy Green
dbbcf43c18 tokenizer: use signed char where needed 2018-10-26 14:03:23 +08:00
pblemel
b45f224b2a client-echo: fix search-replace case problem
https://github.com/warmcat/libwebsockets/issues/1437
2018-10-26 14:03:23 +08:00
Andy Green
20fb55934b client vhost OpenSSL set and clear options
https://github.com/warmcat/libwebsockets/issues/1438
2018-10-26 13:55:36 +08:00
Andy Green
d3bc2c3f4f fulltext search 2018-10-26 13:53:28 +08:00
Andy Green
602b0934c8 fulltext search 2018-10-26 13:50:53 +08:00
Andy Green
38fe22e4db openssl: info log with cipher details and tls version 2018-10-20 07:54:58 +08:00
Andy Green
14764ccbe2 ws client: apply tokenize to upgrade header
Switches to use lws_hdr_copy() for the case the header is fragmented

See also https://github.com/warmcat/libwebsockets/issues/1435
2018-10-18 06:30:07 +08:00
Andy Green
a5b2248e72 lwsac
Introduce an api for efficiently dealing with allocations for
large, unknown amounts of objects.
2018-10-16 05:05:56 +08:00
Alexander Bruines
ed00704566 lws_serve_http_file: skip adding cache control if h1 other_headers do it 2018-10-16 05:05:54 +08:00
Andy Green
da444d04d1 lws_time_in_microseconds: export
Rename time_in_microseconds() and export the internal
api as lws_time_in_microseconds()
2018-10-14 06:15:36 +08:00
Andy Green
d702b83d10 uv: allocate watcher
Until now the uv watcher has been composed in the wsi.

This works fine except in the case of a client wsi that
meets a redirect when the event loop is libuv with its
requirement for handle close via the event loop.

We want to reuse the wsi, since the originator of it has
a copy of the wsi pointer, and we want to conceal the
redirect.  Since the redirect is commonly to a different
IP, we want to keep the wsi alive while closing its
socket cleanly.  That's not too difficult, unless you are
using uv.

With UV the comoposed watcher is a disaster, since after
the close is requested the wsi will start to reconnect.
We tried to deal with that by copying the uv handle and
freeing it when the handle close finalizes.  But it turns
out the handle is in a linked-list scheme in uv.

This patch hopefully finally solves it by giving the uv
handle its own allocation from the start.  When we want
to close the socket and reuse the wsi, we simply take
responsibility for freeing the handle and set the wsi
watcher pointer to NULL.
2018-10-13 12:43:13 +08:00
Andy Green
b5227df2d7 client proxy: offset query args 2018-10-13 12:43:13 +08:00
Andy Green
d03c57b87f quench logging 2018-10-13 08:16:27 +08:00
pblemel
e66937a5e7 mirror: flip check on get_urlarg_by_name
https://github.com/warmcat/libwebsockets/issues/1422
2018-10-13 08:16:27 +08:00
Andy Green
33a6034875 codacy: minor fixes 2018-10-13 08:16:27 +08:00
Andy Green
546a2800c7 bzero: improve detection of builtin 2018-10-13 08:16:27 +08:00
Andy Green
3696480b57 ws upgrade hs: require Host hdr 2018-10-13 08:16:27 +08:00
Andy Green
db827733c3 h1 ws client: produce CONNECTION 2018-10-13 08:16:27 +08:00
Andy Green
7b9e6c70f7 ws-upgrade-hs: check connection header
This header, and ws requirement, only exists on h1.
2018-10-13 08:16:27 +08:00
Andy Green
f0418c62bf lws_tokenize: convert ws protocol parsing 2018-10-13 08:16:27 +08:00
Andy Green
6cd80f9fc7 lws_tokenize 2018-10-13 08:16:27 +08:00