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

3777 commits

Author SHA1 Message Date
Andy Green
df0055ad0d plugins: more explicit header inclusion
32-bit Debian doesn't have these included by other includes
already and needs them explicitly.
2020-10-26 11:30:51 +00:00
Andy Green
2eab1e3ea5 sai: plugins 2020-10-26 11:30:41 +00:00
Andy Green
f50003b7b5 sai: debian 2020-10-26 10:31:34 +00:00
bbqz007
02f8c01fed libevent: fix typo in signal handler
https://github.com/warmcat/libwebsockets/issues/2095
2020-10-17 12:55:46 +01:00
krismattheus
513b6834ca cmake: add windows version resources to library
Signed-off-by: krismattheus <kris.mattheus@visionbms.com>
2020-10-17 12:29:57 +01:00
Andy Green
ce1e4550c2 ss: update client state lifecycle with destroy api note 2020-10-15 10:48:28 +01:00
Mykola Stryebkov
dbc3acd5eb minimal: smp + foreign: libuv foreign loops
AG: various fixes and adaptation of test protocol to use ring lock
to protect global wsi list against modifications from other threads
while in use
2020-10-11 13:09:14 +01:00
Andy Green
4f0545cc54 smp: additional locking for libuv
With SMP + event lib, extra locking is required when dealing with cross-thread
adoption case, and cross-vhost cases like wsi close, we need to hold the pt or
context lock.

These lock apis are NOPs when LWS_MAX_SMP == 1 which is the default.
2020-10-11 13:04:52 +01:00
Andy Green
c7c2db871d smp: lws_wsi_tsi
This lets you find out the SMP Thread Service Index (tsi) that a wsi
is bound to.  This allows you to, eg, filter a global wsi list so
you can find the ones that exist in your service thread context.
2020-10-11 13:04:29 +01:00
Andy Green
398a2cd46c smp: set tsi in fakewsi used with WAIT_CANCELLED
Together with the new lws_wsi_tsi(wsi) this lets the WAIT_CANCELLED
callback understand its tsi context, the broadcasts are done for each
pt / loop.
2020-10-11 13:04:06 +01:00
Andy Green
9df59987ae evlib: export LWS_MAX_SMP locking for evlib plugin case with SMP
Now we're also looking at SMP + event lib, SMP locking pieces are
going to be needed for import into the event lib plugins if built
as plugins.
2020-10-11 13:03:55 +01:00
casey
c50100cb46 fix zombie sul detection
The cmake define isn't exported, and msvc objects to void * comparision to
non void *.

Also dump the callback pointer with any errors, since after looking it up
in your mapfile this is usually enough to understand which sul and when it
was set.
2020-10-10 06:48:24 +01:00
Andy Green
03a8fff42a close: ensure any pending sul_connect_timeout cancelled 2020-10-09 21:33:13 +01:00
Andy Green
9b94c53431 plugins: use new export symbol convention 2020-10-09 21:32:59 +01:00
Andy Green
524e680c8b cgi: support evlib_wsi in stdwsi 2020-10-09 21:32:47 +01:00
Andy Green
aacfe77ad7 ws: reporting PONG with pmd enabled
Add a return code NOTHING_WE_SHOULD_DO indicating that the
extension determined by ext-specific means its operation was
disabled on this frame.

https://github.com/warmcat/libwebsockets/issues/2076
2020-10-09 06:59:43 +01:00
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