From nobody Sun Jul 10 20:31:58 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9F02517F9399; Sun, 10 Jul 2022 20:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LgzFp47QQz3r0K; Sun, 10 Jul 2022 20:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657485118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M86Kriwxcqs7f0vYVn7LP3b7IhBYN/S0shyxUNGKcDU=; b=JZgCP+cwSnZRHRWsOprkZmEaB36HV29o71lmzW/7v47GgX8xuEyzayd/dCn4pG+e/dTjoe iyoyZ4zoaiioWwZg3Ir//cE/QIWk1NoVuKooJCD2peSosFj1x016w0GZ/WUgNVpMtfc69l yCund6qpI/M3vH/HvMiWp7u7FzuRtbB5h09lonouLc96+QpiGsiMr13mL+BupDBI2/3hzY ymuym8ViiLg5byFtWbkwXpoWHMhCYp5T8lG+4EqaN/hA4faiqpJbqFqOjAb5DiEmERg87d M5LJRQxabnd933vALVknFGGACECs2H+Z0YlfgyX8m4XJQY7SmvXIzjy00YuVKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LgzFp3CG2zdQT; Sun, 10 Jul 2022 20:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26AKVwLv003332; Sun, 10 Jul 2022 20:31:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26AKVwNn003331; Sun, 10 Jul 2022 20:31:58 GMT (envelope-from git) Date: Sun, 10 Jul 2022 20:31:58 GMT Message-Id: <202207102031.26AKVwNn003331@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: "Sergey A. Osokin" Subject: git: 9274f29acde6 - main - www/nginx-devel: enable third-party lua module back List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9274f29acde6ef0ae667f42aa1d3f9577030441e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657485118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M86Kriwxcqs7f0vYVn7LP3b7IhBYN/S0shyxUNGKcDU=; b=XnpMx8tg7ATmbxRadcL4guiS3qa9d7eIIjsWxe4bTjXbovV4XrIbYKB5dmiI7Ez4k+rkRo gfwc2ocFcejWiisw6kmZu7usY0HFuJL1uh0dExZ9H6g9YRLAFi4Bc7+L1rLtudzd8SZTXh 5YaLpupMkY6vHVGKfQZetsBB2RMI5NBf/ZaJLD/7NWhRJfj6wjJhi8BPf4PUm7Ykv1tb4J G7IyUKRxNXoWlv0z4Lvif4oCM9zewDteMBHprnCKRDT6IFOblqQi2+Zo9LJ+B7vUGg/NQA HOAR2Y0kX0Sm9b2KROUdbSXijEM/I67AY22jK+mRVeXPGSyN2c1LCXZrshXqRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657485118; a=rsa-sha256; cv=none; b=CuGPWOY9cQsmrdPueEFEL9GGJGJeu1PVo6TYTMOCa/gZFISmuE/ZQPj2aR/f7/qI4+a2HR kXZpNbbU4aN14vYWZv1MNMioTJEjUzSy7A1YKnezn3tSdfYzrlpaP26junF0rv4+PzoDkG m6yvTuW7iofd887Xejhmyw0e7sA/QJIk1UQygd2OzwixVCBEOG9Moohx6XcymhQBSbMm0d OEZd3L/j5w87Ecj8/nocoWMVQo3/svD8fBUSfJJ9SvrEdpJ52D6qQZB2ssvWLf1lgbKqO9 CKsc++A0GYrGzlyOt7qm2qK252bBMfniY21aUn84TfXj4pTmFxEaQaPRDM0z+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by osa: URL: https://cgit.FreeBSD.org/ports/commit/?id=9274f29acde6ef0ae667f42aa1d3f9577030441e commit 9274f29acde6ef0ae667f42aa1d3f9577030441e Author: Sergey A. Osokin AuthorDate: 2022-07-10 20:30:30 +0000 Commit: Sergey A. Osokin CommitDate: 2022-07-10 20:31:53 +0000 www/nginx-devel: enable third-party lua module back Bump PORTREVISION. --- www/nginx-devel/Makefile | 2 +- www/nginx-devel/Makefile.extmod | 1 + www/nginx-devel/files/extra-patch-lua-nginx-module | 167 +++++++++++++++++++++ 3 files changed, 169 insertions(+), 1 deletion(-) diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile index 1de332053904..0d94f81afdbb 100644 --- a/www/nginx-devel/Makefile +++ b/www/nginx-devel/Makefile @@ -2,6 +2,7 @@ PORTNAME?= nginx PORTVERSION= 1.23.0 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= https://nginx.org/download/ \ LOCAL/osa @@ -252,7 +253,6 @@ NJS_CONFIGURE_ARGS= --no-pcre2 ${PORT_OPTIONS:MHTTP_UPLOAD_PROGRESS} || \ ${PORT_OPTIONS:MHTTP_UPSTREAM_STICKY} || \ ${PORT_OPTIONS:MHTTP_ZIP} || \ - ${PORT_OPTIONS:MLUA} || \ ${PORT_OPTIONS:MNAXSI} || \ ${PORT_OPTIONS:MSRCACHE} || \ ${PORT_OPTIONS:MVOD} diff --git a/www/nginx-devel/Makefile.extmod b/www/nginx-devel/Makefile.extmod index 59e16850f99f..c8edbf55356b 100644 --- a/www/nginx-devel/Makefile.extmod +++ b/www/nginx-devel/Makefile.extmod @@ -229,6 +229,7 @@ LUA_CONFIGURE_ENV= LUAJIT_INC=${LOCALBASE}/include/luajit-2.1 \ LUAJIT_LIB=${LOCALBASE}/lib LUA_GH_TUPLE= openresty:lua-nginx-module:v0.10.21:lua LUA_VARS= DSO_EXTMODS+=lua +LUA_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-lua-nginx-module:-p1 LINK_GH_TUPLE= Taymindis:nginx-link-function:3.2.4:link LINK_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-nginx-link-function-config \ diff --git a/www/nginx-devel/files/extra-patch-lua-nginx-module b/www/nginx-devel/files/extra-patch-lua-nginx-module new file mode 100644 index 000000000000..b2a22d723d1f --- /dev/null +++ b/www/nginx-devel/files/extra-patch-lua-nginx-module @@ -0,0 +1,167 @@ +From b6d167cf1a93c0c885c28db5a439f2404874cb26 Mon Sep 17 00:00:00 2001 +From: Hiroaki Nakamura +Date: Tue, 28 Jun 2022 14:37:24 +0900 +Subject: [PATCH] bugfix: update handling of multiple headers changed in nginx + 1.23.0 (#2063) + +--- + src/ngx_http_lua_headers_in.c | 46 ++++++++++++++++++++++++ + src/ngx_http_lua_headers_out.c | 64 ++++++++++++++++++++++++++++++++++ + 2 files changed, 110 insertions(+) + +diff --git a/../lua-nginx-module-0.10.21/src/ngx_http_lua_headers_in.c b/src/ngx_http_lua_headers_in.c +index a55d9cac7..440548140 100644 +--- a/../lua-nginx-module-0.10.21/src/ngx_http_lua_headers_in.c ++++ b/../lua-nginx-module-0.10.21/src/ngx_http_lua_headers_in.c +@@ -152,9 +152,15 @@ static ngx_http_lua_set_header_t ngx_http_lua_set_handlers[] = { + ngx_http_set_builtin_header }, + #endif + ++#if defined(nginx_version) && nginx_version >= 1023000 ++ { ngx_string("Cookie"), ++ offsetof(ngx_http_headers_in_t, cookie), ++ ngx_http_set_builtin_multi_header }, ++#else + { ngx_string("Cookie"), + offsetof(ngx_http_headers_in_t, cookies), + ngx_http_set_builtin_multi_header }, ++#endif + + { ngx_null_string, 0, ngx_http_set_header } + }; +@@ -580,6 +586,45 @@ static ngx_int_t + ngx_http_set_builtin_multi_header(ngx_http_request_t *r, + ngx_http_lua_header_val_t *hv, ngx_str_t *value) + { ++#if defined(nginx_version) && nginx_version >= 1023000 ++ ngx_table_elt_t **headers, **ph, *h; ++ int nelts; ++ ++ headers = (ngx_table_elt_t **) ((char *) &r->headers_in + hv->offset); ++ ++ if (!hv->no_override && *headers != NULL) { ++ nelts = 0; ++ for (h = *headers; h; h = h->next) { ++ nelts++; ++ } ++ ++ *headers = NULL; ++ ++ dd("clear multi-value headers: %d", nelts); ++ } ++ ++ if (ngx_http_set_header_helper(r, hv, value, &h) == NGX_ERROR) { ++ return NGX_ERROR; ++ } ++ ++ if (value->len == 0) { ++ return NGX_OK; ++ } ++ ++ dd("new multi-value header: %p", h); ++ ++ if (*headers) { ++ for (ph = headers; *ph; ph = &(*ph)->next) { /* void */ } ++ *ph = h; ++ ++ } else { ++ *headers = h; ++ } ++ ++ h->next = NULL; ++ ++ return NGX_OK; ++#else + ngx_array_t *headers; + ngx_table_elt_t **v, *h; + +@@ -626,6 +671,7 @@ ngx_http_set_builtin_multi_header(ngx_http_request_t *r, + + *v = h; + return NGX_OK; ++#endif + } + + +diff --git a/../lua-nginx-module-0.10.21/src/ngx_http_lua_headers_out.c b/src/ngx_http_lua_headers_out.c +index 6e9f9c19a..571723d9a 100644 +--- a/../lua-nginx-module-0.10.21/src/ngx_http_lua_headers_out.c ++++ b/../lua-nginx-module-0.10.21/src/ngx_http_lua_headers_out.c +@@ -311,6 +311,69 @@ static ngx_int_t + ngx_http_set_builtin_multi_header(ngx_http_request_t *r, + ngx_http_lua_header_val_t *hv, ngx_str_t *value) + { ++#if defined(nginx_version) && nginx_version >= 1023000 ++ ngx_table_elt_t **headers, *h, *ho, **ph; ++ ++ headers = (ngx_table_elt_t **) ((char *) &r->headers_out + hv->offset); ++ ++ if (hv->no_override) { ++ for (h = *headers; h; h = h->next) { ++ if (!h->hash) { ++ h->value = *value; ++ h->hash = hv->hash; ++ return NGX_OK; ++ } ++ } ++ ++ goto create; ++ } ++ ++ /* override old values (if any) */ ++ ++ if (*headers) { ++ for (h = (*headers)->next; h; h = h->next) { ++ h->hash = 0; ++ h->value.len = 0; ++ } ++ ++ h = *headers; ++ ++ h->value = *value; ++ ++ if (value->len == 0) { ++ h->hash = 0; ++ ++ } else { ++ h->hash = hv->hash; ++ } ++ ++ return NGX_OK; ++ } ++ ++create: ++ ++ for (ph = headers; *ph; ph = &(*ph)->next) { /* void */ } ++ ++ ho = ngx_list_push(&r->headers_out.headers); ++ if (ho == NULL) { ++ return NGX_ERROR; ++ } ++ ++ ho->value = *value; ++ ++ if (value->len == 0) { ++ ho->hash = 0; ++ ++ } else { ++ ho->hash = hv->hash; ++ } ++ ++ ho->key = hv->key; ++ ho->next = NULL; ++ *ph = ho; ++ ++ return NGX_OK; ++#else + ngx_array_t *pa; + ngx_table_elt_t *ho, **ph; + ngx_uint_t i; +@@ -384,6 +447,7 @@ ngx_http_set_builtin_multi_header(ngx_http_request_t *r, + *ph = ho; + + return NGX_OK; ++#endif + } + +