Skip to contentSkip to conversation

package/libwebsockets: Add support for unix-domain-sockets

PATCH New Heiko Stuebner 2 participants 2 messages Jun 12, 2020 – Jun 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libwebsockets: Add support for unix-domain-sockets

From: Martin Elshuber <[email protected]>

libwebsockets allows the usage of unix-domain-sockets since 2016, so add an option to enable its usage.

---
 package/libwebsockets/Config.in        | 4 ++++
 package/libwebsockets/libwebsockets.mk | 4 ++++
 2 files changed, 8 insertions(+)
package/libwebsockets/Config.in +4 -0
index 2b350bf389..78a659fd35 100644
@@ -8,3 +8,7 @@ config BR2_PACKAGE_LIBWEBSOCKETS
 	  in both directions.
 
 	  http://libwebsockets.org/
+
+config BR2_PACKAGE_LIBWEBSOCKETS_INCLUDE_UNIX_SOCK
+       bool "include support for unix-sockets"
+       depends on BR2_PACKAGE_LIBWEBSOCKETS
package/libwebsockets/libwebsockets.mk +4 -0
index dedd03347d..3f6ab1408d 100644
@@ -59,4 +59,8 @@ ifeq ($(BR2_SHARED_LIBS),y)
 LIBWEBSOCKETS_CONF_OPTS += -DLWS_WITH_STATIC=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_LIBWEBSOCKETS_INCLUDE_UNIX_SOCK),y)
+LIBWEBSOCKETS_CONF_OPTS += -DLWS_UNIX_SOCK=ON
+endif
+
 $(eval $(cmake-package))
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/1 package/libwebsockets: Add support for unix-domain-sockets

Heiko, Martin, All,

On 2020-06-12 13:31 +0200, Heiko Stuebner spake thusly:

Quoted 29 lines

From: Martin Elshuber <[email protected]>

libwebsockets allows the usage of unix-domain-sockets since 2016, so add an option to enable its usage.

---
 package/libwebsockets/Config.in        | 4 ++++
 package/libwebsockets/libwebsockets.mk | 4 ++++
 2 files changed, 8 insertions(+)
package/libwebsockets/Config.in +4 -0
index 2b350bf389..78a659fd35 100644
@@ -8,3 +8,7 @@ config BR2_PACKAGE_LIBWEBSOCKETS
 	  in both directions.
 
 	  http://libwebsockets.org/
+
+config BR2_PACKAGE_LIBWEBSOCKETS_INCLUDE_UNIX_SOCK
+       bool "include support for unix-sockets"
+       depends on BR2_PACKAGE_LIBWEBSOCKETS
package/libwebsockets/libwebsockets.mk +0 -0
index dedd03347d..3f6ab1408d 100644

package/libwebsockets/libwebsockets.mk ifeq ($(BR2_SHARED_LIBS),y) · line 64

Quoted 6 lines
package/libwebsockets/libwebsockets.mk +3 -0
@@ -59,4 +59,8 @@ ifeq ($(BR2_SHARED_LIBS),y)
 LIBWEBSOCKETS_CONF_OPTS += -DLWS_WITH_STATIC=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_LIBWEBSOCKETS_INCLUDE_UNIX_SOCK),y)
+LIBWEBSOCKETS_CONF_OPTS += -DLWS_UNIX_SOCK=ON
+endif

We like to have an else clause that explicitly disable the option:

    else
    LIBWEBSOCKETS_CONF_OPTS += -DLWS_UNIX_SOCK=OFF
    endif

Indeed the default value may change when the version is bumped, which is actually what hapenned with this option between 3.2.2 (currently in Buildroot), and what they currently have in master (commit 911898ad7).

However, in this case, an option is not even needed: the size increase is a mere 12 bytes:

    $ ls -l output-nosock/target/usr/lib/libwebsockets.so.15
    -rwxr-xr-x 1 ymorin ymorin 183292 Jun 14 10:13 output-nosock/target/usr/lib/libwebsockets.so.15
    $ ls -l output-sock/target/usr/lib/libwebsockets.so.15
    -rwxr-xr-x 1 ymorin ymorin 183304 Jun 14 10:15 output-sock/target/usr/lib/libwebsockets.so.15

So this does not even warrant an option to start with.

Applied with the option removed, thanks.

Regards,
Yann E. MORIN.

Quoted 8 lines
package/libwebsockets/libwebsockets.mk +0 -0
 $(eval $(cmake-package))
Signature · 6 lines
2.26.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'