From 2651aa7870357342eadbdd2287f0aafb82efa2e1 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Thu, 5 Jul 2018 13:53:49 -0700 Subject: [PATCH 1/4] configure: now supports the --without-stream_ssl_module option to disable ngx_stream_ssl_module if necessary. fixes #388. --- util/configure | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/util/configure b/util/configure index cf75d7d..81a2cc9 100755 --- a/util/configure +++ b/util/configure @@ -287,6 +287,13 @@ for my $opt (@ARGV) { $resty_opts{no_http_ssl} = 1; $resty_opts{no_http_encrypted_session} = 1; + } elsif ($opt eq '--with-stream_ssl_module') { + $resty_opts{stream_ssl} = 1; + push @ngx_opts, $opt; + + } elsif ($opt eq '--without-stream_ssl_module') { + $resty_opts{no_stream_ssl} = 1; + } elsif ($opt =~ /^--add-module=(.*)/) { my $mod_path = File::Spec->rel2abs($1); @@ -488,7 +495,17 @@ _END_ } if (!$opts->{no_stream_lua}) { - push @ngx_opts, '--with-stream', '--with-stream_ssl_module'; + push @ngx_opts, '--with-stream'; + } + + if ($opts->{no_stream_ssl} && $opts->{http_stream}) { + die "--with-stream_ssl_module conflicts with --without-stream_ssl_module.", + "\n"; + } + + if (! $opts->{no_stream_ssl} && ! $opts->{stream_ssl}) { + $opts->{stream_ssl} = 1; + push @ngx_opts, '--with-stream_ssl_module'; } if (!$opts->{lua} @@ -1234,6 +1251,7 @@ _EOC_ $msg .= <<'_EOC_'; --without-ngx_devel_kit_module disable ngx_devel_kit_module --without-http_ssl_module disable ngx_http_ssl_module + --without-stream_ssl_module disable ngx_stream_ssl_module _EOC_ From d3f7e22de2a7883b26f0fc7fd00bc574c53673af Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Thu, 5 Jul 2018 17:46:53 -0700 Subject: [PATCH 2/4] bugfix: fixed a bug that concurrent --with-stream_ssl_module and --without-stream_ssl_module were not detected properly. --- util/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/configure b/util/configure index 81a2cc9..dbfddaa 100755 --- a/util/configure +++ b/util/configure @@ -498,7 +498,7 @@ _END_ push @ngx_opts, '--with-stream'; } - if ($opts->{no_stream_ssl} && $opts->{http_stream}) { + if ($opts->{no_stream_ssl} && $opts->{stream_ssl}) { die "--with-stream_ssl_module conflicts with --without-stream_ssl_module.", "\n"; } From 64636caf02cb372c16935371538a8dc95e72c64e Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Thu, 5 Jul 2018 17:48:15 -0700 Subject: [PATCH 3/4] tests: added tests for disabling stream_ssl_module. --- t/sanity.t | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/t/sanity.t b/t/sanity.t index 5f6a8f0..00664cd 100644 --- a/t/sanity.t +++ b/t/sanity.t @@ -2,7 +2,7 @@ use t::Config; -plan tests => 239; +plan tests => 245; #no_diff(); @@ -46,6 +46,7 @@ __DATA__ --without-stream_lua_module disable ngx_stream_lua_module --without-ngx_devel_kit_module disable ngx_devel_kit_module --without-http_ssl_module disable ngx_http_ssl_module + --without-stream_ssl_module disable ngx_stream_ssl_module --with-http_iconv_module enable ngx_http_iconv_module --with-http_drizzle_module enable ngx_http_drizzle_module @@ -798,6 +799,7 @@ clean: --without-stream_lua_module disable ngx_stream_lua_module --without-ngx_devel_kit_module disable ngx_devel_kit_module --without-http_ssl_module disable ngx_http_ssl_module + --without-stream_ssl_module disable ngx_stream_ssl_module --with-http_iconv_module enable ngx_http_iconv_module --with-http_drizzle_module enable ngx_http_drizzle_module @@ -4887,7 +4889,7 @@ sh ./configure --prefix=/usr/local/openresty/nginx \ --add-module=../redis-nginx-module-0.3.7 \ --add-module=../rds-json-nginx-module-0.15 \ --add-module=../rds-csv-nginx-module-0.09 \ - --with-http_ssl_module + --with-stream_ssl_module --with-http_ssl_module cd ../.. Type the following commands to build and install: gmake @@ -4997,3 +4999,55 @@ install: all clean: rm -rf build + + +=== TEST 63: --without-stream_ssl_module and --without-http_ssl_module are respected +--- cmd: ./configure --without-http_ssl_module --without-stream_ssl_module --dry-run +--- out +platform: linux (linux) +cp -rp bundle/ build +cd build +cd LuaJIT-2.1-20180420 +INFO: found -msse4.2 in cc. +gmake TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit +gmake install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root/ +export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib' +export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1' +cd .. +patching the resty script with hard-coded nginx binary path... +cd nginx-1.13.6 +sh ./configure --prefix=/usr/local/openresty/nginx \ + --with-cc-opt='-O2' \ + --add-module=../ngx_devel_kit-0.3.0 \ + --add-module=../echo-nginx-module-0.61 \ + --add-module=../xss-nginx-module-0.06 \ + --add-module=../ngx_coolkit-0.2rc3 \ + --add-module=../set-misc-nginx-module-0.32 \ + --add-module=../form-input-nginx-module-0.12 \ + --add-module=../srcache-nginx-module-0.31 \ + --add-module=../ngx_lua-0.10.13 \ + --add-module=../ngx_lua_upstream-0.07 \ + --add-module=../headers-more-nginx-module-0.33 \ + --add-module=../array-var-nginx-module-0.05 \ + --add-module=../memc-nginx-module-0.19 \ + --add-module=../redis2-nginx-module-0.15 \ + --add-module=../redis-nginx-module-0.3.7 \ + --add-module=../rds-json-nginx-module-0.15 \ + --add-module=../rds-csv-nginx-module-0.09 \ + --add-module=../ngx_stream_lua-0.0.5 \ + --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib' \ + --with-stream +cd ../.. +Type the following commands to build and install: + gmake + gmake install + + + +=== TEST 64: --without-stream_ssl_module and --with-stream_ssl_module specified at the same time causes errors +--- cmd: ./configure --with-stream_ssl_module --without-stream_ssl_module --dry-run +--- out +platform: linux (linux) +--- err +--with-stream_ssl_module conflicts with --without-stream_ssl_module. +--- exit: 2 From 1b9a9135293a156119203445653c301d89530c9b Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Thu, 5 Jul 2018 17:48:54 -0700 Subject: [PATCH 4/4] tests: ran reindex. --- t/sanity.t | 2 -- 1 file changed, 2 deletions(-) diff --git a/t/sanity.t b/t/sanity.t index 00664cd..76998f5 100644 --- a/t/sanity.t +++ b/t/sanity.t @@ -249,7 +249,6 @@ Options directly inherited from nginx - === TEST 2: --with-http_ssl_module & --without-http_ssl_module --- cmd: ./configure --with-http_ssl_module --without-http_ssl_module --- out @@ -1002,7 +1001,6 @@ Options directly inherited from nginx - === TEST 10: --with-http_drizzle_module on solaris --- cmd: ./configure --with-http_drizzle_module --dry-run --platform=solaris --- out