diff --git a/lighttpd/build.sh b/lighttpd/build.sh index c58d6c6a..a47de446 100755 --- a/lighttpd/build.sh +++ b/lighttpd/build.sh @@ -2,7 +2,7 @@ set -e -LIGHTTPD="lighttpd-1.4.53" +LIGHTTPD="lighttpd-1.4.79" PKG_URL="https://download.lighttpd.net/lighttpd/releases-1.4.x/${LIGHTTPD}.tar.gz" PKG_MIRROR_URL="https://files.phoesys.com/ports/${LIGHTTPD}.tar.gz" @@ -27,6 +27,9 @@ fi # Apply patches # for patchfile in "${PREFIX_PORT}"/patches/*.patch; do + if [ ! -f "$patchfile" ]; then + continue; + fi if [ ! -f "$PREFIX_LIGHTTPD_MARKERS/$(basename "$patchfile").applied" ]; then echo "applying patch: $patchfile" patch -d "$PREFIX_LIGHTTPD_SRC" -p1 < "$patchfile" @@ -42,10 +45,10 @@ if [ ! -f "$PREFIX_PORT_BUILD/config.h" ]; then CONFIGFILE=$(find "${PREFIX_ROOTFS:?PREFIX_ROOTFS not set!}/etc" -name "lighttpd.conf") grep mod_ "$CONFIGFILE" | cut -d'"' -f2 | xargs -L1 -I{} echo "PLUGIN_INIT({})" > "$PREFIX_LIGHTTPD_SRC"/src/plugin-static.h - # FIXME: -Wno-error=implicit-function-declaration as lighthttp for some reason doesn't include arpa/inet.h when ntohs is used. - LIGHTTPD_CFLAGS="-DLIGHTTPD_STATIC -DPHOENIX -Wno-error=implicit-function-declaration" + LIGHTTPD_CFLAGS="-DLIGHTTPD_STATIC -DPHOENIX" WITH_ZLIB="no" && [ "$PORTS_ZLIB" = "y" ] && WITH_ZLIB="yes" + ( cd "$PREFIX_LIGHTTPD_SRC" && "./autogen.sh" ) ( cd "$PREFIX_PORT_BUILD" && "$PREFIX_LIGHTTPD_SRC/configure" LIGHTTPD_STATIC=yes CFLAGS="${LIGHTTPD_CFLAGS} ${CFLAGS}" CPPFLAGS="" LDFLAGS="${LDFLAGS}" AR_FLAGS="-r" \ -C --disable-ipv6 --disable-mmap --with-bzip2=no \ --with-zlib="$WITH_ZLIB" --enable-shared=no --enable-static=yes --disable-shared --host="$HOST" --with-openssl="${PREFIX_OPENSSL}" --with-pcre="${PREFIX_PCRE}" \ diff --git a/lighttpd/patches/arpa_inet_include.patch b/lighttpd/patches/arpa_inet_include.patch deleted file mode 100644 index ba7a449d..00000000 --- a/lighttpd/patches/arpa_inet_include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/http-header-glue.c b/src/http-header-glue.c -index 6aae972..1cb92d1 100644 ---- a/src/http-header-glue.c -+++ b/src/http-header-glue.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include - diff --git a/lighttpd/patches/fdevent_del_bug_fix.patch b/lighttpd/patches/fdevent_del_bug_fix.patch deleted file mode 100644 index 0fefb3f2..00000000 --- a/lighttpd/patches/fdevent_del_bug_fix.patch +++ /dev/null @@ -1,16 +0,0 @@ - src/fdevent_poll.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/fdevent_poll.c b/src/fdevent_poll.c -index 76e9413..9511aed 100644 ---- a/src/fdevent_poll.c -+++ b/src/fdevent_poll.c -@@ -43,7 +43,7 @@ static int fdevent_poll_event_del(fdevents *ev, int fde_ndx, int fd) { - - ev->pollfds[k].fd = -1; - /* ev->pollfds[k].events = 0; */ -- /* ev->pollfds[k].revents = 0; */ -+ ev->pollfds[k].revents = 0; - - if (ev->unused.size == 0) { - ev->unused.size = 16; diff --git a/lighttpd/patches/fionread_bug.patch b/lighttpd/patches/fionread_bug.patch deleted file mode 100644 index fa62030b..00000000 --- a/lighttpd/patches/fionread_bug.patch +++ /dev/null @@ -1,17 +0,0 @@ - src/http-header-glue.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/http-header-glue.c b/src/http-header-glue.c -index 5d4f1f5..d0c925c 100644 ---- a/src/http-header-glue.c -+++ b/src/http-header-glue.c -@@ -1228,7 +1228,8 @@ handler_t http_response_read(server *srv, connection *con, http_response_opts *o - toread = 4096; /* let read() below indicate if EOF or EAGAIN */ - #endif - } -- } -+ } else -+ toread = 4096; - - if (con->conf.stream_response_body & FDEVENT_STREAM_RESPONSE_BUFMIN) { - off_t cqlen = chunkqueue_length(con->write_queue); diff --git a/lighttpd/patches/makefile_wstunnel.patch b/lighttpd/patches/makefile_wstunnel.patch deleted file mode 100644 index d3012a98..00000000 --- a/lighttpd/patches/makefile_wstunnel.patch +++ /dev/null @@ -1,102 +0,0 @@ -diff -Naur lighttpd-1.4.53/src/Makefile.in lighttpd-1.4.53.phx/src/Makefile.in ---- lighttpd-1.4.53/src/Makefile.in 2019-01-27 10:22:29.000000000 +0100 -+++ lighttpd-1.4.53.phx/src/Makefile.in 2023-12-18 12:54:52.292092353 +0100 -@@ -678,12 +678,12 @@ - mod_setenv.c mod_simple_vhost.c mod_ssi_exprparser.c \ - mod_ssi_expr.c mod_ssi.c mod_staticfile.c mod_status.c \ - mod_uploadprogress.c mod_userdir.c mod_usertrack.c \ -- mod_vhostdb.c mod_webdav.c mod_geoip.c mod_cml.c mod_cml_lua.c \ -- mod_cml_funcs.c mod_magnet.c mod_magnet_cache.c \ -- mod_authn_gssapi.c mod_authn_ldap.c mod_vhostdb_ldap.c \ -- mod_authn_pam.c mod_authn_mysql.c mod_mysql_vhost.c \ -- mod_vhostdb_mysql.c mod_vhostdb_pgsql.c mod_vhostdb_dbi.c \ -- mod_openssl.c mod_trigger_b4_dl.c -+ mod_vhostdb.c mod_webdav.c mod_wstunnel.c mod_geoip.c \ -+ mod_cml.c mod_cml_lua.c mod_cml_funcs.c mod_magnet.c \ -+ mod_magnet_cache.c mod_authn_gssapi.c mod_authn_ldap.c \ -+ mod_vhostdb_ldap.c mod_authn_pam.c mod_authn_mysql.c \ -+ mod_mysql_vhost.c mod_vhostdb_mysql.c mod_vhostdb_pgsql.c \ -+ mod_vhostdb_dbi.c mod_openssl.c mod_trigger_b4_dl.c - am__objects_2 = lighttpd-base64.$(OBJEXT) lighttpd-buffer.$(OBJEXT) \ - lighttpd-burl.$(OBJEXT) lighttpd-log.$(OBJEXT) \ - lighttpd-http_header.$(OBJEXT) lighttpd-http_kv.$(OBJEXT) \ -@@ -768,6 +768,7 @@ - @LIGHTTPD_STATIC_TRUE@ lighttpd-mod_usertrack.$(OBJEXT) \ - @LIGHTTPD_STATIC_TRUE@ lighttpd-mod_vhostdb.$(OBJEXT) \ - @LIGHTTPD_STATIC_TRUE@ lighttpd-mod_webdav.$(OBJEXT) \ -+@LIGHTTPD_STATIC_TRUE@ lighttpd-mod_wstunnel.$(OBJEXT) \ - @LIGHTTPD_STATIC_TRUE@ $(am__objects_5) $(am__objects_6) \ - @LIGHTTPD_STATIC_TRUE@ $(am__objects_7) $(am__objects_8) \ - @LIGHTTPD_STATIC_TRUE@ $(am__objects_9) $(am__objects_10) \ -@@ -1035,6 +1036,7 @@ - ./$(DEPDIR)/lighttpd-mod_vhostdb_mysql.Po \ - ./$(DEPDIR)/lighttpd-mod_vhostdb_pgsql.Po \ - ./$(DEPDIR)/lighttpd-mod_webdav.Po \ -+ ./$(DEPDIR)/lighttpd-mod_wstunnel.Po \ - ./$(DEPDIR)/lighttpd-network.Po \ - ./$(DEPDIR)/lighttpd-network_write.Po \ - ./$(DEPDIR)/lighttpd-plugin.Po ./$(DEPDIR)/lighttpd-rand.Po \ -@@ -1659,12 +1664,12 @@ - @LIGHTTPD_STATIC_TRUE@ mod_staticfile.c mod_status.c \ - @LIGHTTPD_STATIC_TRUE@ mod_uploadprogress.c mod_userdir.c \ - @LIGHTTPD_STATIC_TRUE@ mod_usertrack.c mod_vhostdb.c \ --@LIGHTTPD_STATIC_TRUE@ mod_webdav.c $(am__append_16) \ --@LIGHTTPD_STATIC_TRUE@ $(am__append_18) $(am__append_21) \ --@LIGHTTPD_STATIC_TRUE@ $(am__append_23) $(am__append_25) \ --@LIGHTTPD_STATIC_TRUE@ $(am__append_27) $(am__append_30) \ --@LIGHTTPD_STATIC_TRUE@ $(am__append_33) $(am__append_36) \ --@LIGHTTPD_STATIC_TRUE@ $(am__append_41) -+@LIGHTTPD_STATIC_TRUE@ mod_webdav.c mod_wstunnel.c \ -+@LIGHTTPD_STATIC_TRUE@ $(am__append_16) $(am__append_18) \ -+@LIGHTTPD_STATIC_TRUE@ $(am__append_21) $(am__append_23) \ -+@LIGHTTPD_STATIC_TRUE@ $(am__append_25) $(am__append_27) \ -+@LIGHTTPD_STATIC_TRUE@ $(am__append_30) $(am__append_33) \ -+@LIGHTTPD_STATIC_TRUE@ $(am__append_36) $(am__append_41) - @LIGHTTPD_STATIC_FALSE@lighttpd_CPPFLAGS = $(FAM_CFLAGS) $(LIBEV_CFLAGS) - @LIGHTTPD_STATIC_TRUE@lighttpd_CPPFLAGS = -DLIGHTTPD_STATIC \ - @LIGHTTPD_STATIC_TRUE@ $(XML_CFLAGS) $(SQLITE_CFLAGS) \ -@@ -2213,6 +2218,7 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lighttpd-mod_vhostdb_mysql.Po@am__quote@ # am--include-marker - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lighttpd-mod_vhostdb_pgsql.Po@am__quote@ # am--include-marker - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lighttpd-mod_webdav.Po@am__quote@ # am--include-marker -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lighttpd-mod_wstunnel.Po@am__quote@ # am--include-marker - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lighttpd-network.Po@am__quote@ # am--include-marker - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lighttpd-network_write.Po@am__quote@ # am--include-marker - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lighttpd-plugin.Po@am__quote@ # am--include-marker -@@ -3865,6 +3871,20 @@ - @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lighttpd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lighttpd-mod_webdav.obj `if test -f 'mod_webdav.c'; then $(CYGPATH_W) 'mod_webdav.c'; else $(CYGPATH_W) '$(srcdir)/mod_webdav.c'; fi` - -+lighttpd-mod_wstunnel.o: mod_wstunnel.c -+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lighttpd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lighttpd-mod_wstunnel.o -MD -MP -MF $(DEPDIR)/lighttpd-mod_wstunnel.Tpo -c -o lighttpd-mod_wstunnel.o `test -f 'mod_wstunnel.c' || echo '$(srcdir)/'`mod_wstunnel.c -+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lighttpd-mod_wstunnel.Tpo $(DEPDIR)/lighttpd-mod_wstunnel.Po -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod_wstunnel.c' object='lighttpd-mod_wstunnel.o' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lighttpd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lighttpd-mod_wstunnel.o `test -f 'mod_wstunnel.c' || echo '$(srcdir)/'`mod_wstunnel.c -+ -+lighttpd-mod_wstunnel.obj: mod_wstunnel.c -+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lighttpd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lighttpd-mod_wstunnel.obj -MD -MP -MF $(DEPDIR)/lighttpd-mod_wstunnel.Tpo -c -o lighttpd-mod_wstunnel.obj `if test -f 'mod_wstunnel.c'; then $(CYGPATH_W) 'mod_wstunnel.c'; else $(CYGPATH_W) '$(srcdir)/mod_wstunnel.c'; fi` -+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lighttpd-mod_wstunnel.Tpo $(DEPDIR)/lighttpd-mod_wstunnel.Po -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod_wstunnel.c' object='lighttpd-mod_wstunnel.obj' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lighttpd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lighttpd-mod_wstunnel.obj `if test -f 'mod_wstunnel.c'; then $(CYGPATH_W) 'mod_wstunnel.c'; else $(CYGPATH_W) '$(srcdir)/mod_wstunnel.c'; fi` -+ - lighttpd-mod_geoip.o: mod_geoip.c - @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lighttpd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lighttpd-mod_geoip.o -MD -MP -MF $(DEPDIR)/lighttpd-mod_geoip.Tpo -c -o lighttpd-mod_geoip.o `test -f 'mod_geoip.c' || echo '$(srcdir)/'`mod_geoip.c - @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lighttpd-mod_geoip.Tpo $(DEPDIR)/lighttpd-mod_geoip.Po -@@ -4480,6 +4502,7 @@ - -rm -f ./$(DEPDIR)/lighttpd-mod_vhostdb_mysql.Po - -rm -f ./$(DEPDIR)/lighttpd-mod_vhostdb_pgsql.Po - -rm -f ./$(DEPDIR)/lighttpd-mod_webdav.Po -+ -rm -f ./$(DEPDIR)/lighttpd-mod_wstunnel.Po - -rm -f ./$(DEPDIR)/lighttpd-network.Po - -rm -f ./$(DEPDIR)/lighttpd-network_write.Po - -rm -f ./$(DEPDIR)/lighttpd-plugin.Po -@@ -4747,6 +4770,7 @@ - -rm -f ./$(DEPDIR)/lighttpd-mod_vhostdb_mysql.Po - -rm -f ./$(DEPDIR)/lighttpd-mod_vhostdb_pgsql.Po - -rm -f ./$(DEPDIR)/lighttpd-mod_webdav.Po -+ -rm -f ./$(DEPDIR)/lighttpd-mod_wstunnel.Po - -rm -f ./$(DEPDIR)/lighttpd-network.Po - -rm -f ./$(DEPDIR)/lighttpd-network_write.Po - -rm -f ./$(DEPDIR)/lighttpd-plugin.Po diff --git a/lighttpd/patches/mod_cgi_mmap_fix.patch b/lighttpd/patches/mod_cgi_mmap_fix.patch deleted file mode 100644 index 06f926f6..00000000 --- a/lighttpd/patches/mod_cgi_mmap_fix.patch +++ /dev/null @@ -1,16 +0,0 @@ - src/mod_cgi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/mod_cgi.c b/src/mod_cgi.c -index e0f2c2b..b636f0f 100644 ---- a/src/mod_cgi.c -+++ b/src/mod_cgi.c -@@ -541,7 +541,7 @@ static ssize_t cgi_write_file_chunk_mmap(server *srv, connection *con, int fd, c - c->file.mmap.offset = mmap_align_offset(offset); - c->file.mmap.length = file_end - c->file.mmap.offset; - -- if (MAP_FAILED == (c->file.mmap.start = mmap(NULL, c->file.mmap.length, PROT_READ, MAP_PRIVATE, c->file.fd, c->file.mmap.offset))) { -+ if (MAP_FAILED == (c->file.mmap.start)) { - if (toSend > 65536) toSend = 65536; - data = malloc(toSend); - force_assert(data); diff --git a/lighttpd/patches/mod_compress_fix.patch b/lighttpd/patches/mod_compress_fix.patch deleted file mode 100644 index 2d511b6c..00000000 --- a/lighttpd/patches/mod_compress_fix.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -ruN a/src/mod_compress.c b/src/mod_compress.c ---- a/src/mod_compress.c 2022-02-22 17:15:22.009713645 +0100 -+++ b/src/mod_compress.c 2022-02-24 13:36:20.916095957 +0100 -@@ -501,17 +501,23 @@ - buffer_append_string_buffer(p->ofn, con->uri.path); - } - -+ buffer_reset(p->b); -+ buffer_copy_buffer(p->b, con->physical.path); -+ - switch(type) { - case HTTP_ACCEPT_ENCODING_GZIP: - case HTTP_ACCEPT_ENCODING_X_GZIP: - buffer_append_string_len(p->ofn, CONST_STR_LEN("-gzip-")); -+ buffer_append_string_len(p->b, CONST_STR_LEN(".gz")); - break; - case HTTP_ACCEPT_ENCODING_DEFLATE: - buffer_append_string_len(p->ofn, CONST_STR_LEN("-deflate-")); -+ buffer_append_string_len(p->b, CONST_STR_LEN(".deflate")); - break; - case HTTP_ACCEPT_ENCODING_BZIP2: - case HTTP_ACCEPT_ENCODING_X_BZIP2: - buffer_append_string_len(p->ofn, CONST_STR_LEN("-bzip2-")); -+ buffer_append_string_len(p->b, CONST_STR_LEN(".bz2")); - break; - default: - log_error_write(srv, __FILE__, __LINE__, "sd", "unknown compression type", type); -@@ -520,6 +526,11 @@ - - buffer_append_string_buffer(p->ofn, sce->etag); - -+ if (access(p->b->ptr, R_OK) == 0) { -+ buffer_copy_buffer(con->physical.path, p->b); -+ return 0; -+ } -+ - if (HANDLER_ERROR != stat_cache_get_entry(srv, con, p->ofn, &sce_ofn)) { - if (0 == sce->st.st_size) return -1; /* cache file being created */ - /* cache-entry exists */ diff --git a/lighttpd/patches/stream_mmap_fix.patch b/lighttpd/patches/stream_mmap_fix.patch deleted file mode 100644 index f36ac197..00000000 --- a/lighttpd/patches/stream_mmap_fix.patch +++ /dev/null @@ -1,16 +0,0 @@ - src/stream.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/stream.c b/src/stream.c -index 9099bf6..5300ad0 100644 ---- a/src/stream.c -+++ b/src/stream.c -@@ -48,7 +48,7 @@ int stream_open(stream *f, const buffer *fn) { - return 0; - } - -- f->start = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0); -+ f->start = MAP_FAILED; - - if (MAP_FAILED == f->start) { - f->start = malloc((size_t)st.st_size);