From: Thomas Devoogdt <thomas@devoogdt.com>
To: buildroot@buildroot.org
Cc: Thomas Devoogdt <thomas.devoogdt@barco.com>,
Bart Van Severen <bart.vanseveren@barco.com>
Subject: [Buildroot] [PATCH v1 1/2] package/libwebsockets: add an option to enable lws async dns
Date: Fri, 20 Sep 2024 08:20:13 +0200 [thread overview]
Message-ID: <20240920062014.132862-1-thomas@devoogdt.com> (raw)
From: Bart Van Severen <bart.vanseveren@barco.com>
Lws now features optional asynchronous, ie, nonblocking recursive DNS
resolution done on the event loop, enable `-DLWS_WITH_SYS_ASYNC_DNS=1`
at cmake to build it in.
The default libc name resolution is via libc `getaddrinfo()`, which is
blocking, possibly for quite long periods (seconds). If you are
taking care about latency, but want to create outgoing connections,
you can't tolerate this exception from the rule that everything in
lws is nonblocking.
Lws' asynchronous DNS resolver creates a caching name resolver
that directly queries the configured nameserver itself over UDP,
from the event loop.
https://libwebsockets.org/lws-api-doc-main/html/md_READMEs_2README_8async-dns.html
Signed-off-by: Bart Van Severen <bart.vanseveren@barco.com>
Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
---
package/libwebsockets/Config.in | 6 ++++++
package/libwebsockets/libwebsockets.mk | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/package/libwebsockets/Config.in b/package/libwebsockets/Config.in
index 05c132641e..6116cfecb5 100644
--- a/package/libwebsockets/Config.in
+++ b/package/libwebsockets/Config.in
@@ -19,6 +19,12 @@ config BR2_PACKAGE_LIBWEBSOCKETS_EXT_POLL
unconditionally compiled in for library versions
prior to 3.2.0.
+config BR2_PACKAGE_LIBWEBSOCKETS_ASYNC_DNS
+ bool "enable async dns support"
+ help
+ Enable asynchronous DNS resolver that directly queries
+ the configured nameserver over UDP, from the event loop.
+
endif
comment "libwebsockets needs a toolchain w/ dynamic library"
diff --git a/package/libwebsockets/libwebsockets.mk b/package/libwebsockets/libwebsockets.mk
index c00c44cac3..e53febfce4 100644
--- a/package/libwebsockets/libwebsockets.mk
+++ b/package/libwebsockets/libwebsockets.mk
@@ -98,4 +98,8 @@ ifeq ($(BR2_PACKAGE_LIBWEBSOCKETS_EXT_POLL),y)
LIBWEBSOCKETS_CONF_OPTS += -DLWS_WITH_EXTERNAL_POLL=ON
endif
+ifeq ($(BR2_PACKAGE_LIBWEBSOCKETS_ASYNC_DNS),y)
+LIBWEBSOCKETS_CONF_OPTS += -DLWS_WITH_SYS_ASYNC_DNS=ON
+endif
+
$(eval $(cmake-package))
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2024-09-20 6:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 6:20 Thomas Devoogdt [this message]
2024-09-20 6:20 ` [Buildroot] [PATCH v1 2/2] package/libwebsockets: fix LWS_MAX_SMP when BR2_TOOLCHAIN_HAS_THREADS is set Thomas Devoogdt
2024-10-26 14:43 ` Thomas Petazzoni via buildroot
2024-10-26 18:25 ` Thomas Devoogdt
2024-10-29 16:06 ` Thomas Petazzoni via buildroot
2025-02-04 12:36 ` Thomas Devoogdt
2026-02-04 14:37 ` Thomas Petazzoni via buildroot
2024-10-26 14:42 ` [Buildroot] [PATCH v1 1/2] package/libwebsockets: add an option to enable lws async dns Thomas Petazzoni via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240920062014.132862-1-thomas@devoogdt.com \
--to=thomas@devoogdt.com \
--cc=bart.vanseveren@barco.com \
--cc=buildroot@buildroot.org \
--cc=thomas.devoogdt@barco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox