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

2972 commits

Author SHA1 Message Date
Andy Green
d18e1db72c license: fix two old headers from pre-MIT change
These two headers managed to avoid the global switch from
LGPL2.1 -> MIT back in the day, correct them to be aligned
with the rest of lws' own license, ie, MIT.
2021-05-04 18:35:59 +01:00
Andy Green
39e89328b0 logs: prioritize WITH_NO_LOGS even in release
Really not having any logs makes it difficult to know what is really
happening, but if that's you're thing this will align debug and release
modes to just have ERR and USER if you give WITH_NO_LOGS
2021-03-16 08:20:03 +00:00
Andreas Weigel
9f517068b8 lws_struct: fix implicit schema recognition
actually use the index to iterate through the map of children to
not only match the first ever occurring entry
2021-03-01 19:55:15 +00:00
Andy Green
0cdfd750ef dbus: support adding disabled watchers
Dbus may add a watcher in a disabled state, don't action it if so
on the lws event loop.  It'll re-add if it wants it, confusingly.
2021-01-24 14:31:51 +00:00
Andy Green
d8c56ceb69 vhost_destroy: refactor 2021-01-22 16:22:25 +00:00
Jed Lu
c05ee8f4ae ss: http: make sure we dont duplicate leading path slash if already present 2021-01-22 16:21:32 +00:00
Andy Green
3e3a725a6b zip-fops: uncompressed length fix 2020-12-01 16:40:36 +00:00
Andy Green
bebf0ef023 zip-fops: example: correct zipfile serving path 2020-12-01 13:45:31 +00:00
Andy Green
b329ea89fe h2: fix ignoring unknown frame payloads 2020-12-01 13:45:27 +00:00
Andy Green
d1cbe7aa27 async-dns: fix error path 2020-11-30 12:53:30 +00:00
Andy Green
1594eb5c50 libuv: context creation fails via destroy
When using a foreign libuv loop, context creation may fail after adding
handles to the foreign loop... if so, it can no longer deal with the
fatal error by unpicking the created context and returning NULL... it
has to brazen it out with a half-baked context that has already started
the destroy flow and allow the foreign loop to close out the handles
the usual way for libuv.

https://github.com/warmcat/libwebsockets/issues/2129
2020-11-28 06:09:13 +00:00
Yichen Gu
3e69956357 sspc: double free + rx ret not checked
Change-Id: I81b67cbb28591a20842fc7d6e09b78375845aae4
2020-11-25 14:32:47 +00:00
Andy Green
d369a38fb1 logging: reduce serving logs 2020-11-25 07:42:09 +00:00
Andy Green
8e9495068e h2: ignore unknown frame types a bit earlier
Chrome has started being able to issue frame type 0x42, we drop the connection
before we realize we wanted to ignore it.

This explicitly ignores it a bit earlier.
2020-11-24 17:04:07 +00:00
Yucong Sun
43f94f4a8e mingw: libevent build fixes 2020-11-23 20:23:26 +00:00
Andy Green
a1335d672b osx: work around some big sur machines getting MAX_LONG ulimit -n 2020-11-17 16:02:54 +00:00
Yichen Gu
fc3c705c90 sspc: lws_sspc_handle_t pointer in wsi used after free 2020-11-12 19:55:10 +00:00
Yichen Gu
8e876be816 ss: h2: ACK/NACK missing in H2 state flow 2020-11-02 12:17:05 +00:00
Pino Toscano
f6868a5e03 context: properly check for sys/resource.h
Instead of hardcoding where sys/resource.h is available, check for it
using cmake.
2020-11-01 12:16:21 +00:00
Andy Green
109677df61 ss: policy: cast uint32 lwsl_err arg to unsigned int
Some toolchains typedef uint32_t to unsigned long
2020-10-29 19:53:57 +00:00
Andy Green
427b925d19 ss: fix without server 2020-10-29 19:53:41 +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
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
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
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
1fdc242d98 ss: compiler may complain in release mode due to info 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
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
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