From 5e9035dac9a0bef0995ae9bda74ef19b08a33f3e Mon Sep 17 00:00:00 2001 From: Torden Date: Wed, 26 Jun 2024 14:50:39 +0900 Subject: [PATCH] add patches for freenginx --- ...27.x-ngx_http_header_filter_module.c.patch | 51 +++++++++++++++++ ...x-1.27.x-ngx_http_special_response.c.patch | 27 +++++++++ ...x-1.27.x-ngx_http_v2_filter_module.c.patch | 56 +++++++++++++++++++ ...x-1.27.x-ngx_http_v3_filter_module.c.patch | 38 +++++++++++++ 4 files changed, 172 insertions(+) create mode 100644 freenginx-1.27.x-ngx_http_header_filter_module.c.patch create mode 100644 freenginx-1.27.x-ngx_http_special_response.c.patch create mode 100644 freenginx-1.27.x-ngx_http_v2_filter_module.c.patch create mode 100644 freenginx-1.27.x-ngx_http_v3_filter_module.c.patch diff --git a/freenginx-1.27.x-ngx_http_header_filter_module.c.patch b/freenginx-1.27.x-ngx_http_header_filter_module.c.patch new file mode 100644 index 0000000..46488ab --- /dev/null +++ b/freenginx-1.27.x-ngx_http_header_filter_module.c.patch @@ -0,0 +1,51 @@ +--- src/http/ngx_http_header_filter_module.c 2024-06-26 14:34:05.775860781 +0900 ++++ src/http/ngx_http_header_filter_module.c.new 2024-06-04 22:55:54.000000000 +0900 +@@ -46,9 +46,9 @@ + }; + + ++//static u_char ngx_http_server_string[] = "Server: " NGINX_NAME CRLF; ++//static u_char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF; ++//static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF; +-static u_char ngx_http_server_string[] = "Server: " NGINX_NAME CRLF; +-static u_char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF; +-static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF; + + + static ngx_str_t ngx_http_status_lines[] = { +@@ -282,7 +282,7 @@ + } + + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); ++/* +- + if (r->headers_out.server == NULL) { + if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { + len += sizeof(ngx_http_server_full_string) - 1; +@@ -294,7 +294,7 @@ + len += sizeof(ngx_http_server_string) - 1; + } + } ++*/ +- + if (r->headers_out.date == NULL) { + len += sizeof("Date: Mon, 28 Sep 1970 06:00:00 GMT" CRLF) - 1; + } +@@ -451,7 +451,7 @@ + b->last = ngx_sprintf(b->last, "%03ui ", status); + } + *b->last++ = CR; *b->last++ = LF; ++/* +- + if (r->headers_out.server == NULL) { + if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { + p = ngx_http_server_full_string; +@@ -468,7 +468,7 @@ + + b->last = ngx_cpymem(b->last, p, len); + } ++*/ +- + if (r->headers_out.date == NULL) { + b->last = ngx_cpymem(b->last, "Date: ", sizeof("Date: ") - 1); + b->last = ngx_cpymem(b->last, ngx_cached_http_time.data, diff --git a/freenginx-1.27.x-ngx_http_special_response.c.patch b/freenginx-1.27.x-ngx_http_special_response.c.patch new file mode 100644 index 0000000..e0f51f3 --- /dev/null +++ b/freenginx-1.27.x-ngx_http_special_response.c.patch @@ -0,0 +1,27 @@ +--- src/http/ngx_http_special_response.c 2024-06-04 22:55:54.000000000 +0900 ++++ src/http/ngx_http_special_response.c.new 2024-06-26 14:36:07.259654964 +0900 +@@ -19,21 +19,21 @@ + + + static u_char ngx_http_error_full_tail[] = +-"
" NGINX_VER "
" CRLF ++//"
" NGINX_VER "
" CRLF + "" CRLF + "" CRLF + ; + + + static u_char ngx_http_error_build_tail[] = +-"
" NGINX_VER_BUILD "
" CRLF ++//"
" NGINX_VER_BUILD "
" CRLF + "" CRLF + "" CRLF + ; + + + static u_char ngx_http_error_tail[] = +-"
" NGINX_NAME "
" CRLF ++//"
" NGINX_NAME "
" CRLF + "" CRLF + "" CRLF + ; diff --git a/freenginx-1.27.x-ngx_http_v2_filter_module.c.patch b/freenginx-1.27.x-ngx_http_v2_filter_module.c.patch new file mode 100644 index 0000000..e75d23c --- /dev/null +++ b/freenginx-1.27.x-ngx_http_v2_filter_module.c.patch @@ -0,0 +1,56 @@ +--- src/http/v2/ngx_http_v2_filter_module.c 2024-06-26 14:39:43.707374158 +0900 ++++ src/http/v2/ngx_http_v2_filter_module.c.new 2024-06-04 22:55:54.000000000 +0900 +@@ -119,7 +119,7 @@ + static const u_char accept_encoding[12] = + "\x8b\x84\x84\x2d\x69\x5b\x05\x44\x3c\x86\xaa\x6f"; + #endif ++/* +- + static size_t nginx_name_len = ngx_http_v2_literal_size(NGINX_NAME); + static u_char nginx_name[ngx_http_v2_literal_size(NGINX_NAME)]; + +@@ -129,7 +129,7 @@ + static size_t nginx_ver_build_len = + ngx_http_v2_literal_size(NGINX_VER_BUILD); + static u_char nginx_ver_build[ngx_http_v2_literal_size(NGINX_VER_BUILD)]; ++*/ +- + stream = r->stream; + + if (!stream) { +@@ -218,7 +218,7 @@ + len += status ? 1 : 1 + ngx_http_v2_literal_size("418"); + + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); ++/* +- + if (r->headers_out.server == NULL) { + + if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { +@@ -231,7 +231,7 @@ + len += 1 + nginx_name_len; + } + } ++*/ +- + if (r->headers_out.date == NULL) { + len += 1 + ngx_http_v2_literal_size("Wed, 31 Dec 1986 18:00:00 GMT"); + } +@@ -422,7 +422,7 @@ + *pos++ = NGX_HTTP_V2_ENCODE_RAW | 3; + pos = ngx_sprintf(pos, "%03ui", r->headers_out.status); + } ++/* +- + if (r->headers_out.server == NULL) { + + if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { +@@ -472,7 +472,7 @@ + pos = ngx_cpymem(pos, nginx_name, nginx_name_len); + } + } ++*/ +- + if (r->headers_out.date == NULL) { + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, fc->log, 0, + "http2 output header: \"date: %V\"", diff --git a/freenginx-1.27.x-ngx_http_v3_filter_module.c.patch b/freenginx-1.27.x-ngx_http_v3_filter_module.c.patch new file mode 100644 index 0000000..3f32afd --- /dev/null +++ b/freenginx-1.27.x-ngx_http_v3_filter_module.c.patch @@ -0,0 +1,38 @@ +--- src/http/v3/ngx_http_v3_filter_module.c 2024-06-26 14:41:00.415272870 +0900 ++++ src/http/v3/ngx_http_v3_filter_module.c.new 2024-06-04 22:55:54.000000000 +0900 +@@ -157,7 +157,7 @@ + } + + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); ++/* +- + if (r->headers_out.server == NULL) { + if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { + n = sizeof(NGINX_VER) - 1; +@@ -173,7 +173,7 @@ + NGX_HTTP_V3_HEADER_SERVER, + NULL, n); + } ++*/ +- + if (r->headers_out.date == NULL) { + len += ngx_http_v3_encode_field_lri(NULL, 0, NGX_HTTP_V3_HEADER_DATE, + NULL, ngx_cached_http_time.len); +@@ -338,7 +338,7 @@ + NULL, 3); + b->last = ngx_sprintf(b->last, "%03ui", r->headers_out.status); + } ++/* +- + if (r->headers_out.server == NULL) { + if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { + p = (u_char *) NGINX_VER; +@@ -360,7 +360,7 @@ + NGX_HTTP_V3_HEADER_SERVER, + p, n); + } ++*/ +- + if (r->headers_out.date == NULL) { + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, + "http3 output header: \"date: %V\"",