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

4703 commits

Author SHA1 Message Date
dcpng
609d0b82d8 windows: plugins uv fixes
https://github.com/warmcat/libwebsockets/issues/2617
2022-04-22 07:41:16 +01:00
Andy Green
01765df1ff gcc12: extend test-client buffer for dumb increment 2022-04-22 07:41:15 +01:00
Fabrice Fontaine
079726c4b2 tls: cmake: add wolfssl pkg-config support
Use pkg-config to search for wolfssl.pc which is available since version
3.3.3 and
a50af85e95

This will avoid setting manually LWS_WOLFSSL_{INCLUDE_DIRS,LIBRARIES}

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-04-22 07:41:11 +01:00
Andy Green
06229deb8c async_dns: protocols init: make sure we add vhost once 2022-04-13 20:13:47 +01:00
Fabrice Fontaine
a04aaad7f0 CMakeLists.txt: fix build without C++
Fix the following build failure without C++ raised since version 4.2.0
and
962e9ee345:

CMake Error at /nvmedata/autobuild/instance-11/output-1/per-package/libwebsockets/host/share/cmake-3.18/Modules/CMakeTestCXXCompiler.cmake:59 (message):
  The C++ compiler

    "/usr/bin/clang++"

  is not able to compile a simple test program.

Fixes:
 - http://autobuild.buildroot.org/results/550e7f7d54adf74f8cc078be5b91b3567d622ede

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-04-13 20:10:44 +01:00
Chunho Lee
584dcfae79 minimal: ss: policy2c: update MQTT fields 2022-04-11 09:31:14 +01:00
Chunho Lee
81e6c69481 ss: mqtt: add QOS_NACK_REMOTE state on PUBLISH failure
This adds setting QOS_NACK_REMOTE state when QoS 1/2 PUBLISH
transmissions and all retries are unacked and failed. Also this
allows state transitions between QOS_ACK_REMOTE and QOS_NACK_REMOTE.
2022-04-11 09:31:06 +01:00
Chunho Lee
49f505304e ss: mqtt: set the CONNECTED state after Birth
This sets the CONNECTED state after Birth topic is processed if
the stream has defined a Birth topic to avoid any confict when
the connection is not stable and the Birth is delayed.
2022-04-11 09:30:57 +01:00
Chunho Lee
4975000aa2 mqtt: fix wrong awsiot field set on SUBSCRIBE 2022-04-11 09:30:49 +01:00
Orefkov
6e3221cd1a h2: access log: POST: prepare log
https://github.com/warmcat/libwebsockets/issues/2608
2022-04-11 08:33:29 +01:00
Andy Green
615a08b216 threadpool: improve relationship with LWS_HAVE_PTHREAD_H
Make it clear in more places that threadpool is only built if pthreads
available.

https://github.com/warmcat/libwebsockets/issues/2607
2022-04-11 06:53:47 +01:00
orefkov
edf670a3e6 acme: update for v2
https://github.com/warmcat/libwebsockets/issues/2609

AG: api logging updates
2022-04-11 06:39:55 +01:00
Per Bothner
93aaaf371c docs: fix typo 2022-04-10 09:56:27 +01:00
Andy Green
f5ae2bc657 clean: remove public apis for removed functions
https://github.com/warmcat/libwebsockets/issues/2605
2022-04-10 06:56:12 +01:00
wayneonway
61880e15ff netlink: route handling checks for SRC when it means DST
https://github.com/warmcat/libwebsockets/issues/2603
2022-04-10 06:56:12 +01:00
Scott Rankin
9c5fc9f3e4 cmake: msvc: avoid having to use both preprocessor flags
https://github.com/warmcat/libwebsockets/issues/2600
2022-04-10 06:56:12 +01:00
Andy Green
b43866ffeb asyncdns: also consult system hosts file
We should also consult any system hosts file if available as part of the
async dns prep, same as we check for numeric IPs.
2022-04-10 06:56:12 +01:00
Andy Green
047fb7bb21 tokenize: enhance to support chunked parsing
Add EXPECT_MORE flag to indicate that running out of input is not (yet)
indicating the end of the document.  The caller should remove this flag
when it identifies that it does not have the chunk with the end of the
document: the last chunk may be zero length.

Track line numbers so the caller can infer CR, absorb CRLF -> CR.

Also add COLON_NONTERM needed for ipv6 literal addresses.
2022-04-10 06:56:12 +01:00
Felipe Gasper
76a5a9e2f2 client: connect report actual socket error to user callback rather than EINPROGRESS
https://github.com/warmcat/libwebsockets/pull/2452
2022-04-10 06:56:12 +01:00
Andy Green
6d88669b69 logs: use finegrained level test on unix-sockets.c 2022-04-10 06:56:12 +01:00
apcui
730c954b42 windows: avoid NULL addr on connect check
https://github.com/warmcat/libwebsockets/issues/2596
2022-04-10 06:56:12 +01:00
Andy Green
76d8840c5f coverity: fixes 2022-04-10 06:56:12 +01:00
Andy Green
b0041b32e6 raw: tls conns
Raw + tls needs a little extra handling during connect.
2022-04-10 06:56:12 +01:00
Andy Green
a54480ba93 lws_display: SSD1675B 2022-04-10 06:56:12 +01:00
Andy Green
c7ebe639be lws-display: UC8176 EPD driver 2022-04-10 06:56:02 +01:00
Andy Green
9b47b768f4 lws_display: SPD1656 driver
Add SPD1656 SPI driver as used in 5.65 inch 7-colour waveshare panel.
2022-03-25 08:18:30 +00:00
Andy Green
d6c4e606e7 ssd1306: adapt blit for DMA 2022-03-25 08:18:30 +00:00
Andy Green
019da2e539 ili9341: adapt blit for DMA
This is the SPI client chip in the LCD displays on ESP32 WROVER-KIT and S2
Kaluga.

Adapt it to allocate using DMA-able allocators and to use the new blit op
conventions for update sequencing
2022-03-25 08:18:30 +00:00
Andy Green
e3743d47b4 lws_spi: Add esp32 DMA support
This provides an alternative esp32-specific SPI driver with ops that can be
swapped in place of the gpio bitbang one.

The pinmux info and lws gpio driver and other data in the spi bitbang
struct are used as-is by the DMA one.

New ops are provided which are able to allocate and free DMA-able memory so
the device drivers can prepare directly usable buffers.  Bounce through to
DMA-able buffers is also transparently supported.
2022-03-25 08:18:30 +00:00
Andy Green
7db51f4096 esp32s2: wifi and pwm
s2 ROM needs an explicit set_mode() as tested on Kaluga
Adapt PWM but unable to test as Kaluga has a smart RGB LED unlike Wrover
Kit
2022-03-25 08:18:30 +00:00
Andy Green
fcbc0dafa4 lws_ota 2022-03-25 08:18:30 +00:00
Andy Green
7847377750 sul: add clear advice for zombie suls 2022-03-25 08:18:30 +00:00
Andy Green
2355b30fe4 h1: remove assert on unexpected POLLIN state just hangup 2022-03-25 08:18:30 +00:00
Max Lehn
908501afdf cmake: fix FindOpenSSLbins error when no OpenSSL executable found
This fixes CMake error "mode MATCH needs at least 5 arguments total to
command" while configuring when no OpenSSL executable was found.
Tested under Windows using VS2019.
2022-03-25 08:18:30 +00:00
Andy Green
24fdd1f225 base64: improve sanity checking
Improve rejection of invalid chars
2022-03-25 08:18:30 +00:00
Andy Green
432bbf1d97 logs: freertos adds free heap to all logs 2022-03-25 08:18:29 +00:00
Andy Green
aea45fb246 ss: metrics: clean any unused metrics tags on ss destroy 2022-03-25 08:18:29 +00:00
Andy Green
6a65d76779 hex-to-bin: api with input length 2022-03-25 08:18:29 +00:00
Andy Green
518e6c7cc0 examples: install useful examples 2022-03-25 08:18:29 +00:00
Andy Green
497e25df83 ss: http: facilitate back-to-back transactions
We need to insert a CONNECTING state if we're going again.
2022-03-25 08:18:29 +00:00
Andy Green
f8132e23dc nsc: fall back to internal headers when no stash 2022-03-25 08:18:29 +00:00
Andy Green
c11e31547f ss: introduce sinks 2022-03-25 08:18:29 +00:00
Andy Green
c24148826b coverity: change ss handle priv style
Coverity is able to misunderstand &h[1] to be a dereference
of h, when it is just (h + 1).

Adapt places where we use this style to get a pointer to the
SS priv data to use (h + 1).
2022-03-25 08:18:29 +00:00
Andy Green
a3a4253ba9 dlo: lws_dlo_fops file_ops
This adds an optional lws VFS layer that exposes the named dlo object
registry.  So you can register a blob like a JPG named "my.jpg", and
access it on the vfs as, eg,  /dlofs/my.jpg (or file:///dlofs/my.jpg
if using the SS file:// support for VFS namespace).
2022-03-25 08:18:29 +00:00
Andy Green
e3dca87f23 lws_display: add display list / DLO support
This adds optional display list support to lws_display, using DLOs (Display
List Objects).  DLOs for rectangle / rounded rectangle (with circle as the
degenerate case), PNGs, JPEG and compressed, antialiased bitmapped fonts
and text primitives are provided.

Logical DLOs are instantiated on heap and listed into an lws_display_list
owner, DLOs handle attributes like position, bounding box, colour +
opacity, and local error diffusion backing buffer.

When the display list is complete, it can be rasterized a line at a time,
with scoped error diffusion resolved, such that no allocation for the
framebuffer is required at any point.  DLOs are freed as the rasterization
moves beyond their bounding box.

Adds a platform registry binding names and other metadata to lws_display
fonts / PNGs / JPEGs.  Provides registration, destruction and best match
selection apis.
2022-03-25 08:18:29 +00:00
Andy Green
aa696773f0 lws_display: improve apis to use display_state and frac
Adapt disp ops to use lws_display_state_t instead of the const disp object.

Describe display area in pixels and mm using lws_fixed3232.
2022-03-25 08:13:48 +00:00
Andy Green
1d3ec6a3a1 lws-jpeg
Introduce a rewritten picojpeg that is able to operate statefully and
rasterize into an internal line ringbuffer, emitting a line of pixels
at a time to the caller.  This is the JPEG equivalent of the lws
PNG decoder.

JPEG is based around 8- or 16- line height MCU blocks, depending on
the chroma coding, mandating a corresponding internal line buffer
requirement.

Example total heap requirement for various kinds of 600px width jpeg
decoding:

  Grayscale:    6.5KB
  RGB 4:4:4:   16.4KB
  RGB 4:2:2v:  16.4KB
  RGB 4:4:2h:  31KB
  RGB 4:4:0:   31KB

No other allocations occur during decode.

Stateful stream parsing means decode can be paused for lack of input
at any time and resumed seamlessly when more input becomes available.
2022-03-25 08:13:48 +00:00
Andy Green
a74fe5d760 upng: split out gzip
The adapted upng has a very compact fully-stateful lws-aligned
implementation already.

Adapt it to also be buildable and operable standalone, and to
understand gzip headers.

Provide some apis to inflate gzip simply reusing opaque inflator
contexts from upng.

Provide an api test that inflates gzip files from stdin -> stdout
2022-03-25 08:13:48 +00:00
Andy Green
48907fca0a upng: rewrite for stateful stream decode
Add a rewritten version of upng that decodes statefully line by line, and so
does not require a bitmap buffer for the output.  This compares to original
upng approach that needs heap allocations for the input, the whole output
and intermediate allocations.

Instead of buffers for input, decompression and output, it only allocates
2 x lines of RGBA pixels (ie, a few KB), and 32KB of decompressed data for
backward references in the decoder, and decodes as needed into the 2-line
buffer to produce line rasterized results.  For a 600px width PNG, this is
just 40KB heap for the duration.
2022-03-16 12:59:48 +00:00
Andy Green
aadcd3c44a lws_fx: fixed point 3232 arithmetic
This introduces a fixed precision signed 32.32 fractional type that can
work on devices without an FPU.

The integer part works as an int32_t, the fractional part represents the
fractional proportion expressed as part of 100M, so 8 fractional decimal
digit precision which is more than enough for many applications.

Add and Sub are reasonably fast as they are scaled on to a combined
uint64_t, Multiply is a little slower as it takes four uint64_t multiplies
that are summed, and divide is expensive but accurate, done bitwise taking
up to 32 iterations involving uint64_t div and mod.
2022-03-15 10:28:09 +00:00