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

3811 commits

Author SHA1 Message Date
casey
c2028b53d2 windows: null check wsi before udp check 2020-10-09 06:59:30 +01:00
casey
d945699791 windows: fix WSA event destruction
pt->events became an array
2020-10-09 06:59:20 +01:00
Andy Green
63a47081fb windows: WSA loop fixes 2020-10-09 06:59:08 +01:00
Andy Green
d1c84587bc freertos: have lwip choose the cancel pipe port
Rather than a magic port, let's have lwip pick the port for
the UDP cancel "pipe", so no chance of conflict.
2020-10-09 06:58:59 +01:00
Andy Green
2d4f1045d1 struct_json: adapt api test for 32-bit int on windows 2020-10-09 06:57:52 +01:00
Sylvain Rochet
7848e4cf1d contrib: cross-atmel: build-out FILE_OPS
Fix build failure against Atmel ASF3 SDK that does not provide a file
API conforming to POSIX.

libwebsockets/lib/core/libwebsockets.c: In function 'lws_open':
libwebsockets/lib/core/libwebsockets.c:187:18: error: 'O_CREAT' undeclared (first use in this function)
  if (((__oflag & O_CREAT) == O_CREAT)
                  ^~~~~~~
2020-10-06 20:33:23 +01:00
Andy Green
616d8e97ce h1: explicitly close when post txn completes
https://github.com/warmcat/libwebsockets/issues/2072
2020-10-06 14:31:07 +01:00
Andy Green
2976d4dbe8 cmake: remove fixed -g 2020-09-29 17:06:10 +01:00
Andy Green
1fdc242d98 ss: compiler may complain in release mode due to info 2020-09-29 17:06:10 +01:00
Andy Green
5f4ced47d8 sequencer: disable by default 2020-09-29 17:06:10 +01:00
Andy Green
ca3b94bb7d cmake: bump minimum version
Next release of cmake will choke by default if minimum version < 2.8.12
2020-09-29 17:06:10 +01:00
Andy Green
38b2730ad5 client: awaiting header is only a CCE for ws
In the case http client doesn't get a response and closes, currently
it is confused, it reports it as a CLIENT_CONNECTION_ERROR but then
also a CLOSED_CLIENT_HTTP.

Adapt the logic so we only go that way for ws connection... not getting
the server headers means not reaching ESTABLISHED, which makes it a
CCE not a CLOSE.

Also make sure we never issue a CLOSE type callback if we issued a CCE.
2020-09-29 17:06:10 +01:00
Jed Lu
64232ddc4c sspc: http map proxying fixes 2020-09-22 07:41:00 +01:00
Andy Green
82fe436fff sspc: allow 32-bit states 2020-09-21 12:47:45 +01:00
小明
7b2ef3b19e ios: adapt to MSG_NOSIGNAL available in iOS SDK 12+ 2020-09-20 19:30:36 +01:00
Andy Green
16963f0430 sspc: extend RXPRE_CONNSTATE to handle 8 or 32-bit states
Currently only the low 8 bits of an SS state are proxied in a total packet
length of 8 octets.  Keep that format and behaviour since all the defined
states fit in 8 bits, but also allow for 32-bit states using a packet length
of 11 octets with the same command.

This lets us proxy user states (from http mapping) which start at a user
base of 1000.
2020-09-20 07:09:41 +01:00
Andy Green
e69d2edaea h2: mark :protocol as an h2 psuedoheader 2020-09-19 16:29:23 +01:00
Andy Green
be1be1f342 testapp: extpoll: add back missing EXTERNAL_POLL pieces
EXTERNAL_POLL is not recommended for use for a while, it's a hack to allow
integration of lws with random application poll() loops.

While lws is very happy to do that secondary job for any event lib using the
foreign loop support (for uv, event, glib, and ev), for random roll-your-
own poll() waits there's no api because there's no event lib.  The solution
with a future is upgrade your application to use an event loop.

The test app that supports EXTERNAL_POLL was broken in Apr 2018, so it's
apparently good news nobody has been using it in new implementations
since then.  This patch adds in the missing pieces so we can test it until
it is formally deprecated.
2020-09-18 09:31:29 +01:00
Orgad Shaneh
2cf260a0a3 cmake: remove dead code
Since 425da070e3 LWS_PTHR_FLAGS is no longer
used, so just remove it.
2020-09-17 14:28:45 +01:00
Orgad Shaneh
3118c66590 cmake: mingw: fix build with default options
afunix.h doesn't exist on mingw.
2020-09-17 14:28:42 +01:00
Orgad Shaneh
ba721d7e2a cmake: mingw: fix openssl linkage
ws32 and friends must come after the openssl libs,
and pthread is required for openssl.
2020-09-17 14:28:39 +01:00
Orgad Shaneh
221acdde6a cmake: use -Wuninitialized only for GCC >= 4.4
It doesn't work with 4.3.3
2020-09-15 13:45:02 +01:00
Orgad Shaneh
8736a03e79 smd: fix strict-aliasing warning on gcc 4.4 2020-09-15 11:46:11 +01:00
Orgad Shaneh
442e148bb7 lws_dir: do not compare enums using the preprocessor
It is invalid on some platforms.

Fixes #2003
2020-09-15 11:30:00 +01:00
Orgad Shaneh
1f2da5cdd5 Subject: core-net: initialize some variables
Amends 286cf4357a.
2020-09-15 11:30:00 +01:00
Sakthi Kannan
fcc7429983 mbedtls: use lws helper for PEM DER import 2020-09-15 07:18:33 +01:00
Andy Green
0b884065cc event-libs: update README.md in the main dir for plugin capable flow 2020-09-14 16:13:54 +01:00
Orgad Shaneh
55c92237b6 unix plat: avoid strict aliasing complaint from a toolchain
The type of the fields in rtentry is sockaddr, and it is
casted to sockaddr_in. Size-wise it is ok, they should both
be the same size. But casting a pointer breaks build with
optimizations with the following error:

unix-sockets.c:434: error: dereferencing pointer 'addr' does break strict-aliasing rules

Amends commit 3c95483518.
2020-09-14 16:13:03 +01:00
Andy Green
39f21dc701 ss: server: make sure failures after adopt invalidate ss copy of wsi
For server, if the adoption of the incoming connection proceeds but then
fails early on, eg, tls alert due to hostname mismatch with cert, the
wsi close happens but it doesn't clean up the invalidated reference to
itself in the server ss object... if it became established, that's handled
by the ss protocol callback.

This patch helps the close path to understand there is a related ss object
and to clean up after itself.
2020-09-13 11:16:09 +01:00
Andy Green
04ddc644d9 ss: server: dont allow client request_tx path even if disconnected 2020-09-13 11:15:53 +01:00
Andy Green
9fc6716af4 libuv: fix pt derivation from ptpr in callbacks
The per-pt priv for event libs ended up overallocated at the context,
and pointed-to by a single pointer composed into each pt.  That means
we can't do pointer arithmetic on it any more.

Update a couple of stragglers in libuv event lib to use a pointer in
the pt-priv for the event lib back to the pt instead.

Also in foreign case if we start idle, there may not be anything
happening to trigger the initial idle.  So let each pt start with
its idle active.
2020-09-10 08:19:43 +01:00
Andy Green
11576a754f README.md: fix typo in release annouce 2020-09-06 15:54:33 +01:00
Andy Green
63e9699bda v4.1.0 2020-09-04 13:42:57 +01:00
Andy Green
936e1c71ce sspc: client: call CREATING on linkup to proxy
Before this we simply proxy the CREATING state from the proxy
version of the stream to the client version of the stream.

However this can result in disordering of onward connection
attempt request happening before the client has called back its
CREATING (*state()), meaning that any metadata set in the
state handler is missed for the onward connection.

This patch suppresses the CREATING forwarded from the proxy
and instead does its own local CREATING state callback at the
time the proxy indicates that the remote stream creation
(ie, with the requested policy streamtype) succeeded.

This then guarantees that the client has seen CREATING, and
had a chance to set metadata there, before the onward connection
request goes out.  Since metadata has higher priority at the
writeable than the onward connection request it also means
any metadata set in client CREATING gets sync'd to the proxy
before the onward connection.
2020-09-04 12:59:34 +01:00
Andy Green
008b355166 freertos: fixes for build on atmel xdk 2020-09-03 12:49:54 +01:00
SCRockz
ad7b17f437 cmake: qnx adaptations
https://github.com/warmcat/libwebsockets/issues/2034
2020-09-03 08:18:52 +01:00
Andy Green
186b2ce777 evlib-plugins: set MACOS_RPATH 2020-09-03 07:42:35 +01:00
Andy Green
86409e9f62 evlib plugins: revert to building in if no LWS_WITH_SHARED
https://github.com/warmcat/libwebsockets/issues/2033
2020-09-01 08:18:45 +01:00
Andy Green
c3dee88156 static build: lwsws 2020-09-01 08:10:06 +01:00
Andy Green
4ae3ef51c1 ss: improve callback return consistency
Formalize the LWSSSSRET_ enums into a type "lws_ss_state_return_t"
returned by the rx, tx and state callbacks, and some private helpers
lws_ss_backoff() and lws_ss_event_helper().

Remove LWSSSSRET_SS_HANDLE_DESTROYED concept... the two helpers that could
have destroyed the ss and returned that, now return LWSSSSRET_DESTROY_ME
to the caller to perform or pass up to their caller instead.

Handle helper returns in all the ss protocols and update the rx / tx
calls to have their returns from rx / tx / event helper and ss backoff
all handled by unified code.
2020-08-31 16:51:37 +01:00
Andy Green
e3e177a7d6 smp: add pt lock on client connect path 2020-08-31 16:51:37 +01:00
Andy Green
16e8fc2042 cmake: plugins: make sure about dl 2020-08-31 16:51:37 +01:00
Andy Green
095b76853e smp: lws_mutex_refcount: add assert held helper
also additional pt locks shown as needed by that
2020-08-31 16:51:37 +01:00
Andy Green
8235db7726 smp: additional vhost locks 2020-08-31 16:51:37 +01:00
Andy Green
b49a1460e9 smp: unable to check for fd reuse since another thread can accept it 2020-08-31 16:51:37 +01:00
Andy Green
1e0da366be sul: export schedule helpers as functions so easier to add pt lock 2020-08-31 16:51:37 +01:00
Orgad Shaneh
edb7d6ffc1 openssl: allow build with old glibc headers
strnlen requires _GNU_SOURCE prior to glibc 2.10.
2020-08-31 16:51:37 +01:00
Orgad Shaneh
0938607af8 cmake: gcc: allow build with GCC < 4.4
Prior to 4.4, -Wuninitialized could only be used with -O.
2020-08-31 16:51:37 +01:00
Andy Green
1d05f429dc lws_plugins 2020-08-31 16:51:37 +01:00
Andy Green
f53db84117 coverity: plugins fixes 2020-08-31 16:51:37 +01:00