diff --git a/patches/0002-disable-huffman-decode-encode.patch b/patches/0002-disable-huffman-decode-encode.patch new file mode 100644 index 0000000..9cb84ca --- /dev/null +++ b/patches/0002-disable-huffman-decode-encode.patch @@ -0,0 +1,51 @@ +diff --git a/Config.uk b/Config.uk +index 3b907e8..2719b5d 100644 +--- a/Config.uk ++++ b/Config.uk +@@ -1,6 +1,6 @@ + menuconfig LIBNGINX + bool "libnginx - a HTTP and reverse proxy, a mail proxy, and a generic TCP/UDP proxy server" +- default n ++ default y + select LIBUKSCHEDCOOP + select LIBPOSIX_LIBDL + select LIBPOSIX_PROCESS +diff --git a/Library.uk b/Library.uk +index fc1f309..c3a9d5d 100644 +--- a/Library.uk ++++ b/Library.uk +@@ -1,5 +1,5 @@ + name := "nginx" + description := "A HTTP and reverse proxy, a mail proxy, and a generic TCP/UDP proxy server." + homepage := "https://nginx.org/" +-version := 1.15.6 sha256:a3d8c67c2035808c7c0d475fffe263db8c353b11521aa7ade468b780ed826cc6 http://nginx.org/download/nginx-1.15.6.tar.gz ++version := 1.28.0 c6b5c6b086c0df9d3ca3ff5e084c1d0ef909e6038279c71c1c3e985f576ff76a http://nginx.org/download/nginx-1.28.0.tar.gz + license := "BSD-2-Clause" +diff --git a/Makefile.uk b/Makefile.uk +index 29db863..dfe367a 100644 +--- a/Makefile.uk ++++ b/Makefile.uk +@@ -42,7 +42,7 @@ $(eval $(call addlib_s,libnginx,$(CONFIG_LIBNGINX))) + ################################################################################ + # Sources + ################################################################################ +-LIBNGINX_VERSION = 1.15.6 ++LIBNGINX_VERSION = 1.28.0 + LIBNGINX_BASENAME = nginx-$(LIBNGINX_VERSION) + LIBNGINX_URL = http://nginx.org/download/$(LIBNGINX_BASENAME).tar.gz + LIBNGINX_PATCHDIR = $(LIBNGINX_BASE)/patches +@@ -180,8 +180,10 @@ LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP) += $(LIBNGINX_SRC)/http/modules/ngx_http_l + LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP) += $(LIBNGINX_SRC)/http/ngx_http_header_filter_module.c + LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP) += $(LIBNGINX_SRC)/http/modules/ngx_http_chunked_filter_module.c + LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP_V2) += $(LIBNGINX_SRC)/http/v2/ngx_http_v2_encode.c +-# Huffman encode/decode not supported +-LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP_V2) += $(LIBNGINX_SRC)/http/v2/ngx_http_v2_huff_decode.c +-LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP_V2) += $(LIBNGINX_SRC)/http/v2/ngx_http_v2_huff_encode.c ++# LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP_V2) += $(LIBNGINX_SRC)/http/v2/ngx_http_v2_huff_decode.c ++# LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP_V2) += $(LIBNGINX_SRC)/http/v2/ngx_http_v2_huff_encode.c + LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP_V2) += $(LIBNGINX_SRC)/http/v2/ngx_http_v2_table.c + LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP_V2) += $(LIBNGINX_SRC)/http/v2/ngx_http_v2.c + LIBNGINX_SRCS-$(CONFIG_LIBNGINX_HTTP_V2) += $(LIBNGINX_SRC)/http/v2/ngx_http_v2_filter_module.c ++ ++# Stub replacements for huffman functions ++LIBNGINX_SRCS-y += $(LIBNGINX_BASE)/src/nginx_huff_stubs.cx diff --git a/patches/0002-pthread-embedded-does-not-allow-semaphores-shared-be.patch.disabled b/patches/0002-pthread-embedded-does-not-allow-semaphores-shared-be.patch.disabled new file mode 100644 index 0000000..dc8b94b --- /dev/null +++ b/patches/0002-pthread-embedded-does-not-allow-semaphores-shared-be.patch.disabled @@ -0,0 +1,27 @@ +From 30557083a93221ea1e5817c60bad16d4bd13a16c Mon Sep 17 00:00:00 2001 +From: Mihai Pogonaru +Date: Fri, 14 Jun 2019 01:31:43 +0300 +Subject: [PATCH] pthread-embedded does not allow semaphores shared between + processes + +Signed-off-by: Mihai Pogonaru +--- + src/core/ngx_shmtx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/core/ngx_shmtx.c b/src/core/ngx_shmtx.c +index a255903..6da5cab 100644 +--- a/src/core/ngx_shmtx.c ++++ b/src/core/ngx_shmtx.c +@@ -30,7 +30,7 @@ ngx_shmtx_create(ngx_shmtx_t *mtx, ngx_shmtx_sh_t *addr, u_char *name) + + mtx->wait = &addr->wait; + +- if (sem_init(&mtx->sem, 1, 0) == -1) { ++ if (sem_init(&mtx->sem, 0, 0) == -1) { + ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_errno, + "sem_init() failed"); + } else { +-- +2.11.0 + diff --git a/patches/0003-Initialize-nginx-cached-time-structures.patch.disabled b/patches/0003-Initialize-nginx-cached-time-structures.patch.disabled new file mode 100644 index 0000000..02b54eb --- /dev/null +++ b/patches/0003-Initialize-nginx-cached-time-structures.patch.disabled @@ -0,0 +1,29 @@ +From 0c3c7ca3fec1f1e2b4d6c3b2739ece484ce4cb92 Mon Sep 17 00:00:00 2001 +From: Razvan Virtan +Date: Tue, 20 Jul 2021 19:52:48 +0300 +Subject: [PATCH] Initialize nginx cached time structures + +--- + src/core/ngx_times.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c +index 7964b00..ffb317f 100644 +--- a/src/core/ngx_times.c ++++ b/src/core/ngx_times.c +@@ -73,6 +73,12 @@ ngx_time_init(void) + + ngx_cached_time = &cached_time[0]; + ++ ngx_cached_http_time.data = &cached_http_time[0][0]; ++ ngx_cached_err_log_time.data = &cached_err_log_time[0][0]; ++ ngx_cached_http_log_time.data = &cached_http_log_time[0][0]; ++ ngx_cached_http_log_iso8601.data = &cached_http_log_iso8601[0][0]; ++ ngx_cached_syslog_time.data = &cached_syslog_time[0][0]; ++ + ngx_time_update(); + } + +-- +2.17.1 + diff --git a/patches/0003-huffman-replace-calls.patch b/patches/0003-huffman-replace-calls.patch new file mode 100644 index 0000000..480947b --- /dev/null +++ b/patches/0003-huffman-replace-calls.patch @@ -0,0 +1,38 @@ +--- a/src/http/v2/ngx_http_v2.c ++++ b/src/http/v2/ngx_http_v2.c +@@ -19,6 +19,9 @@ + #include + #include + ++// Forward declaration of stub ++extern ngx_int_t ngx_http_huff_decode_stub(u_char *, u_char *, size_t, u_char, ngx_uint_t, ngx_log_t *); ++ + static ngx_http_v2_handler_pt ngx_http_v2_state[] = { + ngx_http_v2_state_head, + ngx_http_v2_state_head, +@@ -1583,7 +1586,7 @@ ngx_http_v2_state_field_huff(ngx_http_v2_connection_t *h2c, + u_char ch; + ngx_uint_t state = 0; + +- rc = ngx_http_huff_decode(&state, pos, len, ch, lower, h2c->connection->log); ++ rc = ngx_http_huff_decode_stub(&state, pos, len, ch, lower, h2c->connection->log); + + if (rc != NGX_OK) { + return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_COMP_ERROR); +--- a/src/http/modules/ngx_http_grpc_module.c ++++ b/src/http/modules/ngx_http_grpc_module.c +@@ -10,6 +10,9 @@ + #include + #include + ++// Forward declaration of stub ++extern ngx_int_t ngx_http_huff_decode_stub(u_char *, u_char *, size_t, u_char, ngx_uint_t, ngx_log_t *); ++ +@@ -3201,7 +3204,7 @@ ngx_http_grpc_parse_fragment(ngx_http_request_t *r, ngx_http_grpc_ctx_t *ctx, ngx_buf_t *b) + // original call +- rc = ngx_http_huff_decode(&ctx->state, p, end - p, ch, 0, r->connection->log); ++ rc = ngx_http_huff_decode_stub(&ctx->state, p, end - p, ch, 0, r->connection->log); +@@ -3310,7 +3313,7 @@ ngx_http_grpc_parse_fragment(ngx_http_request_t *r, ngx_http_grpc_ctx_t *ctx, ngx_buf_t *b) + // original call +- rc = ngx_http_huff_decode(&ctx->state, p, end - p, ch, 0, r->connection->log); ++ rc = ngx_http_huff_decode_stub(&ctx->state, p, end - p, ch, 0, r->connection->log);