Index: www/nginx/Makefile =================================================================== --- www/nginx/Makefile +++ www/nginx/Makefile @@ -3,7 +3,7 @@ PORTNAME= nginx PORTVERSION= 1.12.2 -PORTREVISION?= 5 +PORTREVISION?= 6 PORTEPOCH= 2 CATEGORIES= www MASTER_SITES= http://nginx.org/download/ @@ -872,11 +872,6 @@ .else CONFIGURE_ARGS+=--add-module=${WRKSRC_lua} .endif -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-ngx_http_lua_common.h \ - ${PATCHDIR}/extra-patch-ngx_http_lua_headers.c \ - ${PATCHDIR}/extra-patch-ngx_http_lua_headers.h \ - ${PATCHDIR}/extra-patch-ngx_http_lua_module.c \ - ${PATCHDIR}/extra-patch-ngx_http_lua_ssl_ocsp.c .endif .if ${PORT_OPTIONS:MMEMC} @@ -892,7 +887,7 @@ .endif .if ${PORT_OPTIONS:MMODSECURITY} -NGINX_MODSECURITY_VERSION= 3.0.0 +NGINX_MODSECURITY_VERSION= 2.9.1 LIB_DEPENDS+= libapr-1.so:devel/apr1 \ libcurl.so:ftp/curl \ libluajit-5.1.so:lang/luajit \ @@ -980,7 +975,6 @@ GH_PROJECT+= redis2-nginx-module:redis2 GH_TAGNAME+= v${NGINX_REDIS2_VERSION}:redis2 CONFIGURE_ARGS+=--add-module=${WRKSRC_redis2} -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-ngx_http_redis2_util.c .endif .if ${PORT_OPTIONS:MRTMP} Index: www/nginx/distinfo =================================================================== --- www/nginx/distinfo +++ www/nginx/distinfo @@ -1,4 +1,4 @@ -TIMESTAMP = 1516399275 +TIMESTAMP = 1516807386 SHA256 (nginx-1.12.2.tar.gz) = 305f379da1d5fb5aefa79e45c829852ca6983c7cd2a79328f8e084a324cf0416 SIZE (nginx-1.12.2.tar.gz) = 981687 SHA256 (ngx_cache_purge-2.3.tar.gz) = 279e0d8a46d3b1521fd43b3f78bc1c08b263899142a7cc5058c1c0361a92c89c @@ -13,8 +13,8 @@ SIZE (ngx_http_response-0.3.tar.gz) = 2244 SHA256 (08a395c66e42.tar.gz) = 53e440737ed1aff1f09fae150219a45f16add0c8d6e84546cb7d80f73ebffd90 SIZE (08a395c66e42.tar.gz) = 120603 -SHA256 (modsecurity-3.0.0.tar.gz) = 51e288999c5903f4062afdca37a602c7ba14242120ba54cf22f90650b646d4dc -SIZE (modsecurity-3.0.0.tar.gz) = 5591 +SHA256 (modsecurity-2.9.1.tar.gz) = 958cc5a7a7430f93fac0fd6f8b9aa92fc1801efce0cda797d6029d44080a9b24 +SIZE (modsecurity-2.9.1.tar.gz) = 4261212 SHA256 (passenger-5.1.12.tar.gz) = 1705bd6d1f9b9d055fb58b3545ca6f38ca6d222c07201f53c5014e0eb09f4495 SIZE (passenger-5.1.12.tar.gz) = 4245993 SHA256 (ngx_slowfs_cache-1.10.tar.gz) = 1e81453942e5b0877de1f1f06c56ae82918ea9818255cb935bcb673c95a758a1 Index: www/nginx/files/extra-patch-fastdfs-src-config =================================================================== --- www/nginx/files/extra-patch-fastdfs-src-config +++ www/nginx/files/extra-patch-fastdfs-src-config @@ -1,5 +1,5 @@ ---- ../fastdfs-nginx-module-5a8110f/src/config.orig 2016-10-12 16:09:34.075804000 +0200 -+++ ../fastdfs-nginx-module-5a8110f/src/config 2016-10-12 16:10:43.916280000 +0200 +--- ../fastdfs-nginx-module-85347be/src/config.orig 2016-10-12 16:09:34.075804000 +0200 ++++ ../fastdfs-nginx-module-85347be/src/config 2016-10-12 16:10:43.916280000 +0200 @@ -3,16 +3,16 @@ if test -n "${ngx_module_link}"; then ngx_module_type=HTTP Index: www/nginx/files/extra-patch-fastdfs-src-mod_fastdfs.conf =================================================================== --- www/nginx/files/extra-patch-fastdfs-src-mod_fastdfs.conf +++ www/nginx/files/extra-patch-fastdfs-src-mod_fastdfs.conf @@ -1,5 +1,5 @@ ---- ../fastdfs-nginx-module-5a8110f/src/mod_fastdfs.conf.orig 2017-09-05 14:19:44.560907000 +0200 -+++ ../fastdfs-nginx-module-5a8110f/src/mod_fastdfs.conf 2017-09-05 14:24:43.475900000 +0200 +--- ../fastdfs-nginx-module-85347be/src/mod_fastdfs.conf.orig 2017-09-05 14:19:44.560907000 +0200 ++++ ../fastdfs-nginx-module-85347be/src/mod_fastdfs.conf 2017-09-05 14:24:43.475900000 +0200 @@ -59,8 +59,8 @@ # store_path#, based 0, if store_path0 not exists, it's value is base_path # the paths must be exist Index: www/nginx/files/extra-patch-ngx_http_lua_common.h =================================================================== --- www/nginx/files/extra-patch-ngx_http_lua_common.h +++ /dev/null @@ -1,15 +0,0 @@ ---- ../lua-nginx-module-0.10.8/src/ngx_http_lua_common.h.orig 2017-04-15 10:55:20.591680000 -0400 -+++ ../lua-nginx-module-0.10.8/src/ngx_http_lua_common.h 2017-04-15 10:55:50.449108000 -0400 -@@ -199,6 +199,12 @@ - of reqeusts */ - ngx_uint_t malloc_trim_req_count; - -+#if nginx_version >= 1011011 -+ /* the following 2 fields are only used by ngx.req.raw_headers() for now */ -+ ngx_buf_t **busy_buf_ptrs; -+ ngx_int_t busy_buf_ptr_count; -+#endif -+ - unsigned requires_header_filter:1; - unsigned requires_body_filter:1; - unsigned requires_capture_filter:1; Index: www/nginx/files/extra-patch-ngx_http_lua_headers.h =================================================================== --- www/nginx/files/extra-patch-ngx_http_lua_headers.h +++ /dev/null @@ -1,12 +0,0 @@ ---- ../lua-nginx-module-0.10.8/src/ngx_http_lua_headers.h.orig 2017-04-15 11:05:40.649209000 -0400 -+++ ../lua-nginx-module-0.10.8/src/ngx_http_lua_headers.h 2017-04-15 11:06:01.658936000 -0400 -@@ -15,6 +15,9 @@ - void ngx_http_lua_inject_resp_header_api(lua_State *L); - void ngx_http_lua_inject_req_header_api(lua_State *L); - void ngx_http_lua_create_headers_metatable(ngx_log_t *log, lua_State *L); -+#if nginx_version >= 1011011 -+void ngx_http_lua_ngx_raw_header_cleanup(void *data); -+#endif - - - #endif /* _NGX_HTTP_LUA_HEADERS_H_INCLUDED_ */ Index: www/nginx/files/extra-patch-ngx_http_lua_headers.c =================================================================== --- www/nginx/files/extra-patch-ngx_http_lua_headers.c +++ /dev/null @@ -1,124 +0,0 @@ ---- ../lua-nginx-module-0.10.8/src/ngx_http_lua_headers.c.orig 2017-04-15 10:57:48.875770000 -0400 -+++ ../lua-nginx-module-0.10.8/src/ngx_http_lua_headers.c 2017-04-15 11:02:00.492564000 -0400 -@@ -26,6 +26,9 @@ - static int ngx_http_lua_ngx_req_header_clear(lua_State *L); - static int ngx_http_lua_ngx_req_header_set(lua_State *L); - static int ngx_http_lua_ngx_resp_get_headers(lua_State *L); -+#if nginx_version >= 1011011 -+void ngx_http_lua_ngx_raw_header_cleanup(void *data); -+#endif - - - static int -@@ -77,6 +80,11 @@ - size_t size; - ngx_buf_t *b, *first = NULL; - ngx_int_t i, j; -+#if nginx_version >= 1011011 -+ ngx_buf_t **bb; -+ ngx_chain_t *cl; -+ ngx_http_lua_main_conf_t *lmcf; -+#endif - ngx_connection_t *c; - ngx_http_request_t *r, *mr; - ngx_http_connection_t *hc; -@@ -93,6 +101,10 @@ - return luaL_error(L, "no request object found"); - } - -+#if nginx_version >= 1011011 -+ lmcf = ngx_http_get_module_main_conf(r, ngx_http_lua_module); -+#endif -+ - ngx_http_lua_check_fake_request(L, r); - - mr = r->main; -@@ -109,8 +121,13 @@ - dd("hc->nbusy: %d", (int) hc->nbusy); - - if (hc->nbusy) { -+#if nginx_version >= 1011011 -+ dd("hc->busy: %p %p %p %p", hc->busy->buf->start, hc->busy->buf->pos, -+ hc->busy->buf->last, hc->busy->buf->end); -+#else - dd("hc->busy: %p %p %p %p", hc->busy[0]->start, hc->busy[0]->pos, - hc->busy[0]->last, hc->busy[0]->end); -+#endif - } - - dd("request line: %p %p", mr->request_line.data, -@@ -146,9 +163,37 @@ - dd("size: %d", (int) size); - - if (hc->nbusy) { -+#if nginx_version >= 1011011 -+ if (hc->nbusy > lmcf->busy_buf_ptr_count) { -+ if (lmcf->busy_buf_ptrs) { -+ ngx_free(lmcf->busy_buf_ptrs); -+ } -+ -+ lmcf->busy_buf_ptrs = ngx_alloc(hc->nbusy * sizeof(ngx_buf_t *), -+ r->connection->log); -+ -+ if (lmcf->busy_buf_ptrs == NULL) { -+ return luaL_error(L, "no memory"); -+ } -+ -+ lmcf->busy_buf_ptr_count = hc->nbusy; -+ } -+ -+ bb = lmcf->busy_buf_ptrs; -+ for (cl = hc->busy; cl; cl = cl->next) { -+ *bb++ = cl->buf; -+ } -+#endif - b = NULL; -+ -+#if nginx_version >= 1011011 -+ bb = lmcf->busy_buf_ptrs; -+ for (i = hc->nbusy; i > 0; i--) { -+ b = bb[i - 1]; -+#else - for (i = 0; i < hc->nbusy; i++) { - b = hc->busy[i]; -+#endif - - dd("busy buf: %d: [%.*s]", (int) i, (int) (b->pos - b->start), - b->start); -@@ -223,8 +268,15 @@ - } - - if (hc->nbusy) { -+ -+#if nginx_version >= 1011011 -+ bb = lmcf->busy_buf_ptrs; -+ for (i = hc->nbusy - 1; i >= 0; i--) { -+ b = bb[i]; -+#else - for (i = 0; i < hc->nbusy; i++) { - b = hc->busy[i]; -+#endif - - if (!found) { - if (b != first) { -@@ -1431,4 +1483,20 @@ - #endif /* NGX_LUA_NO_FFI_API */ - - -+#if nginx_version >= 1011011 -+void -+ngx_http_lua_ngx_raw_header_cleanup(void *data) -+{ -+ ngx_http_lua_main_conf_t *lmcf; -+ -+ lmcf = (ngx_http_lua_main_conf_t *) data; -+ -+ if (lmcf->busy_buf_ptrs) { -+ ngx_free(lmcf->busy_buf_ptrs); -+ lmcf->busy_buf_ptrs = NULL; -+ } -+} -+#endif -+ -+ - /* vi:set ft=c ts=4 sw=4 et fdm=marker: */ Index: www/nginx/files/extra-patch-ngx_http_lua_module.c =================================================================== --- www/nginx/files/extra-patch-ngx_http_lua_module.c +++ /dev/null @@ -1,36 +0,0 @@ ---- ../lua-nginx-module-0.10.8/src/ngx_http_lua_module.c.orig 2017-04-15 11:07:10.366543000 -0400 -+++ ../lua-nginx-module-0.10.8/src/ngx_http_lua_module.c 2017-04-15 11:08:25.640520000 -0400 -@@ -28,6 +28,7 @@ - #include "ngx_http_lua_ssl_certby.h" - #include "ngx_http_lua_ssl_session_storeby.h" - #include "ngx_http_lua_ssl_session_fetchby.h" -+#include "ngx_http_lua_headers.h" - - - static void *ngx_http_lua_create_main_conf(ngx_conf_t *cf); -@@ -624,7 +625,7 @@ - volatile ngx_cycle_t *saved_cycle; - ngx_http_core_main_conf_t *cmcf; - ngx_http_lua_main_conf_t *lmcf; --#ifndef NGX_LUA_NO_FFI_API -+#if !defined(NGX_LUA_NO_FFI_API) || nginx_version >= 1011011 - ngx_pool_cleanup_t *cln; - #endif - -@@ -716,6 +717,16 @@ - cln->handler = ngx_http_lua_sema_mm_cleanup; - #endif - -+#if nginx_version >= 1011011 -+ cln = ngx_pool_cleanup_add(cf->pool, 0); -+ if (cln == NULL) { -+ return NGX_ERROR; -+ } -+ -+ cln->data = lmcf; -+ cln->handler = ngx_http_lua_ngx_raw_header_cleanup; -+#endif -+ - if (lmcf->lua == NULL) { - dd("initializing lua vm"); - Index: www/nginx/files/extra-patch-ngx_http_lua_ssl_ocsp.c =================================================================== --- www/nginx/files/extra-patch-ngx_http_lua_ssl_ocsp.c +++ /dev/null @@ -1,12 +0,0 @@ ---- ../lua-nginx-module-0.10.8/src/ngx_http_lua_ssl_ocsp.c.orig 2017-04-30 17:32:37.211186000 -0400 -+++ ../lua-nginx-module-0.10.8/src/ngx_http_lua_ssl_ocsp.c 2017-04-30 17:33:42.926721000 -0400 -@@ -490,7 +490,9 @@ - - dd("set ocsp resp: resp_len=%d", (int) resp_len); - (void) SSL_set_tlsext_status_ocsp_resp(ssl_conn, p, resp_len); -+#ifndef LIBRESSL_VERSION_NUMBER - ssl_conn->tlsext_status_expected = 1; -+#endif - - return NGX_OK; - Index: www/nginx/files/extra-patch-ngx_http_redis2_util.c =================================================================== --- www/nginx/files/extra-patch-ngx_http_redis2_util.c +++ /dev/null @@ -1,18 +0,0 @@ ---- ../redis2-nginx-module-0.12/src/ngx_http_redis2_util.c.orig 2016-11-20 15:00:28.997903000 -0500 -+++ ../redis2-nginx-module-0.12/src/ngx_http_redis2_util.c 2016-11-20 15:00:44.173323000 -0500 -@@ -77,6 +77,7 @@ - continue; - } - -+#if (nginx_version < 1011006) - if (uscfp[i]->default_port - && url->default_port - && uscfp[i]->default_port != url->default_port) -@@ -84,6 +85,7 @@ - dd("upstream_add: default_port not match"); - continue; - } -+#endif - - return uscfp[i]; - }