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

4583 commits

Author SHA1 Message Date
Andy Green
7399f82959 spawn: CLOEXEC the wsi fds earlier 2020-04-19 06:15:26 +01:00
Andy Green
dacae3a951 osx: do not connect udp
Unlike linux or windows, blanket rejects sendto() afterwards with EISCONN
2020-04-17 12:39:53 +01:00
Andy Green
ef294c979f ntpclient: make retries less sparse 2020-04-17 12:39:53 +01:00
Andy Green
8299bd4191 windows: async dns find DNS server using modern api 2020-04-17 12:39:53 +01:00
Andy Green
a8ad5068e4 windows: fix service for udp and pending tls delays
UDP: call to recv() in there for unknown reasons was trashing udp

delays: pending tls (where data is buffered and no pending POLLIN)
was not reflected in forcing the wait to 0 properly.
2020-04-17 12:39:53 +01:00
Andy Green
e3c6d9d6c1 context creation: remove chance to create vhost twice 2020-04-17 12:39:53 +01:00
Andy Green
e4c59e3a91 osx: mbedtls: SYSCALL and errno 35 is WANT_READ 2020-04-17 12:39:53 +01:00
Andy Green
6e4eac2b80 http: client multipart: caulate remaining length correctly
The current position is understood to be in *p, but for the remaining length
calculation we are wrongly comparing to p...
2020-04-17 12:39:53 +01:00
Andy Green
d5cb0c6aa3 async-dns: cope with larger resolv.conf
Eg, systemd-resolved produces a huge comment at the start of its
default resolv.conf.  Buffer it into the pt_serv_buf to cope.
2020-04-17 12:39:53 +01:00
Andy Green
886a588963 lws_dir: XFS does not report directories via dirent
If it says it's unknown, we always need to fall back on to the stat method.
2020-04-16 11:18:40 +01:00
Andy Green
d339505f51 h2: cmake: build with NO_SERVER 2020-04-16 06:59:45 +01:00
Andy Green
a8eebc47a5 smp: helgrind and sai lock fixes 2020-04-15 20:57:56 +01:00
Andy Green
eca75ee14d http: pipelining: fixes from xenial sai 2020-04-15 20:35:13 +01:00
Andy Green
63c8a23776 lws_spawn: windows
Move the unix spawn.c from lib/misc through to lib/plat/unix, and
add an implementation for windows in lib/plat/windows
2020-04-13 19:29:09 +01:00
Andy Green
eb5a41eeb5 eventfd: restrict test to linux
Seems otherwise it gets confused on iOS
2020-04-13 19:29:09 +01:00
Octavia93
2d5a7d1430 alloc.c: add license header
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Is this file also licensed under MIT license, I don’t see a license header like the other files in this repo?
2020-04-13 16:16:26 +01:00
Andy Green
e3d780dac6 gencrypto: windows: warnings
Coming out of increasing number of build variants on windows via Sai
2020-04-12 08:39:27 +01:00
Andy Green
acc3e9ba13 lws_struct: sqlite3: avoid chown for windows 2020-04-11 16:55:54 +01:00
Andy Green
478ee963f1 async dns: test app: dont use exp as ambiguous 2020-04-11 16:49:13 +01:00
Andy Green
ff53a89db2 windows: async dns: fix typo 2020-04-10 17:49:19 +01:00
Andy Green
83c5bdc95f windows: msvc toolchain warnings to errors
This may cause some dust to start with since there are many
versions of msvc in use out there.
2020-04-09 05:39:04 +01:00
Andy Green
d7294a714e windows: import tronkko's dirent.h
Win32 compatible version of dirent.h microsoft just don't seem to be
able to include themselves.

MIT license, same as lws, link to original github project in the header
2020-04-08 11:26:53 +01:00
Andy Green
d3308df40f windows: pthreads
Add support for external pthreads lib on windows and some docs about how to do.

It can build with LWS_WITH_THREADPOOL and LWS_WITH_MINIMAL_EXAMPLES including the
pthreads-dependent ones without warnings or errors on windows platform as well with this.

pthreads_t can be anything, including a struct - not a pointer-to-a-struct
but the struct itself.  These can't be cast to a void * for printing as they can
on linux, where the base type is a pointer.

Let's fix all the usage of those to determine their own thread index in terms
of the meaning to the program rather than as a tid.
2020-04-07 14:05:21 +01:00
Andy Green
954fcf2bc3 windows: clean LWS_WITH_MINIMAL_EXAMPLES warnings
Fix pthreads detection in the minimal examples and add it where needed.
Fix unistd.h include to be conditional on not WIN32

With this, -DLWS_WITH_MINIMAL_EXAMPLES=1 is happy and warning-free
on windows.
2020-04-07 10:09:51 +01:00
Andy Green
1a8833dcfd windows: ipv6 compile fix
Via turtiain

https://github.com/warmcat/libwebsockets/issues/1880
2020-04-07 10:09:00 +01:00
Andy Green
2d55e18947 ss: windows build adaptations
Windows compiler finds various non-bug things to complain about when
building with SS and other options, fix them up
2020-04-06 20:25:06 +01:00
Jaco Kroon
33c9a6da4c vhost: Fix unused var warning with some SOCKS5
after 6bb116b8d8 the variable p could be
declared without being used.

https://bugs.gentoo.org/716386 refers.

This just fixes that.
2020-04-06 17:40:19 +01:00
Andy Green
66d1f34846 ss: avs test: disable rate limiting
Rate limiting does not work correctly with AVS server, the last
block of rx data is not coming.  Disable it for now so the
returned data comes as rapidly as the server can send and the
client receive.
2020-04-06 14:21:52 +01:00
Andy Green
5e99b9f3ee h2: take care to retain initial sid 2020-04-06 13:22:01 +01:00
Andy Green
8385cb427f sai.json
Add initial Sai CI config for build
2020-04-06 09:58:03 +01:00
Andy Green
370ba6f5ed lws_struct: handle empty char array serialization 2020-04-05 12:06:31 +01:00
Andy Green
fb3fd499e3 threadpool: allow multiple threadpool tasks to bind to same wsi 2020-04-04 10:47:11 +01:00
Andy Green
4caeb56bec vfork
There's a subtle difference between fork and vfork... when doing the
dup() before the exec, with cfork we are still dealing with the
parent process "possessed" by the forked process briefly inbetween
the vfork() and the exec().

That matters because when we close the duplicated fds for the stdxxx
pipes, with vfork we're closing the fd we still want to hold in the
parent process.
2020-04-01 05:56:45 +01:00
Andy Green
39b05e7db3 mbedtls: remove mbedtls_x509_crt_info reference
Nobody uses this from the wrapper... it brings in mbedtls_x509_crt_info()
even if you're using -ffunctionsections for a loss of about 1.7KB on Arm.


Let's chop it out...
2020-03-31 11:36:47 +01:00
Andy Green
a0a1c9c65f linkit: set cross base to use opt 2020-03-31 07:17:34 +01:00
Andy Green
d9f249f39f ss-document-support-for-unix-domain
Explain how to use unix domain connection with secure streams
2020-03-28 19:06:46 +00:00
Andy Green
e26f83bd83 ss: add support for raw-skt protocol 2020-03-28 16:20:50 +00:00
Andy Green
ee9ab7c1fc fanalyzer: workarounds and fixes
GCC -fanalyzer did find a real issue (unchecked malloc return)
but it mainly reported things that weren't true due to what
was happening outside of the particular compilation unit that
it could see.
2020-03-27 19:16:06 +00:00
Andy Green
e038332424 gcc: support -fanalyzer static analysis
Starting with gcc 10 (in fedora 32) there's a new static
analyzer built into gcc you can enable with -fanalyzer.  It
doesn't slow compilation much, but it's a bit hit and miss,
it only analyzes each compilation unit standalone so it
reports issues that can never happen.

Enable it if the option LWS_WITH_FANALYZER is enabled and
cmake can see the actual compiler supports it.
2020-03-27 18:35:23 +00:00
Andy Green
be32d0554e mbedtls: attempt to remove dependency on net_sockets.c
The mbedtls openssl wrapper wants to use exports from mbedtls' net_sockets.c,
but this is only supposed to work on *nix and windows.  Typically people
are using mbedtls on RTOS type platforms and to use it, net_sockets.c
needs some hacking.

Try to avoid that situation by porting the two exports we need into the
lws plat code and call from the wrapper.
2020-03-27 13:24:44 +00:00
Andy Green
2f6e0ed10b h1: handle LRS_FLUSHING_BEFORE_CLOSE at ops read
read has a tight leash on the states it's happy to turn up there,
it's good to be like that but it turns out LRS_FLUSHING_BEFORE_CLOSE
should be whitelisted since it can happen under some transient
conditions and is valid.

https://github.com/warmcat/libwebsockets/issues/1872
2020-03-26 18:07:48 +00:00
Andy Green
4cc7f4ed02 ss: add static policy as a build option
In some cases devices may be too constrained to handle JSON policies but still
want to use SS apis and methodology.

This introduces an off-by-default cmake option LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY,
if enabled the JSON parsing part is excluded and it's assumed the user code
provides its policy as hardcoded policy structs.
2020-03-26 06:48:34 +00:00
Andy Green
e783a6ca6e minimal: rediscover event loop lib paths
Building the examples may face the same situations as building lws with
the same dependencies, bring over the same CMakeLists.txt approach
2020-03-24 18:59:36 +00:00
Andy Green
9b637c17b9 glib: osx: brew symlink workaround 2020-03-24 12:31:02 +00:00
Andy Green
c261f5a90e spawn: on OSX only waitpid can get return code 2020-03-24 11:21:10 +00:00
Karl Rupp
6440521992 http server: Using default filename also for subdirectories.
If a user sets a default filename for a http mount (.def in lws_http_mount),
eg. 'default.html', then a GET request for '/' correctly forwards to
 '/default.html'.
However, without this commit the default filename is not taken into account for subdirectories. Thus,
 GET subdir/
will forward to
 'subdir/index.html'
instead of the expected
 'subdir/default.html'

This commit changes the behavior such that the user-provided default filename is also used for subdirectories.
2020-03-23 10:53:10 +00:00
Andy Green
f684daefda glibc: support older versions
Ubuntu Xenial's version lacks this helper define, add it if missing
so it can build
2020-03-21 15:20:41 +00:00
Andy Green
2a7a92f4d5 mbedtls: support old 2.2-era version from xenial 2020-03-21 14:43:53 +00:00
Akira Tsukamoto
47ea968e16 jws: lws_gencrypto_jws_alg_to_definition needs sentinel
Otherwise segfault when end of array reached.
2020-03-21 14:43:53 +00:00
Andy Green
6d5ebd237c threadpool: lack of task when getting status should be taken as FINISHED 2020-03-21 14:43:50 +00:00