Skip to content

Commit 9f3da05

Browse files
committed
fixes
Various things that Sai identified needed fixing
1 parent 15fb711 commit 9f3da05

File tree

28 files changed

+320
-156
lines changed

28 files changed

+320
-156
lines changed

.sai.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@
155155
"lws_system": {
156156
"cmake": "-DLWS_SUPPRESS_DEPRECATED_API_WARNINGS=1 -DLWS_WITH_ACME=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DCMAKE_BUILD_TYPE=RELEASE -DLWS_WITH_GENCRYPTO=1 -DLWS_WITH_JOSE=1 -DLWS_WITH_SYS_ASYNC_DNS=1 -DLWS_WITH_SYS_NTPCLIENT=1"
157157
},
158+
"async_dnssec": {
159+
"cmake": "-DLWS_SUPPRESS_DEPRECATED_API_WARNINGS=1 -DCMAKE_BUILD_TYPE=DEBUG -DLWS_WITH_GENCRYPTO=1 -DLWS_WITH_JOSE=1 -DLWS_WITH_SYS_ASYNC_DNS=1 -DLWS_WITH_SYS_ASYNC_DNS_DNSSEC=1"
160+
},
161+
158162
"secure-streams": {
159163
"cmake": "-DLWS_WITH_SECURE_STREAMS=1 -DLWS_WITH_MINIMAL_EXAMPLES=1",
160164
"platforms": "w11/x86_64-amd/msvc,netbsd/aarch64BE-bcm2837-a53/gcc"
@@ -254,18 +258,19 @@
254258
# only applies to the coverity builder, and on pushes to "coverity" branch
255259

256260
"coverity": {
257-
"cmake": "-DLWS_WITHOUT_EXTENSIONS=0 -DLWS_WITH_CGI=1 -DLWS_IPV6=1 -DLWS_WITH_HTTP_PROXY=1 -DLWS_WITH_RANGES=1 -DLWS_WITH_THREADPOOL=1 -DLWS_WITH_CBOR=1 -DLWS_WITH_JOSE=1 -DLWS_WITH_COSE=1 -DLWS_WITH_SYS_DHCP_CLIENT=1 -DLWS_WITH_FTS=1 -DLWS_WITH_STRUCT_SQLITE3=1 -DLWS_ROLE_DBUS=1 -DLWS_WITH_SYS_ASYNC_DNS=1 -DLWS_WITH_SYS_FAULT_INJECTION=1 -DLWS_WITH_TLS_JIT_TRUST=1 -DLWS_ROLE_MQTT=1 -DLWS_ROLE_RAW_PROXY=1 -DLWS_WITH_EVENT_LIBS=1 -DLWS_WITH_LIBUV=1 -DLWS_WITH_STRUCT_JSON=1 -DLWS_WITH_LWS_DSH=1 -DLWS_WITH_SECURE_STREAMS_PROXY_API=1",
258-
"platforms": "none, coverity/x86_64/gcc",
259-
"cpack": "export STAMP=`git log -1 --pretty=format:%h` && rm -f libwebsockets.tgz && tar czvf libwebsockets.tgz cov-int && script -q -c \"cat /etc/coverity/secrets.sh | lws-minimal-http-client-post-form https://scan.coverity.com:443/builds?project=warmcat%2Flibwebsockets --form file=@libwebsockets.tgz --form version=${STAMP} --form 'description=lws qa'\" /dev/null",
260-
"branches": "coverity"
261-
},
262-
# awkward, we also want to test mbedtls, but coverity blocks on SSL build needing manual intervention
263-
"coverity-mbedtls": {
264-
"cmake": "-DLWS_WITH_MBEDTLS=1 -DLWS_WITHOUT_EXTENSIONS=0 -DLWS_WITH_CGI=1 -DLWS_IPV6=1 -DLWS_WITH_HTTP_PROXY=1 -DLWS_WITH_RANGES=1 -DLWS_WITH_THREADPOOL=1 -DLWS_WITH_CBOR=1 -DLWS_WITH_JOSE=1 -DLWS_WITH_COSE=1 -DLWS_WITH_SYS_DHCP_CLIENT=1 -DLWS_WITH_FTS=1 -DLWS_WITH_STRUCT_SQLITE3=1 -DLWS_ROLE_DBUS=1 -DLWS_WITH_SYS_ASYNC_DNS=1 -DLWS_WITH_SYS_FAULT_INJECTION=1 -DLWS_WITH_TLS_JIT_TRUST=1 -DLWS_ROLE_MQTT=1 -DLWS_ROLE_RAW_PROXY=1 -DLWS_WITH_EVENT_LIBS=1 -DLWS_WITH_LIBUV=1 -DLWS_WITH_STRUCT_JSON=1 -DLWS_WITH_LWS_DSH=1 -DLWS_WITH_SECURE_STREAMS_PROXY_API=1",
261+
"cmake": "-DLWS_WITHOUT_EXTENSIONS=0 -DLWS_WITH_CGI=1 -DLWS_IPV6=1 -DLWS_WITH_HTTP_PROXY=1 -DLWS_WITH_RANGES=1 -DLWS_WITH_THREADPOOL=1 -DLWS_WITH_CBOR=1 -DLWS_WITH_JOSE=1 -DLWS_WITH_COSE=1 -DLWS_WITH_SYS_DHCP_CLIENT=1 -DLWS_WITH_FTS=1 -DLWS_WITH_STRUCT_SQLITE3=1 -DLWS_ROLE_DBUS=1 -DLWS_WITH_SYS_ASYNC_DNS=1 -DLWS_WITH_SYS_ASYNC_DNS_DNSSEC=1 -DLWS_WITH_WEBRTC=1 -DLWS_WITH_DHT=1 -DLWS_WITH_ASYNC_QUEUE=1 -DLWS_WITH_SYS_FAULT_INJECTION=1 -DLWS_WITH_TLS_JIT_TRUST=1 -DLWS_ROLE_MQTT=1 -DLWS_ROLE_RAW_PROXY=1 -DLWS_WITH_EVENT_LIBS=1 -DLWS_WITH_LIBUV=1 -DLWS_WITH_STRUCT_JSON=1 -DLWS_WITH_LWS_DSH=1 -DLWS_WITH_SECURE_STREAMS_PROXY_API=1",
265262
"platforms": "none, coverity/x86_64/gcc",
266263
"cpack": "export STAMP=`git log -1 --pretty=format:%h` && rm -f libwebsockets.tgz && tar czvf libwebsockets.tgz cov-int && script -q -c \"cat /etc/coverity/secrets.sh | lws-minimal-http-client-post-form https://scan.coverity.com:443/builds?project=warmcat%2Flibwebsockets --form file=@libwebsockets.tgz --form version=${STAMP} --form 'description=lws qa'\" /dev/null",
267264
"branches": "coverity"
268265
}
266+
# ,
267+
# awkward, we also want to test mbedtls, but coverity blocks on SSL build needing manual intervention
268+
# "coverity-mbedtls": {
269+
# "cmake": "-DLWS_WITH_MBEDTLS=1 -DLWS_WITHOUT_EXTENSIONS=0 -DLWS_WITH_CGI=1 -DLWS_IPV6=1 -DLWS_WITH_HTTP_PROXY=1 -DLWS_WITH_RANGES=1 -DLWS_WITH_THREADPOOL=1 -DLWS_WITH_CBOR=1 -DLWS_WITH_JOSE=1 -DLWS_WITH_COSE=1 -DLWS_WITH_SYS_DHCP_CLIENT=1 -DLWS_WITH_FTS=1 -DLWS_WITH_STRUCT_SQLITE3=1 -DLWS_ROLE_DBUS=1 -DLWS_WITH_SYS_ASYNC_DNS=1 -DLWS_WITH_SYS_ASYNC_DNS_DNSSEC=1 -DLWS_WITH_WEBRTC=1 -DLWS_WITH_DHT=1 -DLWS_WITH_ASYNC_QUEUE=1 -DLWS_WITH_SYS_FAULT_INJECTION=1 -DLWS_WITH_TLS_JIT_TRUST=1 -DLWS_ROLE_MQTT=1 -DLWS_ROLE_RAW_PROXY=1 -DLWS_WITH_EVENT_LIBS=1 -DLWS_WITH_LIBUV=1 -DLWS_WITH_STRUCT_JSON=1 -DLWS_WITH_LWS_DSH=1 -DLWS_WITH_SECURE_STREAMS_PROXY_API=1",
270+
# "platforms": "none, coverity/x86_64/gcc",
271+
# "cpack": "export STAMP=`git log -1 --pretty=format:%h` && rm -f libwebsockets.tgz && tar czvf libwebsockets.tgz cov-int && script -q -c \"cat /etc/coverity/secrets.sh | lws-minimal-http-client-post-form https://scan.coverity.com:443/builds?project=warmcat%2Flibwebsockets --form file=@libwebsockets.tgz --form version=${STAMP} --form 'description=lws qa'\" /dev/null",
272+
# "branches": "coverity"
273+
# }
269274

270275
}
271276
}

changelog

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,49 @@
11
Changelog
22
---------
33

4+
Development
5+
===========
6+
7+
- Async DNS: support DNSSEC
8+
- Async DNS: support tcp fallback
9+
- Support authoritative DNS server, like nsd, using own-signed zone files
10+
- Support authoritative DNS signing (zone file -> DNSSEC ready signed zone
11+
file)
12+
- LWS_WITH_ASYNC_QUEUE: Makes slow tls negotiation and read / write happen
13+
via a queue + worker threads, instead of on the main event loop. This
14+
reduces the amount of blocking events delaying the event loop
15+
- LWS_WITH_LATENCY: support detailed event loop blocking measurements and a
16+
plugin to monitor event loop performace dynamically; lists worst blockers by
17+
protocol and actual delays
18+
- Support a headless camera participant to WebRTC conference
19+
- Support WebRTC conferencing serving / mixing over h.264 up to 1080p
20+
(and if supported in hw, AV1)
21+
- TLS: Support DTLS accross all the libraries
22+
- LWS_WITH_MNEMONIC support for mnemonic key backup
23+
- CRC32 is now provided
24+
- Generic HMAC now supports SHA-1
25+
- vhost: protocols from plugins are instantiated first, and protocols now
26+
have a priority field to control who gets instantiated before who
27+
additionally. This simplifies basing on plugin protocols.
28+
- lws_mutex is now public, platform-independent defines
29+
- Client: improve connect retries by iterating through DNS results
30+
- Contributors: AI isn't necessarily a problem, but we want to know which AI
31+
- ipv6: now built by default
32+
- TLS: LWS_WITH_GNUTLS: Support building against GnuTLS for tls + gencrypto
33+
- LWS_WITH_DHT: generic Kademlia DHT with pluggable additional verbs and lws
34+
UDP integratin
35+
- lws_captcha_ratelimit plugin can force generic captcha by introducing
36+
multiple mount order on same mounpoint, supports whitelisting netblocks
37+
- Context creation: Sumarize OpenSSL library version available if in use
38+
- JWS: support LWS_JOSE_ENCTYPE_NONE
39+
- TLS: LWS_WITH_SCHANNEL: Support building against Schannel, the windows
40+
native tls library for tls and gencrypto
41+
- SS: Support urlargs on server side
42+
- lhp: various improvements (still not very usable)
43+
444
v4.5.0
545
======
6-
46+
747
- fixes from coverity and Nozomi Networks
848
- fix for mountpoint headers being sticky for all following mounts too
949
- b64 apis: fixes and new api tests

include/libwebsockets.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ typedef int suseconds_t;
175175
#include <unistd.h>
176176

177177
#if defined (LWS_PLAT_FREERTOS)
178+
#if defined(LWS_AMAZON_RTOS)
179+
#include <FreeRTOS.h>
180+
#include <semphr.h>
181+
#include <task.h>
182+
#else
183+
#include <freertos/FreeRTOS.h>
184+
#include <freertos/semphr.h>
185+
#include <freertos/task.h>
186+
#endif
187+
178188
typedef SemaphoreHandle_t lws_mutex_t;
179189
#define lws_mutex_init(x) x = xSemaphoreCreateMutex()
180190
#define lws_mutex_destroy(x) vSemaphoreDelete(x)

include/libwebsockets/lws-dht.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <stddef.h>
2929
#include <stdint.h>
3030
#include <stdio.h>
31+
#include <libwebsockets/lws-genhash.h>
3132

3233
/*! \defgroup dht Distributed Hash Table
3334
* ## Distributed Hash Table (DHT) API

lib/core-net/close.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,6 @@ lws_addrinfo_clean(struct lws *wsi)
358358
static void
359359
lws_async_worker_wait_and_reap(struct lws *wsi)
360360
{
361-
if (!wsi->async_worker_job)
362-
return;
363-
364361
while (1) {
365362
pthread_mutex_lock(&wsi->a.context->async_worker_mutex);
366363
if (!wsi->async_worker_job) {
@@ -654,15 +651,6 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason,
654651
if (wsi->http.buflist_post_body)
655652
lws_buflist_destroy_all_segments(&wsi->http.buflist_post_body);
656653
#endif
657-
#if defined(LWS_WITH_UDP)
658-
if (wsi->udp) {
659-
/* confirm no sul left scheduled in wsi->udp itself */
660-
lws_sul_debug_zombies(wsi->a.context, wsi->udp,
661-
sizeof(*wsi->udp), "close udp wsi");
662-
663-
lws_free_set_NULL(wsi->udp);
664-
}
665-
#endif
666654

667655
if (lws_rops_fidx(wsi->role_ops, LWS_ROPS_close_kill_connection))
668656
lws_rops_func_fidx(wsi->role_ops,

lib/core-net/service.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,6 @@ _lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd,
867867
}
868868

869869
wsi->could_have_pending = 0; /* clear back-to-back write detection */
870-
pt->inside_lws_service = 1;
871870

872871
/* okay, what we came here to do... */
873872

@@ -884,7 +883,6 @@ _lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd,
884883
switch (lws_rops_func_fidx(wsi->role_ops, LWS_ROPS_handle_POLLIN).
885884
handle_POLLIN(pt, wsi, pollfd)) {
886885
case LWS_HPI_RET_WSI_ALREADY_DIED:
887-
pt->inside_lws_service = 0;
888886
#if defined (_WIN32)
889887
break;
890888
#else
@@ -915,7 +913,6 @@ _lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd,
915913
* we can't clear revents now because it'd be the wrong guy's
916914
* revents
917915
*/
918-
pt->inside_lws_service = 0;
919916
return 1;
920917
default:
921918
assert(0);
@@ -945,8 +942,6 @@ _lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd,
945942
lws_latency_note(pt, _role_out_start, 2000, "pollout:%dms", ms);
946943
}
947944
#endif
948-
pt->inside_lws_service = 0;
949-
950945
return 0;
951946
}
952947

@@ -976,7 +971,9 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd,
976971
lws_latency_cb_start(pt);
977972
#endif
978973

974+
pt->inside_lws_service = 1;
979975
ret = _lws_service_fd_tsi(context, pollfd, tsi);
976+
pt->inside_lws_service = 0;
980977

981978
#if defined(LWS_WITH_LATENCY)
982979
lws_latency_cb_end(pt, pn);

lib/core/adapt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ lws_adapt_report(struct lws_adapt *a, int success, lws_usec_t us)
146146
if (l->ewma_short < LWS_ADAPT_DOWNGRADE_THRESHOLD && a->active_level < a->num_levels - 1) {
147147
lwsl_notice("%s: Downgrading level %d -> %d (Score: %u/%u)\n",
148148
__func__, a->active_level, a->active_level + 1,
149-
l->ewma_short, LWS_ADAPT_MAX_SCORE);
149+
(unsigned int)l->ewma_short, (unsigned int)LWS_ADAPT_MAX_SCORE);
150150

151151
a->active_level++;
152152
a->last_downgrade_us = us;
@@ -167,7 +167,7 @@ lws_adapt_report(struct lws_adapt *a, int success, lws_usec_t us)
167167
if (a->backoff_multiplier < 1)
168168
a->backoff_multiplier = 1;
169169
a->last_downgrade_us = us; /* Reset the clock for the next forgiveness tier */
170-
lwsl_notice("%s: Sustained stability! Reducing backoff multiplier to %u\n", __func__, a->backoff_multiplier);
170+
lwsl_notice("%s: Sustained stability! Reducing backoff multiplier to %u\n", __func__, (unsigned int)a->backoff_multiplier);
171171
}
172172
}
173173
}
@@ -192,7 +192,7 @@ lws_adapt_get_level(struct lws_adapt *a)
192192
if (now > a->last_downgrade_us + backoff_required) {
193193
lwsl_notice("%s: Upgrading level %d -> %d (Stable for %u us)\n",
194194
__func__, a->active_level, a->active_level - 1,
195-
(uint32_t)(now - a->last_downgrade_us));
195+
(unsigned int)(now - a->last_downgrade_us));
196196

197197
a->active_level--;
198198
a->last_downgrade_us = now; /* So we measure forgiveness from the moment of success */

0 commit comments

Comments
 (0)