lighttpd: include mod_h2 in base package
authorGlenn Strauss <gstrauss@gluelogic.com>
Thu, 11 May 2023 00:52:05 +0000 (20:52 -0400)
committerRosen Penev <rosenp@gmail.com>
Sat, 13 May 2023 12:56:13 +0000 (15:56 +0300)
The next version of lighttpd will move HTTP/2 support from the lighttpd
base executable into a separate module: mod_h2

Include patch to do so now, and update packaging to handle it.

HTTP/2 support is enabled by default since lighttpd 1.4.59, but if
HTTP/2 support is explicitly disabled in the configuration, then mod_h2
will not be loaded, thereby reducing lighttpd memory use.

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
net/lighttpd/Makefile
net/lighttpd/patches/030-mod_h2-HTTP-2-separate-mod.patch [new file with mode: 0644]

index d5b21c987e4a976faa6db0bdf17c7d7c4493f3a8..7954afb8a4b2304977505663d550c301cb5ee5ce 100644 (file)
@@ -177,7 +177,7 @@ MESON_ARGS += \
        -Dwith_zlib=$(if $(CONFIG_PACKAGE_lighttpd-mod-deflate),enabled,disabled) \
        -Dwith_zstd=disabled
 
-BASE_MODULES:=dirlisting
+BASE_MODULES:=dirlisting h2
 
 define Package/lighttpd/conffiles
 /etc/lighttpd/lighttpd.conf
@@ -307,8 +307,9 @@ server.modules += ( \"mod_$(1)\" )" $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
   $$(eval $$(call BuildPackage,lighttpd-mod-$(1)))
 endef
 
-# included in BASE_MODULES:=dirlisting
+# included in BASE_MODULES:=dirlisting h2
 #$(eval $(call BuildPlugin,dirlisting,dirlisting,,30))
+#$(eval $(call BuildPlugin,h2,HTTP/2,,30))
 
 # included in base lighttpd executable;
 # no longer loaded as separate dynamic modules
diff --git a/net/lighttpd/patches/030-mod_h2-HTTP-2-separate-mod.patch b/net/lighttpd/patches/030-mod_h2-HTTP-2-separate-mod.patch
new file mode 100644 (file)
index 0000000..652b214
--- /dev/null
@@ -0,0 +1,87 @@
+From 2892a7bf3f8ce92f41134fab25fbc2057f4a36bf Mon Sep 17 00:00:00 2001
+From: Glenn Strauss <gstrauss@gluelogic.com>
+Date: Wed, 10 May 2023 19:06:42 -0400
+Subject: [PATCH] [mod_h2] HTTP/2 separate module; no longer builtin
+
+---
+ src/CMakeLists.txt | 3 ---
+ src/Makefile.am    | 9 +++------
+ src/SConscript     | 4 +---
+ src/meson.build    | 3 ---
+ 4 files changed, 4 insertions(+), 15 deletions(-)
+
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -922,10 +922,7 @@ set(SERVER_SRC
+       response.c
+       connections.c
+       h1.c
+-      h2.c
+       sock_addr_cache.c
+-      ls-hpack/lshpack.c
+-      algo_xxhash.c
+       fdevent_impl.c
+       http_range.c
+       network.c
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -70,12 +70,10 @@ common_src=base64.c buffer.c burl.c log.
+ common_src += fdevent_win32.c fs_win32.c
+-src = server.c response.c connections.c h1.c h2.c \
++src = server.c response.c connections.c h1.c \
+       sock_addr_cache.c \
+       network.c \
+       network_write.c \
+-      ls-hpack/lshpack.c \
+-      algo_xxhash.c \
+       fdevent_impl.c \
+       http_range.c \
+       data_config.c \
+@@ -428,6 +426,8 @@ lighttpd_LDADD = \
+   $(FAM_LIBS) $(LIBEV_LIBS) $(LIBUNWIND_LIBS)
+ lighttpd_LDFLAGS = -export-dynamic
++lighttpd_SOURCES += h2.c ls-hpack/lshpack.c algo_xxhash.c
++lighttpd_LDADD += $(XXHASH_LIBS)
+ if BUILD_WITH_MAXMINDDB
+ lighttpd_SOURCES += mod_maxminddb.c
+ lighttpd_LDADD += $(MAXMINDDB_LIB)
+@@ -489,9 +489,6 @@ lighttpd_SOURCES += mod_wolfssl.c
+ lighttpd_CPPFLAGS += $(WOLFSSL_CFLAGS)
+ lighttpd_LDADD += $(WOLFSSL_LIBS)
+ endif
+-#(until switch to mod_h2)
+-#lighttpd_SOURCES += h2.c ls-hpack/lshpack.c algo_xxhash.c
+-#lighttpd_LDADD += $(XXHASH_LIBS)
+ else
+--- a/src/SConscript
++++ b/src/SConscript
+@@ -75,10 +75,8 @@ common_src = Split("base64.c buffer.c bu
+       ck.c \
+ ")
+-src = Split("server.c response.c connections.c h1.c h2.c \
++src = Split("server.c response.c connections.c h1.c \
+       sock_addr_cache.c \
+-      ls-hpack/lshpack.c \
+-      algo_xxhash.c \
+       fdevent_impl.c \
+       http_range.c \
+       network.c \
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -560,10 +560,7 @@ main_src = files(
+       'connections.c',
+       'data_config.c',
+       'h1.c',
+-      'h2.c',
+       'sock_addr_cache.c',
+-      'ls-hpack/lshpack.c',
+-      'algo_xxhash.c',
+       'fdevent_impl.c',
+       'http_range.c',
+       'network_write.c',